@intlayer/core 9.0.0-canary.2 → 9.0.0-canary.20

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 (513) hide show
  1. package/dist/cjs/deepTransformPlugins/getEditedContent.cjs +2 -1
  2. package/dist/cjs/deepTransformPlugins/getEditedContent.cjs.map +1 -1
  3. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -1
  4. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -1
  5. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -1
  6. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -1
  7. package/dist/cjs/deepTransformPlugins/getMaskContent.cjs.map +1 -1
  8. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -1
  9. package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs.map +1 -1
  10. package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -1
  11. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs +1 -1
  12. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs.map +1 -1
  13. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -1
  14. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
  15. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
  16. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
  17. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
  18. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
  19. package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
  20. package/dist/cjs/dictionaryManipulator/index.cjs +4 -3
  21. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +1 -2
  22. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
  23. package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs +9 -12
  24. package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs.map +1 -1
  25. package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs.map +1 -1
  26. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +0 -1
  27. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -1
  28. package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs +116 -101
  29. package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs.map +1 -1
  30. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
  31. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
  32. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
  33. package/dist/cjs/formatters/compact.cjs +1 -2
  34. package/dist/cjs/formatters/compact.cjs.map +1 -1
  35. package/dist/cjs/formatters/currency.cjs +1 -2
  36. package/dist/cjs/formatters/currency.cjs.map +1 -1
  37. package/dist/cjs/formatters/date.cjs +1 -3
  38. package/dist/cjs/formatters/date.cjs.map +1 -1
  39. package/dist/cjs/formatters/list.cjs +1 -2
  40. package/dist/cjs/formatters/list.cjs.map +1 -1
  41. package/dist/cjs/formatters/number.cjs +1 -2
  42. package/dist/cjs/formatters/number.cjs.map +1 -1
  43. package/dist/cjs/formatters/percentage.cjs +1 -2
  44. package/dist/cjs/formatters/percentage.cjs.map +1 -1
  45. package/dist/cjs/formatters/relativeTime.cjs +1 -2
  46. package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
  47. package/dist/cjs/formatters/units.cjs +1 -2
  48. package/dist/cjs/formatters/units.cjs.map +1 -1
  49. package/dist/cjs/index.cjs +14 -3
  50. package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
  51. package/dist/cjs/interpreter/getContent/deepTransform.cjs +3 -2
  52. package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
  53. package/dist/cjs/interpreter/getContent/getContent.cjs +0 -1
  54. package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -1
  55. package/dist/cjs/interpreter/getContent/plugins.cjs +12 -10
  56. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  57. package/dist/cjs/interpreter/getDictionary.cjs +5 -5
  58. package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
  59. package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
  60. package/dist/cjs/interpreter/getGender.cjs.map +1 -1
  61. package/dist/cjs/interpreter/getHTML.cjs.map +1 -1
  62. package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
  63. package/dist/cjs/interpreter/getIntlayer.cjs +4 -4
  64. package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
  65. package/dist/cjs/interpreter/getNesting.cjs.map +1 -1
  66. package/dist/cjs/interpreter/getPlural.cjs +1 -1
  67. package/dist/cjs/interpreter/getPlural.cjs.map +1 -1
  68. package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
  69. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
  70. package/dist/cjs/localization/comparePaths.cjs +75 -0
  71. package/dist/cjs/localization/comparePaths.cjs.map +1 -0
  72. package/dist/cjs/localization/domainUtils.cjs +82 -0
  73. package/dist/cjs/localization/domainUtils.cjs.map +1 -0
  74. package/dist/cjs/localization/generateSitemap.cjs +2 -1
  75. package/dist/cjs/localization/generateSitemap.cjs.map +1 -1
  76. package/dist/cjs/localization/getBrowserLocale.cjs +7 -4
  77. package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
  78. package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
  79. package/dist/cjs/localization/getLocale.cjs +0 -1
  80. package/dist/cjs/localization/getLocale.cjs.map +1 -1
  81. package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
  82. package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
  83. package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
  84. package/dist/cjs/localization/getLocalizedUrl.cjs +7 -15
  85. package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
  86. package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
  87. package/dist/cjs/localization/getPathWithoutLocale.cjs +2 -3
  88. package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
  89. package/dist/cjs/localization/getPrefix.cjs +6 -11
  90. package/dist/cjs/localization/getPrefix.cjs.map +1 -1
  91. package/dist/cjs/localization/index.cjs +8 -0
  92. package/dist/cjs/localization/localeDetector.cjs +2 -1
  93. package/dist/cjs/localization/localeDetector.cjs.map +1 -1
  94. package/dist/cjs/localization/localeMapper.cjs +0 -1
  95. package/dist/cjs/localization/localeMapper.cjs.map +1 -1
  96. package/dist/cjs/localization/localeResolver.cjs +0 -1
  97. package/dist/cjs/localization/localeResolver.cjs.map +1 -1
  98. package/dist/cjs/localization/rewriteUtils.cjs +3 -2
  99. package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
  100. package/dist/cjs/localization/validatePrefix.cjs +2 -2
  101. package/dist/cjs/localization/validatePrefix.cjs.map +1 -1
  102. package/dist/cjs/markdown/compiler.cjs +2 -1
  103. package/dist/cjs/markdown/compiler.cjs.map +1 -1
  104. package/dist/cjs/markdown/constants.cjs.map +1 -1
  105. package/dist/cjs/markdown/parser.cjs.map +1 -1
  106. package/dist/cjs/markdown/renderer.cjs.map +1 -1
  107. package/dist/cjs/markdown/utils.cjs.map +1 -1
  108. package/dist/cjs/messageFormat/ICU.cjs +15 -9
  109. package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
  110. package/dist/cjs/messageFormat/i18next.cjs +12 -7
  111. package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
  112. package/dist/cjs/messageFormat/index.cjs +2 -0
  113. package/dist/cjs/messageFormat/navigatePath.cjs +38 -0
  114. package/dist/cjs/messageFormat/navigatePath.cjs.map +1 -0
  115. package/dist/cjs/messageFormat/po.cjs.map +1 -1
  116. package/dist/cjs/messageFormat/resolveMessage.cjs +11 -8
  117. package/dist/cjs/messageFormat/resolveMessage.cjs.map +1 -1
  118. package/dist/cjs/messageFormat/verify-icu-format.cjs.map +1 -1
  119. package/dist/cjs/messageFormat/vue-i18n.cjs +2 -1
  120. package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
  121. package/dist/cjs/transpiler/condition/condition.cjs +0 -1
  122. package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
  123. package/dist/cjs/transpiler/enumeration/enumeration.cjs +0 -1
  124. package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
  125. package/dist/cjs/transpiler/file/file.cjs +2 -2
  126. package/dist/cjs/transpiler/file/file.cjs.map +1 -1
  127. package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
  128. package/dist/cjs/transpiler/gender/gender.cjs +0 -1
  129. package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
  130. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -1
  131. package/dist/cjs/transpiler/html/html.cjs +0 -1
  132. package/dist/cjs/transpiler/html/html.cjs.map +1 -1
  133. package/dist/cjs/transpiler/html/htmlTags.cjs.map +1 -1
  134. package/dist/cjs/transpiler/html/validateHTML.cjs +1 -1
  135. package/dist/cjs/transpiler/html/validateHTML.cjs.map +1 -1
  136. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
  137. package/dist/cjs/transpiler/insertion/insertion.cjs +0 -1
  138. package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
  139. package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
  140. package/dist/cjs/transpiler/markdown/markdown.cjs +0 -1
  141. package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
  142. package/dist/cjs/transpiler/markdown/validateMarkdown.cjs.map +1 -1
  143. package/dist/cjs/transpiler/nesting/nesting.cjs +0 -1
  144. package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
  145. package/dist/cjs/transpiler/plural/plural.cjs +0 -1
  146. package/dist/cjs/transpiler/plural/plural.cjs.map +1 -1
  147. package/dist/cjs/transpiler/translation/translation.cjs +0 -1
  148. package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
  149. package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
  150. package/dist/cjs/utils/cookieExpiry.cjs.map +1 -1
  151. package/dist/cjs/utils/getCookie.cjs.map +1 -1
  152. package/dist/cjs/utils/intl.cjs +101 -26
  153. package/dist/cjs/utils/intl.cjs.map +1 -1
  154. package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
  155. package/dist/cjs/utils/localeStorage.cjs +4 -5
  156. package/dist/cjs/utils/localeStorage.cjs.map +1 -1
  157. package/dist/cjs/utils/parseYaml.cjs +1 -1
  158. package/dist/cjs/utils/parseYaml.cjs.map +1 -1
  159. package/dist/cjs/utils/stringifyYaml.cjs +1 -1
  160. package/dist/cjs/utils/stringifyYaml.cjs.map +1 -1
  161. package/dist/esm/deepTransformPlugins/getEditedContent.mjs +2 -1
  162. package/dist/esm/deepTransformPlugins/getEditedContent.mjs.map +1 -1
  163. package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs.map +1 -1
  164. package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -1
  165. package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs.map +1 -1
  166. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -1
  167. package/dist/esm/deepTransformPlugins/getMaskContent.mjs.map +1 -1
  168. package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs.map +1 -1
  169. package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs.map +1 -1
  170. package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -1
  171. package/dist/esm/deepTransformPlugins/getSplittedContent.mjs +1 -1
  172. package/dist/esm/deepTransformPlugins/getSplittedContent.mjs.map +1 -1
  173. package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -1
  174. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
  175. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
  176. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
  177. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
  178. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
  179. package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
  180. package/dist/esm/dictionaryManipulator/index.mjs +2 -2
  181. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +1 -1
  182. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -1
  183. package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs +10 -12
  184. package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs.map +1 -1
  185. package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs.map +1 -1
  186. package/dist/esm/dictionaryManipulator/orderDictionaries.mjs.map +1 -1
  187. package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs +113 -99
  188. package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs.map +1 -1
  189. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
  190. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
  191. package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs.map +1 -1
  192. package/dist/esm/formatters/compact.mjs +1 -1
  193. package/dist/esm/formatters/compact.mjs.map +1 -1
  194. package/dist/esm/formatters/currency.mjs +1 -1
  195. package/dist/esm/formatters/currency.mjs.map +1 -1
  196. package/dist/esm/formatters/date.mjs +1 -2
  197. package/dist/esm/formatters/date.mjs.map +1 -1
  198. package/dist/esm/formatters/list.mjs +1 -1
  199. package/dist/esm/formatters/list.mjs.map +1 -1
  200. package/dist/esm/formatters/number.mjs +1 -1
  201. package/dist/esm/formatters/number.mjs.map +1 -1
  202. package/dist/esm/formatters/percentage.mjs +1 -1
  203. package/dist/esm/formatters/percentage.mjs.map +1 -1
  204. package/dist/esm/formatters/relativeTime.mjs +1 -1
  205. package/dist/esm/formatters/relativeTime.mjs.map +1 -1
  206. package/dist/esm/formatters/units.mjs +1 -1
  207. package/dist/esm/formatters/units.mjs.map +1 -1
  208. package/dist/esm/index.mjs +5 -2
  209. package/dist/esm/interpreter/getCondition.mjs.map +1 -1
  210. package/dist/esm/interpreter/getContent/deepTransform.mjs +3 -2
  211. package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
  212. package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -1
  213. package/dist/esm/interpreter/getContent/plugins.mjs +12 -10
  214. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  215. package/dist/esm/interpreter/getDictionary.mjs +5 -5
  216. package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
  217. package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
  218. package/dist/esm/interpreter/getGender.mjs.map +1 -1
  219. package/dist/esm/interpreter/getHTML.mjs.map +1 -1
  220. package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
  221. package/dist/esm/interpreter/getIntlayer.mjs +4 -3
  222. package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
  223. package/dist/esm/interpreter/getNesting.mjs.map +1 -1
  224. package/dist/esm/interpreter/getPlural.mjs +1 -1
  225. package/dist/esm/interpreter/getPlural.mjs.map +1 -1
  226. package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
  227. package/dist/esm/interpreter/splitAndJoinInsertion.mjs.map +1 -1
  228. package/dist/esm/localization/comparePaths.mjs +73 -0
  229. package/dist/esm/localization/comparePaths.mjs.map +1 -0
  230. package/dist/esm/localization/domainUtils.mjs +77 -0
  231. package/dist/esm/localization/domainUtils.mjs.map +1 -0
  232. package/dist/esm/localization/generateSitemap.mjs +2 -1
  233. package/dist/esm/localization/generateSitemap.mjs.map +1 -1
  234. package/dist/esm/localization/getBrowserLocale.mjs +7 -3
  235. package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
  236. package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
  237. package/dist/esm/localization/getLocale.mjs.map +1 -1
  238. package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
  239. package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
  240. package/dist/esm/localization/getLocaleName.mjs.map +1 -1
  241. package/dist/esm/localization/getLocalizedUrl.mjs +7 -14
  242. package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
  243. package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
  244. package/dist/esm/localization/getPathWithoutLocale.mjs +2 -2
  245. package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
  246. package/dist/esm/localization/getPrefix.mjs +6 -10
  247. package/dist/esm/localization/getPrefix.mjs.map +1 -1
  248. package/dist/esm/localization/index.mjs +3 -1
  249. package/dist/esm/localization/localeDetector.mjs +2 -1
  250. package/dist/esm/localization/localeDetector.mjs.map +1 -1
  251. package/dist/esm/localization/localeMapper.mjs.map +1 -1
  252. package/dist/esm/localization/localeResolver.mjs.map +1 -1
  253. package/dist/esm/localization/rewriteUtils.mjs +3 -2
  254. package/dist/esm/localization/rewriteUtils.mjs.map +1 -1
  255. package/dist/esm/localization/validatePrefix.mjs +2 -2
  256. package/dist/esm/localization/validatePrefix.mjs.map +1 -1
  257. package/dist/esm/markdown/compiler.mjs +2 -1
  258. package/dist/esm/markdown/compiler.mjs.map +1 -1
  259. package/dist/esm/markdown/constants.mjs.map +1 -1
  260. package/dist/esm/markdown/parser.mjs.map +1 -1
  261. package/dist/esm/markdown/renderer.mjs.map +1 -1
  262. package/dist/esm/markdown/utils.mjs.map +1 -1
  263. package/dist/esm/messageFormat/ICU.mjs +15 -9
  264. package/dist/esm/messageFormat/ICU.mjs.map +1 -1
  265. package/dist/esm/messageFormat/i18next.mjs +12 -7
  266. package/dist/esm/messageFormat/i18next.mjs.map +1 -1
  267. package/dist/esm/messageFormat/index.mjs +2 -1
  268. package/dist/esm/messageFormat/navigatePath.mjs +36 -0
  269. package/dist/esm/messageFormat/navigatePath.mjs.map +1 -0
  270. package/dist/esm/messageFormat/po.mjs.map +1 -1
  271. package/dist/esm/messageFormat/resolveMessage.mjs +11 -8
  272. package/dist/esm/messageFormat/resolveMessage.mjs.map +1 -1
  273. package/dist/esm/messageFormat/verify-icu-format.mjs.map +1 -1
  274. package/dist/esm/messageFormat/vue-i18n.mjs +2 -1
  275. package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
  276. package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
  277. package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
  278. package/dist/esm/transpiler/file/file.mjs +2 -1
  279. package/dist/esm/transpiler/file/file.mjs.map +1 -1
  280. package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
  281. package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
  282. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -1
  283. package/dist/esm/transpiler/html/html.mjs.map +1 -1
  284. package/dist/esm/transpiler/html/htmlTags.mjs.map +1 -1
  285. package/dist/esm/transpiler/html/validateHTML.mjs +1 -1
  286. package/dist/esm/transpiler/html/validateHTML.mjs.map +1 -1
  287. package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
  288. package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
  289. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
  290. package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
  291. package/dist/esm/transpiler/markdown/validateMarkdown.mjs.map +1 -1
  292. package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
  293. package/dist/esm/transpiler/plural/plural.mjs.map +1 -1
  294. package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
  295. package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
  296. package/dist/esm/utils/cookieExpiry.mjs.map +1 -1
  297. package/dist/esm/utils/getCookie.mjs.map +1 -1
  298. package/dist/esm/utils/intl.mjs +100 -25
  299. package/dist/esm/utils/intl.mjs.map +1 -1
  300. package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
  301. package/dist/esm/utils/localeStorage.mjs +4 -4
  302. package/dist/esm/utils/localeStorage.mjs.map +1 -1
  303. package/dist/esm/utils/parseYaml.mjs +1 -1
  304. package/dist/esm/utils/parseYaml.mjs.map +1 -1
  305. package/dist/esm/utils/stringifyYaml.mjs +1 -1
  306. package/dist/esm/utils/stringifyYaml.mjs.map +1 -1
  307. package/dist/types/deepTransformPlugins/getEditedContent.d.ts +0 -1
  308. package/dist/types/deepTransformPlugins/getEditedContent.d.ts.map +1 -1
  309. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +12 -14
  310. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
  311. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +12 -14
  312. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -1
  313. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +12 -14
  314. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -1
  315. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +1 -1
  316. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +1 -1
  317. package/dist/types/deepTransformPlugins/getMaskContent.d.ts +1 -1
  318. package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -1
  319. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +1 -1
  320. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +1 -1
  321. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts +0 -1
  322. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts.map +1 -1
  323. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +1 -1
  324. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -1
  325. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts +1 -2
  326. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts.map +1 -1
  327. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +1 -2
  328. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +1 -1
  329. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +0 -1
  330. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +1 -1
  331. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +0 -1
  332. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +1 -1
  333. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +0 -1
  334. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -1
  335. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +0 -1
  336. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -1
  337. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +0 -1
  338. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -1
  339. package/dist/types/dictionaryManipulator/getNodeType.d.ts +0 -1
  340. package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -1
  341. package/dist/types/dictionaryManipulator/index.d.ts +2 -2
  342. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +0 -1
  343. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -1
  344. package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts +1 -2
  345. package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts.map +1 -1
  346. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +0 -1
  347. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +1 -1
  348. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +1 -2
  349. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -1
  350. package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts +59 -36
  351. package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts.map +1 -1
  352. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +0 -1
  353. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +1 -1
  354. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +1 -2
  355. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +1 -1
  356. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +0 -1
  357. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +1 -1
  358. package/dist/types/formatters/compact.d.ts +0 -1
  359. package/dist/types/formatters/compact.d.ts.map +1 -1
  360. package/dist/types/formatters/currency.d.ts +0 -1
  361. package/dist/types/formatters/currency.d.ts.map +1 -1
  362. package/dist/types/formatters/date.d.ts +0 -1
  363. package/dist/types/formatters/date.d.ts.map +1 -1
  364. package/dist/types/formatters/index.d.ts +2 -2
  365. package/dist/types/formatters/list.d.ts +0 -1
  366. package/dist/types/formatters/list.d.ts.map +1 -1
  367. package/dist/types/formatters/number.d.ts +1 -5
  368. package/dist/types/formatters/number.d.ts.map +1 -1
  369. package/dist/types/formatters/percentage.d.ts +1 -5
  370. package/dist/types/formatters/percentage.d.ts.map +1 -1
  371. package/dist/types/formatters/relativeTime.d.ts +0 -1
  372. package/dist/types/formatters/relativeTime.d.ts.map +1 -1
  373. package/dist/types/formatters/units.d.ts +0 -1
  374. package/dist/types/formatters/units.d.ts.map +1 -1
  375. package/dist/types/index.d.ts +15 -3
  376. package/dist/types/interpreter/getCondition.d.ts +1 -0
  377. package/dist/types/interpreter/getCondition.d.ts.map +1 -1
  378. package/dist/types/interpreter/getContent/deepTransform.d.ts +0 -1
  379. package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -1
  380. package/dist/types/interpreter/getContent/getContent.d.ts +0 -1
  381. package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
  382. package/dist/types/interpreter/getContent/plugins.d.ts +4 -4
  383. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
  384. package/dist/types/interpreter/getDictionary.d.ts +6 -6
  385. package/dist/types/interpreter/getDictionary.d.ts.map +1 -1
  386. package/dist/types/interpreter/getEnumeration.d.ts +1 -0
  387. package/dist/types/interpreter/getEnumeration.d.ts.map +1 -1
  388. package/dist/types/interpreter/getGender.d.ts +1 -0
  389. package/dist/types/interpreter/getGender.d.ts.map +1 -1
  390. package/dist/types/interpreter/getHTML.d.ts.map +1 -1
  391. package/dist/types/interpreter/getInsertion.d.ts +2 -1
  392. package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
  393. package/dist/types/interpreter/getIntlayer.d.ts +2 -2
  394. package/dist/types/interpreter/getIntlayer.d.ts.map +1 -1
  395. package/dist/types/interpreter/getNesting.d.ts +2 -1
  396. package/dist/types/interpreter/getNesting.d.ts.map +1 -1
  397. package/dist/types/interpreter/getPlural.d.ts +0 -1
  398. package/dist/types/interpreter/getPlural.d.ts.map +1 -1
  399. package/dist/types/interpreter/getTranslation.d.ts +0 -1
  400. package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
  401. package/dist/types/interpreter/index.d.ts +1 -0
  402. package/dist/types/interpreter/splitAndJoinInsertion.d.ts.map +1 -1
  403. package/dist/types/localization/comparePaths.d.ts +65 -0
  404. package/dist/types/localization/comparePaths.d.ts.map +1 -0
  405. package/dist/types/localization/domainUtils.d.ts +69 -0
  406. package/dist/types/localization/domainUtils.d.ts.map +1 -0
  407. package/dist/types/localization/generateSitemap.d.ts +6 -4
  408. package/dist/types/localization/generateSitemap.d.ts.map +1 -1
  409. package/dist/types/localization/getBrowserLocale.d.ts +0 -1
  410. package/dist/types/localization/getBrowserLocale.d.ts.map +1 -1
  411. package/dist/types/localization/getHTMLTextDir.d.ts +0 -1
  412. package/dist/types/localization/getHTMLTextDir.d.ts.map +1 -1
  413. package/dist/types/localization/getLocale.d.ts +0 -1
  414. package/dist/types/localization/getLocale.d.ts.map +1 -1
  415. package/dist/types/localization/getLocaleFromPath.d.ts +0 -1
  416. package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -1
  417. package/dist/types/localization/getLocaleLang.d.ts +0 -1
  418. package/dist/types/localization/getLocaleLang.d.ts.map +1 -1
  419. package/dist/types/localization/getLocaleName.d.ts +0 -1
  420. package/dist/types/localization/getLocaleName.d.ts.map +1 -1
  421. package/dist/types/localization/getLocalizedUrl.d.ts +0 -1
  422. package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -1
  423. package/dist/types/localization/getMultilingualUrls.d.ts +0 -1
  424. package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -1
  425. package/dist/types/localization/getPathWithoutLocale.d.ts +0 -1
  426. package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -1
  427. package/dist/types/localization/getPrefix.d.ts +2 -3
  428. package/dist/types/localization/getPrefix.d.ts.map +1 -1
  429. package/dist/types/localization/index.d.ts +3 -1
  430. package/dist/types/localization/localeDetector.d.ts +0 -1
  431. package/dist/types/localization/localeDetector.d.ts.map +1 -1
  432. package/dist/types/localization/localeMapper.d.ts +3 -4
  433. package/dist/types/localization/localeMapper.d.ts.map +1 -1
  434. package/dist/types/localization/localeResolver.d.ts +0 -1
  435. package/dist/types/localization/localeResolver.d.ts.map +1 -1
  436. package/dist/types/localization/rewriteUtils.d.ts +2 -3
  437. package/dist/types/localization/rewriteUtils.d.ts.map +1 -1
  438. package/dist/types/localization/validatePrefix.d.ts +0 -1
  439. package/dist/types/localization/validatePrefix.d.ts.map +1 -1
  440. package/dist/types/markdown/compiler.d.ts +0 -1
  441. package/dist/types/markdown/compiler.d.ts.map +1 -1
  442. package/dist/types/markdown/constants.d.ts +48 -38
  443. package/dist/types/markdown/constants.d.ts.map +1 -1
  444. package/dist/types/markdown/index.d.ts +2 -1
  445. package/dist/types/markdown/parser.d.ts +0 -1
  446. package/dist/types/markdown/parser.d.ts.map +1 -1
  447. package/dist/types/markdown/renderer.d.ts +0 -1
  448. package/dist/types/markdown/renderer.d.ts.map +1 -1
  449. package/dist/types/markdown/types.d.ts +44 -24
  450. package/dist/types/markdown/types.d.ts.map +1 -1
  451. package/dist/types/markdown/utils.d.ts +3 -4
  452. package/dist/types/markdown/utils.d.ts.map +1 -1
  453. package/dist/types/messageFormat/ICU.d.ts +2 -3
  454. package/dist/types/messageFormat/ICU.d.ts.map +1 -1
  455. package/dist/types/messageFormat/i18next.d.ts +2 -3
  456. package/dist/types/messageFormat/i18next.d.ts.map +1 -1
  457. package/dist/types/messageFormat/index.d.ts +2 -1
  458. package/dist/types/messageFormat/navigatePath.d.ts +22 -0
  459. package/dist/types/messageFormat/navigatePath.d.ts.map +1 -0
  460. package/dist/types/messageFormat/po.d.ts +2 -3
  461. package/dist/types/messageFormat/po.d.ts.map +1 -1
  462. package/dist/types/messageFormat/resolveMessage.d.ts +0 -1
  463. package/dist/types/messageFormat/resolveMessage.d.ts.map +1 -1
  464. package/dist/types/messageFormat/verify-icu-format.d.ts +1 -1
  465. package/dist/types/messageFormat/vue-i18n.d.ts +2 -3
  466. package/dist/types/messageFormat/vue-i18n.d.ts.map +1 -1
  467. package/dist/types/transpiler/condition/condition.d.ts +0 -1
  468. package/dist/types/transpiler/condition/condition.d.ts.map +1 -1
  469. package/dist/types/transpiler/enumeration/enumeration.d.ts +0 -1
  470. package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -1
  471. package/dist/types/transpiler/file/file.d.ts +0 -1
  472. package/dist/types/transpiler/file/file.d.ts.map +1 -1
  473. package/dist/types/transpiler/file/fileBrowser.d.ts +0 -1
  474. package/dist/types/transpiler/file/fileBrowser.d.ts.map +1 -1
  475. package/dist/types/transpiler/gender/gender.d.ts +0 -1
  476. package/dist/types/transpiler/gender/gender.d.ts.map +1 -1
  477. package/dist/types/transpiler/html/getHTMLCustomComponents.d.ts.map +1 -1
  478. package/dist/types/transpiler/html/html.d.ts +0 -1
  479. package/dist/types/transpiler/html/html.d.ts.map +1 -1
  480. package/dist/types/transpiler/html/htmlTags.d.ts +1 -1
  481. package/dist/types/transpiler/html/htmlTags.d.ts.map +1 -1
  482. package/dist/types/transpiler/html/validateHTML.d.ts.map +1 -1
  483. package/dist/types/transpiler/index.d.ts +11 -1
  484. package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -1
  485. package/dist/types/transpiler/insertion/insertion.d.ts +0 -1
  486. package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -1
  487. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -1
  488. package/dist/types/transpiler/markdown/index.d.ts +1 -1
  489. package/dist/types/transpiler/markdown/markdown.d.ts +0 -1
  490. package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -1
  491. package/dist/types/transpiler/markdown/validateMarkdown.d.ts +0 -1
  492. package/dist/types/transpiler/markdown/validateMarkdown.d.ts.map +1 -1
  493. package/dist/types/transpiler/nesting/nesting.d.ts +4 -4
  494. package/dist/types/transpiler/nesting/nesting.d.ts.map +1 -1
  495. package/dist/types/transpiler/plural/plural.d.ts +0 -1
  496. package/dist/types/transpiler/plural/plural.d.ts.map +1 -1
  497. package/dist/types/transpiler/translation/translation.d.ts +0 -1
  498. package/dist/types/transpiler/translation/translation.d.ts.map +1 -1
  499. package/dist/types/utils/checkIsURLAbsolute.d.ts.map +1 -1
  500. package/dist/types/utils/cookieExpiry.d.ts +1 -2
  501. package/dist/types/utils/cookieExpiry.d.ts.map +1 -1
  502. package/dist/types/utils/getCookie.d.ts.map +1 -1
  503. package/dist/types/utils/index.d.ts +2 -2
  504. package/dist/types/utils/intl.d.ts +49 -5
  505. package/dist/types/utils/intl.d.ts.map +1 -1
  506. package/dist/types/utils/isSameKeyPath.d.ts +0 -1
  507. package/dist/types/utils/isSameKeyPath.d.ts.map +1 -1
  508. package/dist/types/utils/isValidReactElement.d.ts.map +1 -1
  509. package/dist/types/utils/localeStorage.d.ts +1 -2
  510. package/dist/types/utils/localeStorage.d.ts.map +1 -1
  511. package/dist/types/utils/parseYaml.d.ts.map +1 -1
  512. package/dist/types/utils/stringifyYaml.d.ts.map +1 -1
  513. package/package.json +10 -10
@@ -1 +1 @@
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.PLURAL,\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;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
+ {"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.PLURAL,\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;CAC9D,OACE,OAAO,YAAY,YACnB,YAAY,QACZ,cAAc,WACd,OAAQ,QAAsB,aAAa;AAE/C;;;;AAKA,MAAM,mBAAmB,aAA2C;CAClE,OAAO;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;EACVA,yBAAU;CACZ,CAAC,CAAC,SAAS,QAAoB;AACjC;AAEA,MAAa,eAAe,YAAmC;CAC7D,IAAI,OAAO,YAAY,UACrB,OAAOA,yBAAU;CAGnB,IAAI,YAAY,OAAO,GAAG;EACxB,MAAM,WAAW,QAAQ;EACzB,IAAI,gBAAgB,QAAQ,GAC1B,OAAO;EAGT,OAAOA,yBAAU;CACnB;CAEA,IAAI,MAAM,QAAQ,OAAO,GACvB,OAAOA,yBAAU;CAGnB,IAAIC,iDAAe,OAAO,GACxB,OAAOD,yBAAU;CAGnB,IAAI,OAAO,YAAY,UACrB,OAAOA,yBAAU;CAGnB,IAAI,OAAO,YAAY,WACrB,OAAOA,yBAAU;CAGnB,IAAI,WAAW,OAAO,YAAY,UAChC,OAAOA,yBAAU;CAGnB,IAAI,YAAY,MACd,OAAOA,yBAAU;CAGnB,OAAOA,yBAAU;AACnB"}
@@ -20,14 +20,14 @@ exports.QUALIFIER_ORDER = require_dictionaryManipulator_qualifiedDictionary.QUAL
20
20
  exports.editDictionaryByKeyPath = require_dictionaryManipulator_editDictionaryByKeyPath.editDictionaryByKeyPath;
21
21
  exports.getContentNodeByKeyPath = require_dictionaryManipulator_getContentNodeByKeyPath.getContentNodeByKeyPath;
22
22
  exports.getDefaultNode = require_dictionaryManipulator_getDefaultNode.getDefaultNode;
23
- exports.getDictionaryCompositeId = require_dictionaryManipulator_qualifiedDictionary.getDictionaryCompositeId;
24
- exports.getDictionaryQualifierId = require_dictionaryManipulator_qualifiedDictionary.getDictionaryQualifierId;
25
- exports.getDictionaryQualifierSegments = require_dictionaryManipulator_qualifiedDictionary.getDictionaryQualifierSegments;
23
+ exports.getDictionaryCompositeIds = require_dictionaryManipulator_qualifiedDictionary.getDictionaryCompositeIds;
24
+ exports.getDictionaryQualifierIds = require_dictionaryManipulator_qualifiedDictionary.getDictionaryQualifierIds;
26
25
  exports.getDictionaryQualifierTypes = require_dictionaryManipulator_qualifiedDictionary.getDictionaryQualifierTypes;
27
26
  exports.getDictionarySelectorCacheKey = require_dictionaryManipulator_qualifiedDictionary.getDictionarySelectorCacheKey;
28
27
  exports.getEmptyNode = require_dictionaryManipulator_getEmptyNode.getEmptyNode;
29
28
  exports.getNodeChildren = require_dictionaryManipulator_getNodeChildren.getNodeChildren;
30
29
  exports.getNodeType = require_dictionaryManipulator_getNodeType.getNodeType;
30
+ exports.getVariantIds = require_dictionaryManipulator_qualifiedDictionary.getVariantIds;
31
31
  exports.isQualifiedDictionaryGroup = require_dictionaryManipulator_qualifiedDictionary.isQualifiedDictionaryGroup;
32
32
  exports.isQualifiedDynamicLoaderMap = require_dictionaryManipulator_qualifiedDictionary.isQualifiedDynamicLoaderMap;
33
33
  exports.mergeDictionaries = require_dictionaryManipulator_mergeDictionaries.mergeDictionaries;
@@ -42,4 +42,5 @@ exports.renameContentNodeByKeyPath = require_dictionaryManipulator_renameContent
42
42
  exports.resolveQualifiedDictionary = require_dictionaryManipulator_qualifiedDictionary.resolveQualifiedDictionary;
43
43
  exports.resolveQualifiedDynamicContent = require_dictionaryManipulator_qualifiedDictionary.resolveQualifiedDynamicContent;
44
44
  exports.resolveQualifiedDynamicContentAsync = require_dictionaryManipulator_qualifiedDictionary.resolveQualifiedDynamicContentAsync;
45
+ exports.serializeVariant = require_dictionaryManipulator_qualifiedDictionary.serializeVariant;
45
46
  exports.updateNodeChildren = require_dictionaryManipulator_updateNodeChildren.updateNodeChildren;
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_deepTransformPlugins_getMultilingualDictionary = require('../deepTransformPlugins/getMultilingualDictionary.cjs');
4
3
  const require_dictionaryManipulator_getNodeType = require('./getNodeType.cjs');
5
4
  let _intlayer_config_built = require("@intlayer/config/built");
@@ -24,7 +23,7 @@ const customMerge = (destination, source) => {
24
23
  if (Array.isArray(destination) && Array.isArray(source)) return arrayMerge(destination, source);
25
24
  if (typeof destination === "object" && typeof source === "object") {
26
25
  const result = {};
27
- const allKeys = new Set([...Object.keys(destination), ...Object.keys(source)]);
26
+ const allKeys = /* @__PURE__ */ new Set([...Object.keys(destination), ...Object.keys(source)]);
28
27
  for (const key of allKeys) result[key] = customMerge(destination[key], source[key]);
29
28
  return result;
30
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mergeDictionaries.cjs","names":["getNodeType","getMultilingualDictionary"],"sources":["../../../src/dictionaryManipulator/mergeDictionaries.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport type {\n ContentNode,\n Dictionary,\n LocalDictionaryId,\n} 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({ log });\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 if (!dictionaries[0] || dictionaries.length <= 1) {\n return dictionaries[0]!;\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 const dict = dictionaries[i];\n\n if (!dict) continue;\n\n // If the dictionary is a per-locale dictionary, transform it to a partial multilingual dictionary\n const currentDictionary = getMultilingualDictionary(dict);\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":";;;;;;;;AAaA,MAAM,mBACJ,SACA,SACA,gBACA,eACA,OAAiB,EAAE,KACV;CACT,MAAM,sDAAyB,EAAE,iCAAK,CAAC;AAGvC,KACE,YAAY,UACZ,YAAY,QACZ,YAAY,UACZ,YAAY,KAEZ;CAEF,MAAM,QAAQA,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;AAED,KAAI,CAAC,aAAa,MAAM,aAAa,UAAU,EAC7C,QAAO,aAAa;CAGtB,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;EAC5C,MAAM,OAAO,aAAa;AAE1B,MAAI,CAAC,KAAM;EAGX,MAAM,oBAAoBC,iFAA0B,KAAK;AAGzD,kBACE,eACA,kBAAkB,SAClB,kBAAkB,SAClB,kBAAkB,KAClB,EAAE,CACH;AAED,kBAAgB,YACd,eACA,kBAAkB,QACnB;;AASH,QAAO;EALL,KAAK,aAAa,GAAG;EACrB,SAAS;EACT;EAGqB"}
1
+ {"version":3,"file":"mergeDictionaries.cjs","names":["getNodeType","getMultilingualDictionary"],"sources":["../../../src/dictionaryManipulator/mergeDictionaries.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport type {\n ContentNode,\n Dictionary,\n LocalDictionaryId,\n} 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({ log });\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 if (!dictionaries[0] || dictionaries.length <= 1) {\n return dictionaries[0]!;\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 const dict = dictionaries[i];\n\n if (!dict) continue;\n\n // If the dictionary is a per-locale dictionary, transform it to a partial multilingual dictionary\n const currentDictionary = getMultilingualDictionary(dict);\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":";;;;;;;AAaA,MAAM,mBACJ,SACA,SACA,gBACA,eACA,OAAiB,CAAC,MACT;CACT,MAAM,sDAAyB,EAAE,gCAAI,CAAC;CAGtC,IACE,YAAY,UACZ,YAAY,QACZ,YAAY,UACZ,YAAY,MAEZ;CAEF,MAAM,QAAQA,sDAAY,OAAO;CACjC,MAAM,QAAQA,sDAAY,OAAO;CAGjC,IAAI,UAAU,aAAa,UAAU,WAAW;CAEhD,IAAI,UAAU,OAAO;EACnB,UACE,CACE,8DAAiC,aAAa,EAAE,4DAA4D,KAAK,KAAK,GAAG,EAAE,kBAAkB,MAAM,QAAQ,MAAM,iBAAiB,gBACpL,GACA,EACE,OAAO,QACT,CACF;EAEA;CACF;AACF;AAGA,MAAM,eACJ,aACA,WACqB;CAErB,IAAI,gBAAgB,UAAa,gBAAgB,MAC/C,OAAO;CAIT,IAAI,WAAW,UAAa,WAAW,MACrC,OAAO;CAIT,IAAI,OAAO,gBAAgB,YAAY,OAAO,WAAW,UACvD,OAAO;CAIT,IAAI,MAAM,QAAQ,WAAW,KAAK,MAAM,QAAQ,MAAM,GACpD,OAAO,WACL,aACA,MACF;CAIF,IAAI,OAAO,gBAAgB,YAAY,OAAO,WAAW,UAAU;EACjE,MAAM,SAA2C,CAAC;EAClD,MAAM,0BAAU,IAAI,IAAI,CACtB,GAAG,OAAO,KAAK,WAAqD,GACpE,GAAG,OAAO,KAAK,MAAgD,CACjE,CAAC;EAED,KAAK,MAAM,OAAO,SAChB,OAAO,OAAO,YACX,YAAuD,MACvD,OAAkD,IACrD;EAGF,OAAO;CACT;CAGA,OAAO;AACT;AAGA,MAAM,cACJ,kBACA,gBACuB;CAEvB,MAAM,wBAAwB,iBAAiB,OAC5C,SAAS,OAAO,SAAS,YAAY,SAAS,IACjD;CACA,MAAM,0BAA0B,YAAY,OACzC,SAAS,OAAO,SAAS,YAAY,SAAS,IACjD;CAGA,IAAI,yBAAyB,yBAC3B,OAAO;CAIT,MAAM,SAA6B,CAAC;CACpC,MAAM,YAAY,KAAK,IAAI,iBAAiB,QAAQ,YAAY,MAAM;CAEtE,KAAK,IAAI,IAAI,GAAG,IAAI,WAAW,KAAK;EAClC,MAAM,WAAW,iBAAiB;EAClC,MAAM,aAAa,YAAY;EAE/B,IAAI,aAAa,UAAa,eAAe,QAAW,CACxD,OAAO,IAAI,aAAa,QAEtB,OAAO,KAAK,UAAU;OACjB,IAAI,eAAe,QAExB,OAAO,KAAK,QAAQ;OAGpB,IACE,OAAO,aAAa,YACpB,OAAO,eAAe,YACtB,aAAa,QACb,eAAe,MAGf,IACE,SAAS,YACT,SAAS,cACR,SAAoC,QAClC,WAAsC,KAGzC,OAAO,KAAK,YAAY,UAAU,UAAU,CAAC;OAG7C,OAAO,KAAK,YAAY,UAAU,UAAU,CAAC;OAI/C,OAAO,KAAK,QAAQ;CAG1B;CAEA,OAAO;AACT;AAEA,MAAa,qBAAqB,iBAA2C;CAC3E,MAAM,WAAW,MAAM,KACrB,IAAI,IACF,aAAa,QAAQ,SAAS,KAAK,OAAO,CAAC,CAAC,KAAK,SAAS,KAAK,OAAQ,CACzE,CACF;CAEA,IAAI,CAAC,aAAa,MAAM,aAAa,UAAU,GAC7C,OAAO,aAAa;CAGtB,MAAM,mBAAmB,aAAa,KAAK,SAAS,KAAK,GAAG;CAG5D,IAAI,IAAI,IAAI,gBAAgB,CAAC,CAAC,SAAS,GACrC,MAAM,IAAI,MAAM,yCAAyC;CAG3D,IAAI,gBAAuC,aAAa,EAAE,CAAC;CAE3D,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;EAC5C,MAAM,OAAO,aAAa;EAE1B,IAAI,CAAC,MAAM;EAGX,MAAM,oBAAoBC,iFAA0B,IAAI;EAGxD,gBACE,eACA,kBAAkB,SAClB,kBAAkB,SAClB,kBAAkB,KAClB,CAAC,CACH;EAEA,gBAAgB,YACd,eACA,kBAAkB,OACpB;CACF;CAQA,OAAO;EALL,KAAK,aAAa,EAAE,CAAC;EACrB,SAAS;EACT;CAGoB;AACxB"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  const require_dictionaryManipulator_qualifiedDictionary = require('./qualifiedDictionary.cjs');
4
3
  const require_dictionaryManipulator_mergeDictionaries = require('./mergeDictionaries.cjs');
5
4
  let _intlayer_config_built = require("@intlayer/config/built");
@@ -13,7 +12,7 @@ let _intlayer_config_logger = require("@intlayer/config/logger");
13
12
  * `mergeDictionaries` (single merged dictionary).
14
13
  * - At least one dictionary declares a qualifier → the group's dimension set is
15
14
  * the union of every declared dimension (in canonical order
16
- * `variant → meta → item`). Dictionaries are grouped by their composite id
15
+ * `variant → item`). Dictionaries are grouped by their composite id
17
16
  * (one segment per dimension), merged within each group (locale completion /
18
17
  * priority overrides preserved), and a `QualifiedDictionaryGroup` is returned.
19
18
  * Unqualified siblings act as shared base content merged into every entry.
@@ -31,27 +30,26 @@ const mergeQualifiedDictionaries = (dictionaries) => {
31
30
  const baseDictionaries = [];
32
31
  const entriesDictionaries = /* @__PURE__ */ new Map();
33
32
  dictionaries.forEach((dictionary, index) => {
34
- if (perDictionaryTypes[index].length === 0) {
33
+ if (perDictionaryTypes[index]?.length === 0) {
35
34
  baseDictionaries.push(dictionary);
36
35
  return;
37
36
  }
38
- const compositeId = require_dictionaryManipulator_qualifiedDictionary.getDictionaryCompositeId(dictionary, groupQualifierTypes);
39
- if (compositeId === void 0) {
37
+ const compositeIds = require_dictionaryManipulator_qualifiedDictionary.getDictionaryCompositeIds(dictionary, groupQualifierTypes);
38
+ if (compositeIds === void 0) {
40
39
  appLogger(`Dictionary ${(0, _intlayer_config_logger.colorizeKey)(dictionary.key)} declares (${perDictionaryTypes[index].join(", ")}) but the key's dimensions are (${groupQualifierTypes.join(", ")}); every entry must declare all of them. Entry ignored${dictionary.filePath ? ` - ${dictionary.filePath}` : ""}.`, { level: "error" });
41
40
  return;
42
41
  }
43
- const existingEntries = entriesDictionaries.get(compositeId) ?? [];
44
- existingEntries.push(dictionary);
45
- entriesDictionaries.set(compositeId, existingEntries);
42
+ for (const compositeId of compositeIds) {
43
+ const existingEntries = entriesDictionaries.get(compositeId) ?? [];
44
+ existingEntries.push(dictionary);
45
+ entriesDictionaries.set(compositeId, existingEntries);
46
+ }
46
47
  });
47
48
  const content = {};
48
- const metaByCompositeId = {};
49
- const declaresMeta = groupQualifierTypes.includes("meta");
50
49
  let importMode;
51
50
  for (const [compositeId, qualifiedDictionaries] of entriesDictionaries) {
52
51
  content[compositeId] = require_dictionaryManipulator_mergeDictionaries.mergeDictionaries([...qualifiedDictionaries, ...baseDictionaries]).content;
53
52
  const [firstQualified] = qualifiedDictionaries;
54
- if (declaresMeta && firstQualified?.meta !== void 0) metaByCompositeId[compositeId] = firstQualified.meta;
55
53
  importMode ??= firstQualified?.importMode;
56
54
  }
57
55
  const localIds = Array.from(new Set(dictionaries.filter((dictionary) => dictionary.localId).map((dictionary) => dictionary.localId)));
@@ -59,7 +57,6 @@ const mergeQualifiedDictionaries = (dictionaries) => {
59
57
  key: dictionaries[0].key,
60
58
  qualifierTypes: groupQualifierTypes,
61
59
  content,
62
- ...declaresMeta && { meta: metaByCompositeId },
63
60
  ...importMode !== void 0 && { importMode },
64
61
  localIds
65
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mergeQualifiedDictionaries.cjs","names":["getDictionaryQualifierTypes","QUALIFIER_ORDER","mergeDictionaries","getDictionaryCompositeId"],"sources":["../../../src/dictionaryManipulator/mergeQualifiedDictionaries.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport type {\n Dictionary,\n DictionaryMeta,\n DictionaryQualifierType,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\nimport { mergeDictionaries } from './mergeDictionaries';\nimport {\n getDictionaryCompositeId,\n getDictionaryQualifierTypes,\n QUALIFIER_ORDER,\n} from './qualifiedDictionary';\n\n/**\n * Merges sibling dictionaries sharing the same key, honouring qualifiers.\n *\n * - No dictionary declares a qualifier → behaves exactly like\n * `mergeDictionaries` (single merged dictionary).\n * - At least one dictionary declares a qualifier → the group's dimension set is\n * the union of every declared dimension (in canonical order\n * `variant → meta → item`). Dictionaries are grouped by their composite id\n * (one segment per dimension), merged within each group (locale completion /\n * priority overrides preserved), and a `QualifiedDictionaryGroup` is returned.\n * Unqualified siblings act as shared base content merged into every entry.\n *\n * Every qualified entry must declare ALL dimensions of the group; an entry that\n * declares only a subset is ambiguous and is rejected with an error log.\n */\nexport const mergeQualifiedDictionaries = (\n dictionaries: Dictionary[]\n): Dictionary | QualifiedDictionaryGroup => {\n const perDictionaryTypes = dictionaries.map(getDictionaryQualifierTypes);\n\n const declaredDimensions = new Set<DictionaryQualifierType>();\n for (const types of perDictionaryTypes) {\n for (const type of types) declaredDimensions.add(type);\n }\n\n // Canonical order, restricted to the dimensions actually declared.\n const groupQualifierTypes = QUALIFIER_ORDER.filter((qualifierType) =>\n declaredDimensions.has(qualifierType)\n );\n\n if (groupQualifierTypes.length === 0) {\n return mergeDictionaries(dictionaries);\n }\n\n const appLogger = getAppLogger({ log });\n\n const baseDictionaries: Dictionary[] = [];\n const entriesDictionaries = new Map<string, Dictionary[]>();\n\n dictionaries.forEach((dictionary, index) => {\n if (perDictionaryTypes[index].length === 0) {\n baseDictionaries.push(dictionary);\n return;\n }\n\n const compositeId = getDictionaryCompositeId(\n dictionary,\n groupQualifierTypes\n );\n\n if (compositeId === undefined) {\n appLogger(\n `Dictionary ${colorizeKey(dictionary.key)} declares (${perDictionaryTypes[index].join(', ')}) but the key's dimensions are (${groupQualifierTypes.join(', ')}); every entry must declare all of them. Entry ignored${dictionary.filePath ? ` - ${dictionary.filePath}` : ''}.`,\n { level: 'error' }\n );\n return;\n }\n\n const existingEntries = entriesDictionaries.get(compositeId) ?? [];\n existingEntries.push(dictionary);\n entriesDictionaries.set(compositeId, existingEntries);\n });\n\n // `content` maps each composite id to its resolved content node directly; the\n // qualifier coordinates live in the key, not in a per-entry wrapper. `meta`\n // preserves the declared meta fields (composite id only encodes `meta.id`).\n const content: Record<string, unknown> = {};\n const metaByCompositeId: Record<string, DictionaryMeta> = {};\n const declaresMeta = groupQualifierTypes.includes('meta');\n\n let importMode: Dictionary['importMode'];\n\n for (const [compositeId, qualifiedDictionaries] of entriesDictionaries) {\n // Unqualified siblings act as shared base content: appended last so the\n // qualified entries take precedence (mergeDictionaries prefers first).\n const mergedEntry = mergeDictionaries([\n ...qualifiedDictionaries,\n ...baseDictionaries,\n ]);\n\n content[compositeId] = mergedEntry.content;\n\n const [firstQualified] = qualifiedDictionaries;\n\n if (declaresMeta && firstQualified?.meta !== undefined) {\n metaByCompositeId[compositeId] = firstQualified.meta;\n }\n\n importMode ??= firstQualified?.importMode;\n }\n\n const localIds = Array.from(\n new Set(\n dictionaries\n .filter((dictionary) => dictionary.localId)\n .map((dictionary) => dictionary.localId!)\n )\n );\n\n return {\n key: dictionaries[0]!.key,\n qualifierTypes: groupQualifierTypes,\n content,\n ...(declaresMeta && { meta: metaByCompositeId }),\n ...(importMode !== undefined && { importMode }),\n localIds,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,8BACX,iBAC0C;CAC1C,MAAM,qBAAqB,aAAa,IAAIA,8EAA4B;CAExE,MAAM,qCAAqB,IAAI,KAA8B;AAC7D,MAAK,MAAM,SAAS,mBAClB,MAAK,MAAM,QAAQ,MAAO,oBAAmB,IAAI,KAAK;CAIxD,MAAM,sBAAsBC,kEAAgB,QAAQ,kBAClD,mBAAmB,IAAI,cAAc,CACtC;AAED,KAAI,oBAAoB,WAAW,EACjC,QAAOC,kEAAkB,aAAa;CAGxC,MAAM,sDAAyB,EAAE,iCAAK,CAAC;CAEvC,MAAM,mBAAiC,EAAE;CACzC,MAAM,sCAAsB,IAAI,KAA2B;AAE3D,cAAa,SAAS,YAAY,UAAU;AAC1C,MAAI,mBAAmB,OAAO,WAAW,GAAG;AAC1C,oBAAiB,KAAK,WAAW;AACjC;;EAGF,MAAM,cAAcC,2EAClB,YACA,oBACD;AAED,MAAI,gBAAgB,QAAW;AAC7B,aACE,uDAA0B,WAAW,IAAI,CAAC,aAAa,mBAAmB,OAAO,KAAK,KAAK,CAAC,kCAAkC,oBAAoB,KAAK,KAAK,CAAC,wDAAwD,WAAW,WAAW,MAAM,WAAW,aAAa,GAAG,IAC5Q,EAAE,OAAO,SAAS,CACnB;AACD;;EAGF,MAAM,kBAAkB,oBAAoB,IAAI,YAAY,IAAI,EAAE;AAClE,kBAAgB,KAAK,WAAW;AAChC,sBAAoB,IAAI,aAAa,gBAAgB;GACrD;CAKF,MAAM,UAAmC,EAAE;CAC3C,MAAM,oBAAoD,EAAE;CAC5D,MAAM,eAAe,oBAAoB,SAAS,OAAO;CAEzD,IAAI;AAEJ,MAAK,MAAM,CAAC,aAAa,0BAA0B,qBAAqB;AAQtE,UAAQ,eALYD,kEAAkB,CACpC,GAAG,uBACH,GAAG,iBACJ,CAEiC,CAAC;EAEnC,MAAM,CAAC,kBAAkB;AAEzB,MAAI,gBAAgB,gBAAgB,SAAS,OAC3C,mBAAkB,eAAe,eAAe;AAGlD,iBAAe,gBAAgB;;CAGjC,MAAM,WAAW,MAAM,KACrB,IAAI,IACF,aACG,QAAQ,eAAe,WAAW,QAAQ,CAC1C,KAAK,eAAe,WAAW,QAAS,CAC5C,CACF;AAED,QAAO;EACL,KAAK,aAAa,GAAI;EACtB,gBAAgB;EAChB;EACA,GAAI,gBAAgB,EAAE,MAAM,mBAAmB;EAC/C,GAAI,eAAe,UAAa,EAAE,YAAY;EAC9C;EACD"}
1
+ {"version":3,"file":"mergeQualifiedDictionaries.cjs","names":["getDictionaryQualifierTypes","QUALIFIER_ORDER","mergeDictionaries","getDictionaryCompositeIds"],"sources":["../../../src/dictionaryManipulator/mergeQualifiedDictionaries.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport type {\n Dictionary,\n DictionaryQualifierType,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\nimport { mergeDictionaries } from './mergeDictionaries';\nimport {\n getDictionaryCompositeIds,\n getDictionaryQualifierTypes,\n QUALIFIER_ORDER,\n} from './qualifiedDictionary';\n\n/**\n * Merges sibling dictionaries sharing the same key, honouring qualifiers.\n *\n * - No dictionary declares a qualifier → behaves exactly like\n * `mergeDictionaries` (single merged dictionary).\n * - At least one dictionary declares a qualifier → the group's dimension set is\n * the union of every declared dimension (in canonical order\n * `variant → item`). Dictionaries are grouped by their composite id\n * (one segment per dimension), merged within each group (locale completion /\n * priority overrides preserved), and a `QualifiedDictionaryGroup` is returned.\n * Unqualified siblings act as shared base content merged into every entry.\n *\n * Every qualified entry must declare ALL dimensions of the group; an entry that\n * declares only a subset is ambiguous and is rejected with an error log.\n */\nexport const mergeQualifiedDictionaries = (\n dictionaries: Dictionary[]\n): Dictionary | QualifiedDictionaryGroup => {\n const perDictionaryTypes = dictionaries.map(getDictionaryQualifierTypes);\n\n const declaredDimensions = new Set<DictionaryQualifierType>();\n for (const types of perDictionaryTypes) {\n for (const type of types) declaredDimensions.add(type);\n }\n\n // Canonical order, restricted to the dimensions actually declared.\n const groupQualifierTypes = QUALIFIER_ORDER.filter((qualifierType) =>\n declaredDimensions.has(qualifierType)\n );\n\n if (groupQualifierTypes.length === 0) {\n return mergeDictionaries(dictionaries);\n }\n\n const appLogger = getAppLogger({ log });\n\n const baseDictionaries: Dictionary[] = [];\n const entriesDictionaries = new Map<string, Dictionary[]>();\n\n dictionaries.forEach((dictionary, index) => {\n if (perDictionaryTypes[index]?.length === 0) {\n baseDictionaries.push(dictionary);\n return;\n }\n\n // A dictionary may map to several composite ids (array variant fan-out):\n // its content is registered under every id it lists.\n const compositeIds = getDictionaryCompositeIds(\n dictionary,\n groupQualifierTypes\n );\n\n if (compositeIds === undefined) {\n appLogger(\n `Dictionary ${colorizeKey(dictionary.key)} declares (${perDictionaryTypes[index].join(', ')}) but the key's dimensions are (${groupQualifierTypes.join(', ')}); every entry must declare all of them. Entry ignored${dictionary.filePath ? ` - ${dictionary.filePath}` : ''}.`,\n { level: 'error' }\n );\n return;\n }\n\n for (const compositeId of compositeIds) {\n const existingEntries = entriesDictionaries.get(compositeId) ?? [];\n existingEntries.push(dictionary);\n entriesDictionaries.set(compositeId, existingEntries);\n }\n });\n\n // `content` maps each composite id to its resolved content node directly; the\n // qualifier coordinates live in the key, not in a per-entry wrapper. For an\n // object variant the variant segment is the canonical serialization of the\n // object, so it fully identifies the entry — no side-map is needed.\n const content: Record<string, unknown> = {};\n\n let importMode: Dictionary['importMode'];\n\n for (const [compositeId, qualifiedDictionaries] of entriesDictionaries) {\n // Unqualified siblings act as shared base content: appended last so the\n // qualified entries take precedence (mergeDictionaries prefers first).\n const mergedEntry = mergeDictionaries([\n ...qualifiedDictionaries,\n ...baseDictionaries,\n ]);\n\n content[compositeId] = mergedEntry.content;\n\n const [firstQualified] = qualifiedDictionaries;\n\n importMode ??= firstQualified?.importMode;\n }\n\n const localIds = Array.from(\n new Set(\n dictionaries\n .filter((dictionary) => dictionary.localId)\n .map((dictionary) => dictionary.localId!)\n )\n );\n\n return {\n key: dictionaries[0]!.key,\n qualifierTypes: groupQualifierTypes,\n content,\n ...(importMode !== undefined && { importMode }),\n localIds,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,8BACX,iBAC0C;CAC1C,MAAM,qBAAqB,aAAa,IAAIA,6EAA2B;CAEvE,MAAM,qCAAqB,IAAI,IAA6B;CAC5D,KAAK,MAAM,SAAS,oBAClB,KAAK,MAAM,QAAQ,OAAO,mBAAmB,IAAI,IAAI;CAIvD,MAAM,sBAAsBC,kEAAgB,QAAQ,kBAClD,mBAAmB,IAAI,aAAa,CACtC;CAEA,IAAI,oBAAoB,WAAW,GACjC,OAAOC,kEAAkB,YAAY;CAGvC,MAAM,sDAAyB,EAAE,gCAAI,CAAC;CAEtC,MAAM,mBAAiC,CAAC;CACxC,MAAM,sCAAsB,IAAI,IAA0B;CAE1D,aAAa,SAAS,YAAY,UAAU;EAC1C,IAAI,mBAAmB,MAAM,EAAE,WAAW,GAAG;GAC3C,iBAAiB,KAAK,UAAU;GAChC;EACF;EAIA,MAAM,eAAeC,4EACnB,YACA,mBACF;EAEA,IAAI,iBAAiB,QAAW;GAC9B,UACE,uDAA0B,WAAW,GAAG,EAAE,aAAa,mBAAmB,MAAM,CAAC,KAAK,IAAI,EAAE,kCAAkC,oBAAoB,KAAK,IAAI,EAAE,wDAAwD,WAAW,WAAW,MAAM,WAAW,aAAa,GAAG,IAC5Q,EAAE,OAAO,QAAQ,CACnB;GACA;EACF;EAEA,KAAK,MAAM,eAAe,cAAc;GACtC,MAAM,kBAAkB,oBAAoB,IAAI,WAAW,KAAK,CAAC;GACjE,gBAAgB,KAAK,UAAU;GAC/B,oBAAoB,IAAI,aAAa,eAAe;EACtD;CACF,CAAC;CAMD,MAAM,UAAmC,CAAC;CAE1C,IAAI;CAEJ,KAAK,MAAM,CAAC,aAAa,0BAA0B,qBAAqB;EAQtE,QAAQ,eALYD,kEAAkB,CACpC,GAAG,uBACH,GAAG,gBACL,CAEiC,CAAC,CAAC;EAEnC,MAAM,CAAC,kBAAkB;EAEzB,eAAe,gBAAgB;CACjC;CAEA,MAAM,WAAW,MAAM,KACrB,IAAI,IACF,aACG,QAAQ,eAAe,WAAW,OAAO,CAAC,CAC1C,KAAK,eAAe,WAAW,OAAQ,CAC5C,CACF;CAEA,OAAO;EACL,KAAK,aAAa,EAAE,CAAE;EACtB,gBAAgB;EAChB;EACA,GAAI,eAAe,UAAa,EAAE,WAAW;EAC7C;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeDictionary.cjs","names":["t","getPerLocaleDictionary","orderDictionaries"],"sources":["../../../src/dictionaryManipulator/normalizeDictionary.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\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,OAG+B,CAAC;AAClC,SAAO;IAET,EAAE,CACH;AAED,QAAO;EACL,GAAG;EACH,SAASD,6CAAE,iBAAiB;EAC7B;;AAGH,MAAa,yBACX,cACA,kBACiB;AAOjB,QAN4BE,kEAAkB,cAAc,cAEV,CAAC,KAAK,eACtD,oBAAoB,YAAY,cAAc,CAGnB"}
1
+ {"version":3,"file":"normalizeDictionary.cjs","names":["t","getPerLocaleDictionary","orderDictionaries"],"sources":["../../../src/dictionaryManipulator/normalizeDictionary.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\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,UAAU,CAAC;CAG9D,IAAI,WAAW,QACb,OAAO;EACL,GAAG;EACH,QAAQ;EACR,SAASA,6CAAE,GACR,WAAW,SAAS,WAAW,QAClC,CAAC;CACH;CAGF,MAAM,mBAAmB,QAAQ,QAC9B,KAAK,WAAW;EAMf,IAAI,UALwBC,wEAC1B,kBACA,MAG8B,CAAC,CAAC;EAClC,OAAO;CACT,GACA,CAAC,CACH;CAEA,OAAO;EACL,GAAG;EACH,SAASD,6CAAE,gBAAgB;CAC7B;AACF;AAEA,MAAa,yBACX,cACA,kBACiB;CAOjB,OAN4BE,kEAAkB,cAAc,aAEX,CAAC,CAAC,KAAK,eACtD,oBAAoB,YAAY,aAAa,CAGnB;AAC9B"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let _intlayer_config_built = require("@intlayer/config/built");
4
3
 
5
4
  //#region src/dictionaryManipulator/orderDictionaries.ts
@@ -1 +1 @@
1
- {"version":3,"file":"orderDictionaries.cjs","names":["editor"],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":["import { editor } 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 config?: {\n editor: {\n dictionaryPriorityStrategy: 'local_first' | 'distant_first';\n };\n }\n): Dictionary[] => {\n const dictionaryPriorityStrategy =\n config?.editor?.dictionaryPriorityStrategy ??\n editor.dictionaryPriorityStrategy;\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,WAKiB;CACjB,MAAM,6BACJ,QAAQ,QAAQ,8BAChBA,8BAAO;AAET,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
+ {"version":3,"file":"orderDictionaries.cjs","names":["editor"],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":["import { editor } 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 config?: {\n editor: {\n dictionaryPriorityStrategy: 'local_first' | 'distant_first';\n };\n }\n): Dictionary[] => {\n const dictionaryPriorityStrategy =\n config?.editor?.dictionaryPriorityStrategy ??\n editor.dictionaryPriorityStrategy;\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,WAKiB;CACjB,MAAM,6BACJ,QAAQ,QAAQ,8BAChBA,8BAAO;CAET,IAAI,aAAa,UAAU,GACzB,OAAO;CAIT,MAAM,YAAY,aAAa,KAAK,YAAY,WAAW;EACzD;EACA;CACF,EAAE;CAEF,MAAM,eAAe,eAAmC;EACtD,MAAM,IAAI,WAAW,YAAY;EAEjC,OAAO,OAAO,SAAS,CAAC,IAAI,IAAI;CAClC;CAEA,MAAM,qBAAqB,MAA0B;EACnD,MAAM,WAAW,EAAE;EAGnB,IAAI,aAAa,QACf,OAAO;EAGT,IAAI,+BAA+B,iBAEjC,OAAO,aAAa,WAAW,IAAI;EAGrC,OAAO,aAAa,UAAU,IAAI;CACpC;CAEA,UAAU,MAAM,GAAG,MAAM;EAEvB,MAAM,QAAQ,EAAE,WAAW,SAAS,IAAI;EACxC,MAAM,QAAQ,EAAE,WAAW,SAAS,IAAI;EACxC,IAAI,UAAU,OAAO,OAAO,QAAQ;EAGpC,MAAM,KAAK,YAAY,EAAE,UAAU;EACnC,MAAM,KAAK,YAAY,EAAE,UAAU;EACnC,IAAI,OAAO,IAAI,OAAO,KAAK;EAG3B,MAAM,YAAY,kBAAkB,EAAE,UAAU;EAChD,MAAM,YAAY,kBAAkB,EAAE,UAAU;EAChD,IAAI,cAAc,WAAW,OAAO,YAAY;EAGhD,OAAO,EAAE,QAAQ,EAAE;CACrB,CAAC;CAED,OAAO,UAAU,KAAK,EAAE,iBAAiB,UAAU;AACrD"}
@@ -2,100 +2,125 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  //#region src/dictionaryManipulator/qualifiedDictionary.ts
4
4
  /**
5
- * Selector keys that are reserved for dictionary resolution and therefore
6
- * excluded from meta field matching.
5
+ * Canonical order of qualifier dimensions. A key that declares both dimensions
6
+ * always nests them in this order, with `item` innermost so it can act as the
7
+ * collection (array) axis.
7
8
  */
8
- const RESERVED_SELECTOR_KEYS = [
9
- "locale",
10
- "item",
11
- "variant"
12
- ];
13
- /**
14
- * Canonical order of qualifier dimensions. A key that declares several
15
- * dimensions always nests them in this order, with `item` innermost so it can
16
- * act as the collection (array) axis.
17
- */
18
- const QUALIFIER_ORDER = [
19
- "variant",
20
- "meta",
21
- "item"
22
- ];
9
+ const QUALIFIER_ORDER = ["variant", "item"];
23
10
  /**
24
11
  * Separator joining per-dimension ids into a composite entry id. Also used as
25
12
  * the chunk path separator in dynamic mode.
26
13
  */
27
14
  const COMPOSITE_ID_SEPARATOR = "/";
28
15
  /**
16
+ * Characters kept verbatim in an encoded qualifier segment. Everything else is
17
+ * percent-encoded so a segment can never contain the composite-id separator
18
+ * (`/`), path-hostile characters (`\` `:` `*` `?` `"` `<` `>` `|`, control
19
+ * chars), or characters that would break the generated loader modules (`'`).
20
+ */
21
+ const SEGMENT_UNSAFE_CHARS = /[^A-Za-z0-9._&=-]/g;
22
+ /**
23
+ * Stricter set for the components of an object variant: also encodes `&` and
24
+ * `=` so the `field=value&field=value` serialization stays unambiguous.
25
+ */
26
+ const COMPONENT_UNSAFE_CHARS = /[^A-Za-z0-9._-]/g;
27
+ /** Percent-encodes one UTF-16 code unit as a fixed-width `%XXXX` run. */
28
+ const percentEncodeChar = (char) => `%${char.charCodeAt(0).toString(16).toUpperCase().padStart(4, "0")}`;
29
+ const encodeSegmentText = (raw, unsafeChars) => {
30
+ if (raw === "") return "%";
31
+ const encoded = raw.replace(unsafeChars, percentEncodeChar);
32
+ if (encoded === "." || encoded === "..") return encoded.replace(/\./g, "%002E");
33
+ return encoded;
34
+ };
35
+ /**
36
+ * Canonical serialization of a single variant value into its identity string —
37
+ * the variant segment of a composite id, the chunk directory name in dynamic
38
+ * mode, and the runtime matching key.
39
+ *
40
+ * - `undefined` → `'default'` (the implicit fallback variant)
41
+ * - a string → the string itself (a named variant)
42
+ * - an object → its sorted `key=value` pairs joined by `&`
43
+ * (e.g. `{ userId: '123', id: 'abc' }` → `'id=abc&userId=123'`)
44
+ *
45
+ * Characters that are unsafe in file paths or generated code are
46
+ * percent-encoded (fixed-width `%XXXX` runs, injective). Common names —
47
+ * letters, digits, `-` `_` `.` — are left untouched. Both the declaration and
48
+ * the selector go through this function, so encoding never affects matching.
49
+ *
50
+ * Two variants resolve to the same entry iff their serializations are equal, so
51
+ * an object variant in a selector must equal the one declared on the dictionary.
52
+ */
53
+ const serializeVariant = (variant) => {
54
+ if (variant === void 0) return "default";
55
+ if (typeof variant === "string") return encodeSegmentText(variant, SEGMENT_UNSAFE_CHARS);
56
+ return Object.keys(variant).sort().map((field) => `${encodeSegmentText(field, COMPONENT_UNSAFE_CHARS)}=${encodeSegmentText(String(variant[field]), COMPONENT_UNSAFE_CHARS)}`).join("&");
57
+ };
58
+ /**
59
+ * Normalizes the `variant` field of a dictionary into the list of variant ids
60
+ * the declaration registers under. A single value yields one id; an **array**
61
+ * fans out into one id per element (duplicates collapsed). Returns `undefined`
62
+ * when the dictionary does not declare the variant dimension (no `variant`
63
+ * field, or an empty array).
64
+ */
65
+ const getVariantIds = (variant) => {
66
+ if (variant === void 0) return void 0;
67
+ const values = Array.isArray(variant) ? variant : [variant];
68
+ if (values.length === 0) return void 0;
69
+ return [...new Set(values.map(serializeVariant))];
70
+ };
71
+ /**
29
72
  * Returns the qualifier dimensions declared on a dictionary, in canonical
30
- * order (`variant → meta → item`). Empty when the dictionary is unqualified
73
+ * order (`variant → item`). Empty when the dictionary is unqualified
31
74
  * (plain dictionary or shared base content of a qualified group).
32
75
  */
33
76
  const getDictionaryQualifierTypes = (dictionary) => {
34
77
  const declaredQualifiers = [];
35
- if (typeof dictionary.variant === "string") declaredQualifiers.push("variant");
36
- if (dictionary.meta !== void 0) declaredQualifiers.push("meta");
78
+ if (getVariantIds(dictionary.variant) !== void 0) declaredQualifiers.push("variant");
37
79
  if (typeof dictionary.item === "number") declaredQualifiers.push("item");
38
80
  return declaredQualifiers;
39
81
  };
40
82
  /**
41
- * Returns the qualifier identifier of a dictionary for the given qualifier
42
- * dimension — one segment of the composite entry id.
83
+ * Returns the qualifier identifiers of a dictionary for the given qualifier
84
+ * dimension — the candidate segments of the composite entry ids.
43
85
  *
44
- * - 'variant' → the variant name
45
- * - 'meta' → the `meta.id` discriminator
46
- * - 'item' → the item index as string
86
+ * - 'variant' → the serialized variant id(s); an array variant yields one id
87
+ * per element (declaration-side fan-out)
88
+ * - 'item' → the item index as a single-element list
47
89
  */
48
- const getDictionaryQualifierId = (dictionary, qualifierType) => {
49
- if (qualifierType === "variant") return dictionary.variant;
50
- if (qualifierType === "meta") {
51
- const metaId = dictionary.meta?.id;
52
- return metaId === void 0 ? void 0 : String(metaId);
53
- }
54
- return dictionary.item === void 0 ? void 0 : String(dictionary.item);
90
+ const getDictionaryQualifierIds = (dictionary, qualifierType) => {
91
+ if (qualifierType === "variant") return getVariantIds(dictionary.variant);
92
+ return dictionary.item === void 0 ? void 0 : [String(dictionary.item)];
55
93
  };
56
94
  /**
57
- * Returns the per-dimension id segments of a dictionary for the given ordered
58
- * dimension set, or `undefined` when the dictionary does not declare every
59
- * dimension of the set.
95
+ * Builds every composite entry id of a dictionary the cartesian product of
96
+ * its per-dimension id lists, joined in canonical order. A dictionary with a
97
+ * plain (non-array) variant yields exactly one id; an array variant fans out
98
+ * into one id per element. `undefined` when a dimension of the set is missing.
60
99
  */
61
- const getDictionaryQualifierSegments = (dictionary, qualifierTypes) => {
62
- const segments = [];
100
+ const getDictionaryCompositeIds = (dictionary, qualifierTypes) => {
101
+ let compositeIds = [""];
63
102
  for (const qualifierType of qualifierTypes) {
64
- const id = getDictionaryQualifierId(dictionary, qualifierType);
65
- if (id === void 0) return void 0;
66
- segments.push(id);
103
+ const ids = getDictionaryQualifierIds(dictionary, qualifierType);
104
+ if (ids === void 0) return void 0;
105
+ compositeIds = compositeIds.flatMap((prefix) => ids.map((id) => prefix === "" ? id : `${prefix}${"/"}${id}`));
67
106
  }
68
- return segments;
107
+ return compositeIds;
69
108
  };
70
109
  /**
71
- * Builds the composite entry id of a dictionary its per-dimension id segments
72
- * joined in canonical order. `undefined` when a dimension is missing.
73
- */
74
- const getDictionaryCompositeId = (dictionary, qualifierTypes) => getDictionaryQualifierSegments(dictionary, qualifierTypes)?.join("/");
75
- /**
76
- * Checks that every declared meta field is provided and equal in the selector.
77
- * Reserved keys (`locale`, `item`, `variant`) are skipped; `meta.id` is part of
78
- * the equality check.
110
+ * Tests whether a composite entry id matches a selector across every declared
111
+ * dimension. Segments are compared in their encoded form (both the stored id
112
+ * and the selector go through {@link serializeVariant}). The `item` dimension
113
+ * matches any value when the selector does not provide one (open collection
114
+ * axis).
79
115
  */
80
- const metaFieldsMatch = (meta, selector) => {
81
- if (!meta) return false;
82
- return Object.entries(meta).every(([metaField, declaredValue]) => {
83
- if (RESERVED_SELECTOR_KEYS.includes(metaField)) return true;
84
- const providedValue = selector?.[metaField];
85
- return providedValue !== void 0 && String(providedValue) === String(declaredValue);
116
+ const compositeIdMatchesSelector = (compositeId, qualifierTypes, selector) => {
117
+ const segments = compositeId.split("/");
118
+ return qualifierTypes.every((qualifierType, index) => {
119
+ if (qualifierType === "variant") return segments[index] === serializeVariant(selector?.variant);
120
+ return selector?.item === void 0 || segments[index] === String(selector.item);
86
121
  });
87
122
  };
88
123
  /**
89
- * Tests whether a group entry matches a selector across every declared
90
- * dimension. The `item` dimension matches any value when the selector does not
91
- * provide one (open collection axis).
92
- */
93
- const entryMatchesSelector = (entry, qualifierTypes, selector) => qualifierTypes.every((qualifierType) => {
94
- if (qualifierType === "variant") return entry.variant === (selector?.variant ?? "default");
95
- if (qualifierType === "item") return selector?.item === void 0 || String(entry.item) === String(selector.item);
96
- return metaFieldsMatch(entry.meta, selector);
97
- });
98
- /**
99
124
  * Type guard discriminating a `QualifiedDictionaryGroup` (merge output of a
100
125
  * qualified key) from a plain `Dictionary`. Both carry a `content` field; only
101
126
  * the group declares `qualifierTypes`, which is therefore the discriminator.
@@ -104,12 +129,13 @@ const isQualifiedDictionaryGroup = (value) => typeof value === "object" && value
104
129
  /**
105
130
  * Reconstructs a resolvable {@link Dictionary} from a single entry of a
106
131
  * qualified group: the content node stored under its composite id, plus the
107
- * qualifier coordinates decoded from that id (`variant`, `item`) and the
108
- * preserved `meta` object for the meta dimension.
132
+ * qualifier coordinates decoded from that id (`variant`, `item`).
109
133
  *
110
- * This keeps the resolver's matching/transform code unchanged: it still sees a
111
- * `{ key, content, variant?, item?, meta? }` shape, even though the stored
112
- * format no longer duplicates those fields per entry.
134
+ * This keeps the resolver's transform code unchanged: it still sees a
135
+ * `{ key, content, variant?, item? }` shape, even though the stored format no
136
+ * longer duplicates those fields per entry. The `variant` coordinate stays in
137
+ * its serialized (encoded) form, e.g. `'id=abc&userId=123'` — matching happens
138
+ * on the composite id segments, never on this reconstructed field.
113
139
  */
114
140
  const reconstructQualifiedEntry = (group, compositeId) => {
115
141
  const segments = compositeId.split("/");
@@ -121,10 +147,6 @@ const reconstructQualifiedEntry = (group, compositeId) => {
121
147
  if (qualifierType === "variant") entry.variant = segments[index];
122
148
  else if (qualifierType === "item") entry.item = Number(segments[index]);
123
149
  });
124
- if (group.qualifierTypes.includes("meta")) {
125
- const metaIndex = group.qualifierTypes.indexOf("meta");
126
- entry.meta = group.meta?.[compositeId] ?? { id: segments[metaIndex] };
127
- }
128
150
  return entry;
129
151
  };
130
152
  /**
@@ -134,8 +156,8 @@ const reconstructQualifiedEntry = (group, compositeId) => {
134
156
  * - Plain dictionary → returned as-is (selector ignored)
135
157
  * - `item` declared but not selected → every matching entry ordered by index
136
158
  * - `item` selected → the matching entry or null
137
- * - `variant` defaults to the `default` entry when not selected
138
- * - `meta` requires `{ id }` and every declared meta field to match
159
+ * - `variant` defaults to the `default` entry when not selected; an object
160
+ * variant resolves only when the selector provides an equal object
139
161
  *
140
162
  * Dimensions compose: e.g. a variant × item key with `{ variant: 'promo' }`
141
163
  * returns every promo item as an array; adding `{ item: 2 }` narrows to one.
@@ -143,9 +165,8 @@ const reconstructQualifiedEntry = (group, compositeId) => {
143
165
  const resolveQualifiedDictionary = (dictionaryOrGroup, selector) => {
144
166
  if (!isQualifiedDictionaryGroup(dictionaryOrGroup)) return dictionaryOrGroup;
145
167
  const { qualifierTypes, content } = dictionaryOrGroup;
146
- if (qualifierTypes.includes("meta") && selector?.id === void 0) return null;
147
168
  const itemAxisOpen = qualifierTypes.includes("item") && selector?.item === void 0;
148
- const matchedEntries = Object.keys(content).map((compositeId) => reconstructQualifiedEntry(dictionaryOrGroup, compositeId)).filter((entry) => entryMatchesSelector(entry, qualifierTypes, selector));
169
+ const matchedEntries = Object.keys(content).filter((compositeId) => compositeIdMatchesSelector(compositeId, qualifierTypes, selector)).map((compositeId) => reconstructQualifiedEntry(dictionaryOrGroup, compositeId));
149
170
  if (itemAxisOpen) return matchedEntries.sort((left, right) => (left.item ?? 0) - (right.item ?? 0));
150
171
  return matchedEntries[0] ?? null;
151
172
  };
@@ -166,7 +187,10 @@ const parseDictionarySelector = (localeOrSelector) => {
166
187
  */
167
188
  const getDictionarySelectorCacheKey = (selector) => {
168
189
  if (!selector) return "";
169
- return Object.keys(selector).filter((selectorKey) => selectorKey !== "locale").sort().map((selectorKey) => `${selectorKey}:${String(selector[selectorKey])}`).join("|");
190
+ return Object.keys(selector).filter((selectorKey) => selectorKey !== "locale").sort().map((selectorKey) => {
191
+ const value = selector[selectorKey];
192
+ return `${selectorKey}:${selectorKey === "variant" ? serializeVariant(value) : String(value)}`;
193
+ }).join("|");
170
194
  };
171
195
  /**
172
196
  * Marker property carrying the ordered qualifier dimensions on a dynamic loader
@@ -177,7 +201,7 @@ const getDictionarySelectorCacheKey = (selector) => {
177
201
  const QUALIFIER_DYNAMIC_TYPES_KEY = "__intlayerQualifierTypes";
178
202
  /**
179
203
  * Type guard discriminating a qualified dynamic loader map (collections /
180
- * variants / meta records, possibly combined) from a plain dynamic loader map.
204
+ * variants, possibly combined) from a plain dynamic loader map.
181
205
  */
182
206
  const isQualifiedDynamicLoaderMap = (value) => typeof value === "object" && value !== null && "__intlayerQualifierTypes" in value;
183
207
  /**
@@ -194,11 +218,6 @@ const collectQualifiedChunks = (loaderMap, key, locale, selector) => {
194
218
  missed: true,
195
219
  chunks: []
196
220
  };
197
- if (qualifierTypes.includes("meta") && selector?.id === void 0) return {
198
- itemAxisOpen,
199
- missed: true,
200
- chunks: []
201
- };
202
221
  const chunks = [];
203
222
  const walk = (node, dimensions, segments) => {
204
223
  if (dimensions.length === 0) {
@@ -214,7 +233,7 @@ const collectQualifiedChunks = (loaderMap, key, locale, selector) => {
214
233
  for (const segment of Object.keys(tree).sort((left, right) => Number(left) - Number(right))) walk(tree[segment], rest, [...segments, segment]);
215
234
  return true;
216
235
  }
217
- const segment = dimension === "variant" ? selector?.variant ?? "default" : dimension === "meta" ? String(selector?.id) : String(selector?.item);
236
+ const segment = dimension === "variant" ? serializeVariant(selector?.variant) : String(selector?.item);
218
237
  const child = tree[segment];
219
238
  if (!child) return false;
220
239
  return walk(child, rest, [...segments, segment]);
@@ -226,20 +245,15 @@ const collectQualifiedChunks = (loaderMap, key, locale, selector) => {
226
245
  };
227
246
  };
228
247
  /**
229
- * Whether a loaded chunk satisfies the selector's meta fields (no-op unless the
230
- * key declares a `meta` dimension).
231
- */
232
- const chunkMatchesMeta = (loaderMap, dictionary, selector) => !loaderMap["__intlayerQualifierTypes"].includes("meta") || metaFieldsMatch(dictionary.meta, selector);
233
- /**
234
248
  * Resolves the content of a qualified dynamic loader map against a selector,
235
249
  * loading only the chunk(s) the selector actually targets.
236
250
  *
237
251
  * Walks the nested loader tree one dimension at a time (canonical order
238
- * `variant → meta → item`): `variant` defaults to `default`, `meta` descends by
239
- * `id`, and `item` either narrows to the selected index or — when no item is
240
- * given — expands into every sibling chunk (the collection axis). Meta-equality
241
- * is verified on the loaded chunk. Semantics mirror
242
- * {@link resolveQualifiedDictionary} so dynamic and static modes behave alike.
252
+ * `variant → item`): `variant` defaults to `default` (or descends by the
253
+ * serialized object identity), and `item` either narrows to the selected index
254
+ * or — when no item is given — expands into every sibling chunk (the collection
255
+ * axis). Semantics mirror {@link resolveQualifiedDictionary} so dynamic and
256
+ * static modes behave alike.
243
257
  *
244
258
  * The Suspense mechanism is injected through `loadChunk` so the same logic
245
259
  * serves both the client (suspender cache) and the server (`react.use`). Every
@@ -257,7 +271,7 @@ const resolveQualifiedDynamicContent = (params) => {
257
271
  const { loaderMap, key, locale, selector, loadChunk, transform } = params;
258
272
  const { itemAxisOpen, missed, chunks } = collectQualifiedChunks(loaderMap, key, locale, selector);
259
273
  if (missed) return itemAxisOpen ? [] : null;
260
- const dictionaries = chunks.map(({ cacheKey, loader }) => loadChunk(cacheKey, loader())).filter((dictionary) => chunkMatchesMeta(loaderMap, dictionary, selector));
274
+ const dictionaries = chunks.map(({ cacheKey, loader }) => loadChunk(cacheKey, loader()));
261
275
  if (itemAxisOpen) return dictionaries.map(transform);
262
276
  const [dictionary] = dictionaries;
263
277
  return dictionary ? transform(dictionary) : null;
@@ -277,7 +291,7 @@ const resolveQualifiedDynamicContentAsync = async (params) => {
277
291
  const { loaderMap, key, locale, selector, transform } = params;
278
292
  const { itemAxisOpen, missed, chunks } = collectQualifiedChunks(loaderMap, key, locale, selector);
279
293
  if (missed) return itemAxisOpen ? [] : null;
280
- const dictionaries = (await Promise.all(chunks.map(({ loader }) => loader()))).filter((dictionary) => chunkMatchesMeta(loaderMap, dictionary, selector));
294
+ const dictionaries = await Promise.all(chunks.map(({ loader }) => loader()));
281
295
  if (itemAxisOpen) return dictionaries.map(transform);
282
296
  const [dictionary] = dictionaries;
283
297
  return dictionary ? transform(dictionary) : null;
@@ -287,11 +301,11 @@ const resolveQualifiedDynamicContentAsync = async (params) => {
287
301
  exports.COMPOSITE_ID_SEPARATOR = COMPOSITE_ID_SEPARATOR;
288
302
  exports.QUALIFIER_DYNAMIC_TYPES_KEY = QUALIFIER_DYNAMIC_TYPES_KEY;
289
303
  exports.QUALIFIER_ORDER = QUALIFIER_ORDER;
290
- exports.getDictionaryCompositeId = getDictionaryCompositeId;
291
- exports.getDictionaryQualifierId = getDictionaryQualifierId;
292
- exports.getDictionaryQualifierSegments = getDictionaryQualifierSegments;
304
+ exports.getDictionaryCompositeIds = getDictionaryCompositeIds;
305
+ exports.getDictionaryQualifierIds = getDictionaryQualifierIds;
293
306
  exports.getDictionaryQualifierTypes = getDictionaryQualifierTypes;
294
307
  exports.getDictionarySelectorCacheKey = getDictionarySelectorCacheKey;
308
+ exports.getVariantIds = getVariantIds;
295
309
  exports.isQualifiedDictionaryGroup = isQualifiedDictionaryGroup;
296
310
  exports.isQualifiedDynamicLoaderMap = isQualifiedDynamicLoaderMap;
297
311
  exports.parseDictionarySelector = parseDictionarySelector;
@@ -299,4 +313,5 @@ exports.reconstructQualifiedEntry = reconstructQualifiedEntry;
299
313
  exports.resolveQualifiedDictionary = resolveQualifiedDictionary;
300
314
  exports.resolveQualifiedDynamicContent = resolveQualifiedDynamicContent;
301
315
  exports.resolveQualifiedDynamicContentAsync = resolveQualifiedDynamicContentAsync;
316
+ exports.serializeVariant = serializeVariant;
302
317
  //# sourceMappingURL=qualifiedDictionary.cjs.map