@intlayer/core 9.0.0-canary.8 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +3 -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 +8 -7
  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 +81 -40
  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 +17 -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 +9 -4
  56. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  57. package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
  58. package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
  59. package/dist/cjs/interpreter/getGender.cjs.map +1 -1
  60. package/dist/cjs/interpreter/getHTML.cjs.map +1 -1
  61. package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
  62. package/dist/cjs/interpreter/getIntlayer.cjs +2 -2
  63. package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
  64. package/dist/cjs/interpreter/getNesting.cjs.map +1 -1
  65. package/dist/cjs/interpreter/getPlural.cjs +1 -1
  66. package/dist/cjs/interpreter/getPlural.cjs.map +1 -1
  67. package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
  68. package/dist/cjs/interpreter/index.cjs +7 -0
  69. package/dist/cjs/interpreter/interpolableNode.cjs +83 -0
  70. package/dist/cjs/interpreter/interpolableNode.cjs.map +1 -0
  71. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
  72. package/dist/cjs/localization/comparePaths.cjs.map +1 -1
  73. package/dist/cjs/localization/domainUtils.cjs +82 -0
  74. package/dist/cjs/localization/domainUtils.cjs.map +1 -0
  75. package/dist/cjs/localization/generateSitemap.cjs +2 -1
  76. package/dist/cjs/localization/generateSitemap.cjs.map +1 -1
  77. package/dist/cjs/localization/getBrowserLocale.cjs +7 -4
  78. package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
  79. package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
  80. package/dist/cjs/localization/getLocale.cjs +0 -1
  81. package/dist/cjs/localization/getLocale.cjs.map +1 -1
  82. package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
  83. package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
  84. package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
  85. package/dist/cjs/localization/getLocalizedUrl.cjs +4 -12
  86. package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
  87. package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
  88. package/dist/cjs/localization/getPathWithoutLocale.cjs +0 -1
  89. package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
  90. package/dist/cjs/localization/getPrefix.cjs +5 -10
  91. package/dist/cjs/localization/getPrefix.cjs.map +1 -1
  92. package/dist/cjs/localization/index.cjs +5 -0
  93. package/dist/cjs/localization/localeDetector.cjs +2 -1
  94. package/dist/cjs/localization/localeDetector.cjs.map +1 -1
  95. package/dist/cjs/localization/localeMapper.cjs +0 -1
  96. package/dist/cjs/localization/localeMapper.cjs.map +1 -1
  97. package/dist/cjs/localization/localeResolver.cjs +0 -1
  98. package/dist/cjs/localization/localeResolver.cjs.map +1 -1
  99. package/dist/cjs/localization/rewriteUtils.cjs +2 -1
  100. package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
  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 +0 -1
  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 +9 -7
  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 +79 -38
  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 +6 -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 +9 -4
  214. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  215. package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
  216. package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
  217. package/dist/esm/interpreter/getGender.mjs.map +1 -1
  218. package/dist/esm/interpreter/getHTML.mjs.map +1 -1
  219. package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
  220. package/dist/esm/interpreter/getIntlayer.mjs +2 -1
  221. package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
  222. package/dist/esm/interpreter/getNesting.mjs.map +1 -1
  223. package/dist/esm/interpreter/getPlural.mjs +1 -1
  224. package/dist/esm/interpreter/getPlural.mjs.map +1 -1
  225. package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
  226. package/dist/esm/interpreter/index.mjs +3 -1
  227. package/dist/esm/interpreter/interpolableNode.mjs +77 -0
  228. package/dist/esm/interpreter/interpolableNode.mjs.map +1 -0
  229. package/dist/esm/interpreter/splitAndJoinInsertion.mjs.map +1 -1
  230. package/dist/esm/localization/comparePaths.mjs.map +1 -1
  231. package/dist/esm/localization/domainUtils.mjs +77 -0
  232. package/dist/esm/localization/domainUtils.mjs.map +1 -0
  233. package/dist/esm/localization/generateSitemap.mjs +2 -1
  234. package/dist/esm/localization/generateSitemap.mjs.map +1 -1
  235. package/dist/esm/localization/getBrowserLocale.mjs +7 -3
  236. package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
  237. package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
  238. package/dist/esm/localization/getLocale.mjs.map +1 -1
  239. package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
  240. package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
  241. package/dist/esm/localization/getLocaleName.mjs.map +1 -1
  242. package/dist/esm/localization/getLocalizedUrl.mjs +4 -11
  243. package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
  244. package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
  245. package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
  246. package/dist/esm/localization/getPrefix.mjs +5 -9
  247. package/dist/esm/localization/getPrefix.mjs.map +1 -1
  248. package/dist/esm/localization/index.mjs +2 -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 +2 -1
  254. package/dist/esm/localization/rewriteUtils.mjs.map +1 -1
  255. package/dist/esm/localization/validatePrefix.mjs.map +1 -1
  256. package/dist/esm/markdown/compiler.mjs +2 -1
  257. package/dist/esm/markdown/compiler.mjs.map +1 -1
  258. package/dist/esm/markdown/constants.mjs.map +1 -1
  259. package/dist/esm/markdown/parser.mjs.map +1 -1
  260. package/dist/esm/markdown/renderer.mjs.map +1 -1
  261. package/dist/esm/markdown/utils.mjs.map +1 -1
  262. package/dist/esm/messageFormat/ICU.mjs +15 -9
  263. package/dist/esm/messageFormat/ICU.mjs.map +1 -1
  264. package/dist/esm/messageFormat/i18next.mjs +12 -7
  265. package/dist/esm/messageFormat/i18next.mjs.map +1 -1
  266. package/dist/esm/messageFormat/index.mjs +2 -1
  267. package/dist/esm/messageFormat/navigatePath.mjs +36 -0
  268. package/dist/esm/messageFormat/navigatePath.mjs.map +1 -0
  269. package/dist/esm/messageFormat/po.mjs.map +1 -1
  270. package/dist/esm/messageFormat/resolveMessage.mjs +11 -8
  271. package/dist/esm/messageFormat/resolveMessage.mjs.map +1 -1
  272. package/dist/esm/messageFormat/verify-icu-format.mjs.map +1 -1
  273. package/dist/esm/messageFormat/vue-i18n.mjs +2 -1
  274. package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
  275. package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
  276. package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
  277. package/dist/esm/transpiler/file/file.mjs +2 -1
  278. package/dist/esm/transpiler/file/file.mjs.map +1 -1
  279. package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
  280. package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
  281. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -1
  282. package/dist/esm/transpiler/html/html.mjs.map +1 -1
  283. package/dist/esm/transpiler/html/htmlTags.mjs.map +1 -1
  284. package/dist/esm/transpiler/html/validateHTML.mjs +1 -1
  285. package/dist/esm/transpiler/html/validateHTML.mjs.map +1 -1
  286. package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
  287. package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
  288. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
  289. package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
  290. package/dist/esm/transpiler/markdown/validateMarkdown.mjs.map +1 -1
  291. package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
  292. package/dist/esm/transpiler/plural/plural.mjs.map +1 -1
  293. package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
  294. package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
  295. package/dist/esm/utils/cookieExpiry.mjs.map +1 -1
  296. package/dist/esm/utils/getCookie.mjs.map +1 -1
  297. package/dist/esm/utils/intl.mjs +100 -25
  298. package/dist/esm/utils/intl.mjs.map +1 -1
  299. package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
  300. package/dist/esm/utils/localeStorage.mjs.map +1 -1
  301. package/dist/esm/utils/parseYaml.mjs +1 -1
  302. package/dist/esm/utils/parseYaml.mjs.map +1 -1
  303. package/dist/esm/utils/stringifyYaml.mjs +1 -1
  304. package/dist/esm/utils/stringifyYaml.mjs.map +1 -1
  305. package/dist/types/deepTransformPlugins/getEditedContent.d.ts +0 -1
  306. package/dist/types/deepTransformPlugins/getEditedContent.d.ts.map +1 -1
  307. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +12 -13
  308. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
  309. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +12 -13
  310. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -1
  311. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +12 -13
  312. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -1
  313. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +1 -1
  314. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +1 -1
  315. package/dist/types/deepTransformPlugins/getMaskContent.d.ts +1 -1
  316. package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -1
  317. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +1 -1
  318. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +1 -1
  319. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts +0 -1
  320. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts.map +1 -1
  321. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +1 -1
  322. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -1
  323. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts +1 -2
  324. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts.map +1 -1
  325. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +1 -2
  326. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +1 -1
  327. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +0 -1
  328. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +1 -1
  329. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +0 -1
  330. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +1 -1
  331. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +0 -1
  332. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -1
  333. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +0 -1
  334. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -1
  335. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +0 -1
  336. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -1
  337. package/dist/types/dictionaryManipulator/getNodeType.d.ts +0 -1
  338. package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -1
  339. package/dist/types/dictionaryManipulator/index.d.ts +2 -2
  340. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +0 -1
  341. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -1
  342. package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts +0 -1
  343. package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts.map +1 -1
  344. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +0 -1
  345. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +1 -1
  346. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +1 -2
  347. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -1
  348. package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts +33 -23
  349. package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts.map +1 -1
  350. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +0 -1
  351. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +1 -1
  352. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +1 -2
  353. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +1 -1
  354. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +0 -1
  355. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +1 -1
  356. package/dist/types/formatters/compact.d.ts +0 -1
  357. package/dist/types/formatters/compact.d.ts.map +1 -1
  358. package/dist/types/formatters/currency.d.ts +0 -1
  359. package/dist/types/formatters/currency.d.ts.map +1 -1
  360. package/dist/types/formatters/date.d.ts +0 -1
  361. package/dist/types/formatters/date.d.ts.map +1 -1
  362. package/dist/types/formatters/index.d.ts +2 -2
  363. package/dist/types/formatters/list.d.ts +0 -1
  364. package/dist/types/formatters/list.d.ts.map +1 -1
  365. package/dist/types/formatters/number.d.ts +1 -5
  366. package/dist/types/formatters/number.d.ts.map +1 -1
  367. package/dist/types/formatters/percentage.d.ts +1 -5
  368. package/dist/types/formatters/percentage.d.ts.map +1 -1
  369. package/dist/types/formatters/relativeTime.d.ts +0 -1
  370. package/dist/types/formatters/relativeTime.d.ts.map +1 -1
  371. package/dist/types/formatters/units.d.ts +0 -1
  372. package/dist/types/formatters/units.d.ts.map +1 -1
  373. package/dist/types/index.d.ts +16 -3
  374. package/dist/types/interpreter/getCondition.d.ts +1 -0
  375. package/dist/types/interpreter/getCondition.d.ts.map +1 -1
  376. package/dist/types/interpreter/getContent/deepTransform.d.ts +0 -1
  377. package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -1
  378. package/dist/types/interpreter/getContent/getContent.d.ts +0 -1
  379. package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
  380. package/dist/types/interpreter/getContent/plugins.d.ts +4 -4
  381. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
  382. package/dist/types/interpreter/getDictionary.d.ts +1 -1
  383. package/dist/types/interpreter/getDictionary.d.ts.map +1 -1
  384. package/dist/types/interpreter/getEnumeration.d.ts +1 -0
  385. package/dist/types/interpreter/getEnumeration.d.ts.map +1 -1
  386. package/dist/types/interpreter/getGender.d.ts +1 -0
  387. package/dist/types/interpreter/getGender.d.ts.map +1 -1
  388. package/dist/types/interpreter/getHTML.d.ts.map +1 -1
  389. package/dist/types/interpreter/getInsertion.d.ts +2 -1
  390. package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
  391. package/dist/types/interpreter/getIntlayer.d.ts +1 -1
  392. package/dist/types/interpreter/getIntlayer.d.ts.map +1 -1
  393. package/dist/types/interpreter/getNesting.d.ts +2 -1
  394. package/dist/types/interpreter/getNesting.d.ts.map +1 -1
  395. package/dist/types/interpreter/getPlural.d.ts +0 -1
  396. package/dist/types/interpreter/getPlural.d.ts.map +1 -1
  397. package/dist/types/interpreter/getTranslation.d.ts +0 -1
  398. package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
  399. package/dist/types/interpreter/index.d.ts +4 -1
  400. package/dist/types/interpreter/interpolableNode.d.ts +66 -0
  401. package/dist/types/interpreter/interpolableNode.d.ts.map +1 -0
  402. package/dist/types/interpreter/splitAndJoinInsertion.d.ts.map +1 -1
  403. package/dist/types/localization/comparePaths.d.ts +0 -1
  404. package/dist/types/localization/comparePaths.d.ts.map +1 -1
  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 +2 -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":"compact.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/compact.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)\n * based on locale and formatting options.\n *\n * @example\n * compact(1200); // \"1.2K\"\n *\n * @example\n * compact(\"1000000\", { locale: Locales.FRENCH, compactDisplay: \"long\" });\n * // \"1 million\"\n */\nexport const compact = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n getCachedIntl(\n Intl.NumberFormat,\n options?.locale ?? internationalization?.defaultLocale,\n\n {\n ...options,\n notation: 'compact',\n }\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAa,WACX,OACA,YAEAA,iCACE,KAAK,cACL,SAAS,UAAUC,6CAAsB,eAEzC;CACE,GAAG;CACH,UAAU;CACX,CACF,CAAC,OAAO,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"compact.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/compact.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)\n * based on locale and formatting options.\n *\n * @example\n * compact(1200); // \"1.2K\"\n *\n * @example\n * compact(\"1000000\", { locale: Locales.FRENCH, compactDisplay: \"long\" });\n * // \"1 million\"\n */\nexport const compact = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n getCachedIntl(\n 'NumberFormat',\n options?.locale ?? internationalization?.defaultLocale,\n\n {\n ...options,\n notation: 'compact',\n }\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAa,WACX,OACA,YAEAA,iCACE,gBACA,SAAS,UAAUC,6CAAsB,eAEzC;CACE,GAAG;CACH,UAAU;AACZ,CACF,CAAC,CAAC,OAAO,OAAO,KAAK,CAAC"}
@@ -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_utils_intl = require('../utils/intl.cjs');
4
3
  let _intlayer_config_built = require("@intlayer/config/built");
5
4
 
@@ -15,7 +14,7 @@ let _intlayer_config_built = require("@intlayer/config/built");
15
14
  * currency("5000", { locale: Locales.FRENCH, currency: "CAD", currencyDisplay: "code" });
16
15
  * // "5 000,00 CAD"
17
16
  */
18
- const currency = (value, options) => require_utils_intl.getCachedIntl(Intl.NumberFormat, options?.locale ?? _intlayer_config_built.internationalization?.defaultLocale, {
17
+ const currency = (value, options) => require_utils_intl.getCachedIntl("NumberFormat", options?.locale ?? _intlayer_config_built.internationalization?.defaultLocale, {
19
18
  style: "currency",
20
19
  currency: options?.currency ?? "USD",
21
20
  currencyDisplay: options?.currencyDisplay ?? "symbol",
@@ -1 +1 @@
1
- {"version":3,"file":"currency.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/currency.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric or string value into a localized currency string using the Intl API.\n *\n * @example\n * currency(1234.5, { currency: 'EUR' });\n * // \"€1,234.50\"\n *\n * @example\n * currency(\"5000\", { locale: Locales.FRENCH, currency: \"CAD\", currencyDisplay: \"code\" });\n * // \"5 000,00 CAD\"\n */\nexport const currency = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n getCachedIntl(\n Intl.NumberFormat,\n options?.locale ?? internationalization?.defaultLocale,\n\n {\n style: 'currency',\n currency: options?.currency ?? 'USD',\n currencyDisplay: options?.currencyDisplay ?? 'symbol',\n minimumFractionDigits: options?.minimumFractionDigits ?? 2,\n maximumFractionDigits: options?.maximumFractionDigits ?? 2,\n ...options,\n }\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAa,YACX,OACA,YAEAA,iCACE,KAAK,cACL,SAAS,UAAUC,6CAAsB,eAEzC;CACE,OAAO;CACP,UAAU,SAAS,YAAY;CAC/B,iBAAiB,SAAS,mBAAmB;CAC7C,uBAAuB,SAAS,yBAAyB;CACzD,uBAAuB,SAAS,yBAAyB;CACzD,GAAG;CACJ,CACF,CAAC,OAAO,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"currency.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/currency.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric or string value into a localized currency string using the Intl API.\n *\n * @example\n * currency(1234.5, { currency: 'EUR' });\n * // \"€1,234.50\"\n *\n * @example\n * currency(\"5000\", { locale: Locales.FRENCH, currency: \"CAD\", currencyDisplay: \"code\" });\n * // \"5 000,00 CAD\"\n */\nexport const currency = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n getCachedIntl(\n 'NumberFormat',\n options?.locale ?? internationalization?.defaultLocale,\n\n {\n style: 'currency',\n currency: options?.currency ?? 'USD',\n currencyDisplay: options?.currencyDisplay ?? 'symbol',\n minimumFractionDigits: options?.minimumFractionDigits ?? 2,\n maximumFractionDigits: options?.maximumFractionDigits ?? 2,\n ...options,\n }\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAa,YACX,OACA,YAEAA,iCACE,gBACA,SAAS,UAAUC,6CAAsB,eAEzC;CACE,OAAO;CACP,UAAU,SAAS,YAAY;CAC/B,iBAAiB,SAAS,mBAAmB;CAC7C,uBAAuB,SAAS,yBAAyB;CACzD,uBAAuB,SAAS,yBAAyB;CACzD,GAAG;AACL,CACF,CAAC,CAAC,OAAO,OAAO,KAAK,CAAC"}
@@ -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_utils_intl = require('../utils/intl.cjs');
4
3
  let _intlayer_config_built = require("@intlayer/config/built");
5
4
 
@@ -52,8 +51,7 @@ const presets = {
52
51
  const date = (date, options) => {
53
52
  const dateTime = new Date(date);
54
53
  const resolvedOptions = typeof options === "string" ? presets[options] ?? {} : options;
55
- const locale = (typeof options === "object" ? options?.locale : void 0) ?? _intlayer_config_built.internationalization?.defaultLocale;
56
- return require_utils_intl.getCachedIntl(Intl.DateTimeFormat, locale, resolvedOptions).format(dateTime);
54
+ return require_utils_intl.getCachedIntl("DateTimeFormat", (typeof options === "object" ? options?.locale : void 0) ?? _intlayer_config_built.internationalization?.defaultLocale, resolvedOptions).format(dateTime);
57
55
  };
58
56
 
59
57
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"date.cjs","names":["internationalization","getCachedIntl"],"sources":["../../../src/formatters/date.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\nexport type DateTimePreset =\n | 'short'\n | 'long'\n | 'dateOnly'\n | 'timeOnly'\n | 'full';\n\nexport const presets: Record<DateTimePreset, Intl.DateTimeFormatOptions> = {\n short: {\n year: '2-digit',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n },\n long: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n },\n full: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n },\n dateOnly: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n timeOnly: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n};\n\n/**\n * Formats a date/time value into a localized string using Intl.DateTimeFormat.\n *\n * @example\n * date(new Date('2025-08-02T14:30:00Z'), { year: '2-digit', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });\n * // \"08/02/25, 14:30\"\n *\n * @example\n * date(\"2025-08-02T14:30:00Z\", { locale: Locales.FRENCH, month: \"long\", day: \"numeric\" });\n * // \"2 août\"\n */\nexport const date = (\n date: Date | string | number,\n options?:\n | (Intl.DateTimeFormatOptions & { locale?: LocalesValues })\n | DateTimePreset\n): string => {\n const dateTime = new Date(date);\n\n const resolvedOptions =\n typeof options === 'string' ? (presets[options] ?? {}) : options;\n\n const locale =\n (typeof options === 'object' ? options?.locale : undefined) ??\n internationalization?.defaultLocale;\n\n const formatter = getCachedIntl(Intl.DateTimeFormat, locale, resolvedOptions);\n\n return formatter.format(dateTime);\n};\n"],"mappings":";;;;;;AAWA,MAAa,UAA8D;CACzE,OAAO;EACL,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACT;CACD,MAAM;EACJ,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACT;CACD,MAAM;EACJ,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACR,QAAQ;EACT;CACD,UAAU;EACR,MAAM;EACN,OAAO;EACP,KAAK;EACN;CACD,UAAU;EACR,MAAM;EACN,QAAQ;EACR,QAAQ;EACT;CACF;;;;;;;;;;;;AAaD,MAAa,QACX,MACA,YAGW;CACX,MAAM,WAAW,IAAI,KAAK,KAAK;CAE/B,MAAM,kBACJ,OAAO,YAAY,WAAY,QAAQ,YAAY,EAAE,GAAI;CAE3D,MAAM,UACH,OAAO,YAAY,WAAW,SAAS,SAAS,WACjDA,6CAAsB;AAIxB,QAFkBC,iCAAc,KAAK,gBAAgB,QAAQ,gBAE7C,CAAC,OAAO,SAAS"}
1
+ {"version":3,"file":"date.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/date.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\nexport type DateTimePreset =\n | 'short'\n | 'long'\n | 'dateOnly'\n | 'timeOnly'\n | 'full';\n\nexport const presets: Record<DateTimePreset, Intl.DateTimeFormatOptions> = {\n short: {\n year: '2-digit',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n },\n long: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n },\n full: {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n },\n dateOnly: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n timeOnly: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n};\n\n/**\n * Formats a date/time value into a localized string using Intl.DateTimeFormat.\n *\n * @example\n * date(new Date('2025-08-02T14:30:00Z'), { year: '2-digit', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });\n * // \"08/02/25, 14:30\"\n *\n * @example\n * date(\"2025-08-02T14:30:00Z\", { locale: Locales.FRENCH, month: \"long\", day: \"numeric\" });\n * // \"2 août\"\n */\nexport const date = (\n date: Date | string | number,\n options?:\n | (Intl.DateTimeFormatOptions & { locale?: LocalesValues })\n | DateTimePreset\n): string => {\n const dateTime = new Date(date);\n\n const resolvedOptions =\n typeof options === 'string' ? (presets[options] ?? {}) : options;\n\n const locale =\n (typeof options === 'object' ? options?.locale : undefined) ??\n internationalization?.defaultLocale;\n\n const formatter = getCachedIntl('DateTimeFormat', locale, resolvedOptions);\n\n return formatter.format(dateTime);\n};\n"],"mappings":";;;;;AAWA,MAAa,UAA8D;CACzE,OAAO;EACL,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;CACV;CACA,MAAM;EACJ,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;CACV;CACA,MAAM;EACJ,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACR,QAAQ;CACV;CACA,UAAU;EACR,MAAM;EACN,OAAO;EACP,KAAK;CACP;CACA,UAAU;EACR,MAAM;EACN,QAAQ;EACR,QAAQ;CACV;AACF;;;;;;;;;;;;AAaA,MAAa,QACX,MACA,YAGW;CACX,MAAM,WAAW,IAAI,KAAK,IAAI;CAE9B,MAAM,kBACJ,OAAO,YAAY,WAAY,QAAQ,YAAY,CAAC,IAAK;CAQ3D,OAFkBA,iCAAc,mBAH7B,OAAO,YAAY,WAAW,SAAS,SAAS,WACjDC,6CAAsB,eAEkC,eAE3C,CAAC,CAAC,OAAO,QAAQ;AAClC"}
@@ -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_utils_intl = require('../utils/intl.cjs');
4
3
  let _intlayer_config_built = require("@intlayer/config/built");
5
4
 
@@ -19,7 +18,7 @@ let _intlayer_config_built = require("@intlayer/config/built");
19
18
  * list([1, 2, 3], { type: 'unit' });
20
19
  * // "1, 2, 3"
21
20
  */
22
- const list = (values, options) => require_utils_intl.getCachedIntl(Intl.ListFormat, options?.locale ?? _intlayer_config_built.internationalization?.defaultLocale, {
21
+ const list = (values, options) => require_utils_intl.getCachedIntl("ListFormat", options?.locale ?? _intlayer_config_built.internationalization?.defaultLocale, {
23
22
  type: options?.type ?? "conjunction",
24
23
  style: options?.style ?? "long",
25
24
  ...options
@@ -1 +1 @@
1
- {"version":3,"file":"list.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/list.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/** Locally defined subset of Intl.ListFormatOptions so consumers don't need ES2021.Intl in their lib. */\ntype ListFormatOptions = {\n localeMatcher?: 'lookup' | 'best fit';\n type?: 'conjunction' | 'disjunction' | 'unit';\n style?: 'long' | 'short' | 'narrow';\n};\n\n/**\n * Formats an array of values into a localized list string using the Intl API.\n *\n * @example\n * list(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * @example\n * list(['red', 'green', 'blue'], { locale: Locales.FRENCH, type: 'disjunction' });\n * // \"rouge, vert ou bleu\"\n *\n * @example\n * list([1, 2, 3], { type: 'unit' });\n * // \"1, 2, 3\"\n */\nexport const list = (\n values: (string | number)[],\n options?: ListFormatOptions & { locale?: LocalesValues }\n): string =>\n getCachedIntl(\n (Intl as any).ListFormat,\n options?.locale ?? internationalization?.defaultLocale,\n\n {\n type: options?.type ?? 'conjunction',\n style: options?.style ?? 'long',\n ...options,\n }\n ).format(values.map(String));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,QACX,QACA,YAEAA,iCACG,KAAa,YACd,SAAS,UAAUC,6CAAsB,eAEzC;CACE,MAAM,SAAS,QAAQ;CACvB,OAAO,SAAS,SAAS;CACzB,GAAG;CACJ,CACF,CAAC,OAAO,OAAO,IAAI,OAAO,CAAC"}
1
+ {"version":3,"file":"list.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/list.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/** Locally defined subset of Intl.ListFormatOptions so consumers don't need ES2021.Intl in their lib. */\ntype ListFormatOptions = {\n localeMatcher?: 'lookup' | 'best fit';\n type?: 'conjunction' | 'disjunction' | 'unit';\n style?: 'long' | 'short' | 'narrow';\n};\n\n/**\n * Formats an array of values into a localized list string using the Intl API.\n *\n * @example\n * list(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * @example\n * list(['red', 'green', 'blue'], { locale: Locales.FRENCH, type: 'disjunction' });\n * // \"rouge, vert ou bleu\"\n *\n * @example\n * list([1, 2, 3], { type: 'unit' });\n * // \"1, 2, 3\"\n */\nexport const list = (\n values: (string | number)[],\n options?: ListFormatOptions & { locale?: LocalesValues }\n): string =>\n getCachedIntl(\n 'ListFormat',\n options?.locale ?? internationalization?.defaultLocale,\n\n {\n type: options?.type ?? 'conjunction',\n style: options?.style ?? 'long',\n ...options,\n }\n ).format(values.map(String));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,QACX,QACA,YAEAA,iCACE,cACA,SAAS,UAAUC,6CAAsB,eAEzC;CACE,MAAM,SAAS,QAAQ;CACvB,OAAO,SAAS,SAAS;CACzB,GAAG;AACL,CACF,CAAC,CAAC,OAAO,OAAO,IAAI,MAAM,CAAC"}
@@ -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_utils_intl = require('../utils/intl.cjs');
4
3
  let _intlayer_config_built = require("@intlayer/config/built");
5
4
 
@@ -13,7 +12,7 @@ let _intlayer_config_built = require("@intlayer/config/built");
13
12
  * @example
14
13
  * number("1000000", { locale: Locales.FRENCH }); // "1 000 000"
15
14
  */
16
- const number = (value, { locale, ...options } = {}) => require_utils_intl.getCachedIntl(Intl.NumberFormat, locale ?? _intlayer_config_built.internationalization?.defaultLocale, options).format(Number(value));
15
+ const number = (value, { locale, ...options } = {}) => require_utils_intl.getCachedIntl("NumberFormat", locale ?? _intlayer_config_built.internationalization?.defaultLocale, options).format(Number(value));
17
16
 
18
17
  //#endregion
19
18
  exports.number = number;
@@ -1 +1 @@
1
- {"version":3,"file":"number.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/number.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using locale-aware formatting.\n *\n * @example\n * number(123456.789); // \"123,456.789\"\n *\n * @example\n * number(\"1000000\", { locale: Locales.FRENCH }); // \"1 000 000\"\n */\nexport const number = (\n value: string | number,\n {\n locale,\n ...options\n }: Intl.NumberFormatOptions & { locale?: LocalesValues } = {}\n): string =>\n getCachedIntl(\n Intl.NumberFormat,\n locale ?? internationalization?.defaultLocale,\n\n options\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAa,UACX,OACA,EACE,QACA,GAAG,YACsD,EAAE,KAE7DA,iCACE,KAAK,cACL,UAAUC,6CAAsB,eAEhC,QACD,CAAC,OAAO,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"number.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/number.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using locale-aware formatting.\n *\n * @example\n * number(123456.789); // \"123,456.789\"\n *\n * @example\n * number(\"1000000\", { locale: Locales.FRENCH }); // \"1 000 000\"\n */\nexport const number = (\n value: string | number,\n {\n locale,\n ...options\n }: Intl.NumberFormatOptions & { locale?: LocalesValues } = {}\n): string =>\n getCachedIntl(\n 'NumberFormat',\n locale ?? internationalization?.defaultLocale,\n\n options\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,UACX,OACA,EACE,QACA,GAAG,YACsD,CAAC,MAE5DA,iCACE,gBACA,UAAUC,6CAAsB,eAEhC,OACF,CAAC,CAAC,OAAO,OAAO,KAAK,CAAC"}
@@ -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_utils_intl = require('../utils/intl.cjs');
4
3
  let _intlayer_config_built = require("@intlayer/config/built");
5
4
 
@@ -16,7 +15,7 @@ let _intlayer_config_built = require("@intlayer/config/built");
16
15
  const percentage = (value, { locale, ...options } = {}) => {
17
16
  let numericValue = Number(value);
18
17
  if (numericValue > 1) numericValue /= 100;
19
- return require_utils_intl.getCachedIntl(Intl.NumberFormat, locale ?? _intlayer_config_built.internationalization?.defaultLocale, {
18
+ return require_utils_intl.getCachedIntl("NumberFormat", locale ?? _intlayer_config_built.internationalization?.defaultLocale, {
20
19
  style: "percent",
21
20
  ...options
22
21
  }).format(Number(numericValue));
@@ -1 +1 @@
1
- {"version":3,"file":"percentage.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/percentage.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a number as a percentage string (e.g., 0.25 → \"25%\").\n *\n * @example\n * percentage(0.25); // \"25%\"\n *\n * @example\n * percentage(0.25, { minimumFractionDigits: 2 }); // \"25.00%\"\n */\nexport const percentage = (\n value: string | number,\n {\n locale,\n ...options\n }: Intl.NumberFormatOptions & { locale?: LocalesValues } = {}\n): string => {\n let numericValue = Number(value);\n\n // Normalize: if user passes 10, treat it as 10% instead of 1000%\n if (numericValue > 1) {\n numericValue /= 100;\n }\n\n const formatter = getCachedIntl(\n Intl.NumberFormat,\n locale ?? internationalization?.defaultLocale,\n\n {\n style: 'percent',\n ...options,\n }\n );\n\n return formatter.format(Number(numericValue));\n};\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAa,cACX,OACA,EACE,QACA,GAAG,YACsD,EAAE,KAClD;CACX,IAAI,eAAe,OAAO,MAAM;AAGhC,KAAI,eAAe,EACjB,iBAAgB;AAalB,QAVkBA,iCAChB,KAAK,cACL,UAAUC,6CAAsB,eAEhC;EACE,OAAO;EACP,GAAG;EACJ,CAGa,CAAC,OAAO,OAAO,aAAa,CAAC"}
1
+ {"version":3,"file":"percentage.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/percentage.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a number as a percentage string (e.g., 0.25 → \"25%\").\n *\n * @example\n * percentage(0.25); // \"25%\"\n *\n * @example\n * percentage(0.25, { minimumFractionDigits: 2 }); // \"25.00%\"\n */\nexport const percentage = (\n value: string | number,\n {\n locale,\n ...options\n }: Intl.NumberFormatOptions & { locale?: LocalesValues } = {}\n): string => {\n let numericValue = Number(value);\n\n // Normalize: if user passes 10, treat it as 10% instead of 1000%\n if (numericValue > 1) {\n numericValue /= 100;\n }\n\n const formatter = getCachedIntl(\n 'NumberFormat',\n locale ?? internationalization?.defaultLocale,\n\n {\n style: 'percent',\n ...options,\n }\n );\n\n return formatter.format(Number(numericValue));\n};\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,cACX,OACA,EACE,QACA,GAAG,YACsD,CAAC,MACjD;CACX,IAAI,eAAe,OAAO,KAAK;CAG/B,IAAI,eAAe,GACjB,gBAAgB;CAalB,OAVkBA,iCAChB,gBACA,UAAUC,6CAAsB,eAEhC;EACE,OAAO;EACP,GAAG;CACL,CAGa,CAAC,CAAC,OAAO,OAAO,YAAY,CAAC;AAC9C"}
@@ -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_utils_intl = require('../utils/intl.cjs');
4
3
  let _intlayer_config_built = require("@intlayer/config/built");
5
4
 
@@ -35,7 +34,7 @@ const relativeTime = (from, to = /* @__PURE__ */ new Date(), options) => {
35
34
  const toDate = new Date(to);
36
35
  const unit = options?.unit ?? "second";
37
36
  const value = diffInUnit(fromDate, toDate, unit);
38
- return require_utils_intl.getCachedIntl(Intl.RelativeTimeFormat, options?.locale ?? _intlayer_config_built.internationalization?.defaultLocale, options).format(Math.round(value), unit);
37
+ return require_utils_intl.getCachedIntl("RelativeTimeFormat", options?.locale ?? _intlayer_config_built.internationalization?.defaultLocale, options).format(Math.round(value), unit);
39
38
  };
40
39
 
41
40
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"relativeTime.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/relativeTime.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\ntype RelativeTimeUnit = Intl.RelativeTimeFormatUnit;\n\n/**\n * Calculate the difference between 2 dates in the given unit.\n */\nconst diffInUnit = (from: Date, to: Date, unit: RelativeTimeUnit): number => {\n const msDiff = to.getTime() - from.getTime();\n const sec = msDiff / 1000;\n\n switch (unit) {\n case 'second':\n return sec;\n case 'minute':\n return sec / 60;\n case 'hour':\n return sec / 3600;\n case 'day':\n return sec / 86400;\n case 'month':\n return sec / (30 * 86400); // approx\n case 'quarter':\n return sec / (3 * 30 * 86400); // 3 months approx\n case 'year':\n return sec / (365 * 86400); // approx\n default:\n return sec;\n }\n};\n\n/**\n * Formats the difference between two dates as a localized relative time string.\n *\n * @example\n * relativeTime(new Date(Date.now() - 30000)); // \"30 seconds ago\"\n *\n * @example\n * relativeTime(\"2025-01-01\", new Date(), { locale: Locales.FRENCH, unit: \"day\" });\n * // \"il y a 443 jours\"\n */\nexport const relativeTime = (\n from: Date | string | number,\n to: Date | string | number = new Date(),\n options?: Intl.RelativeTimeFormatOptions & {\n locale?: LocalesValues;\n unit?: RelativeTimeUnit;\n }\n): string => {\n const fromDate = new Date(from);\n const toDate = new Date(to);\n const unit = options?.unit ?? 'second';\n\n const value = diffInUnit(fromDate, toDate, unit);\n\n return getCachedIntl(\n Intl.RelativeTimeFormat,\n options?.locale ?? internationalization?.defaultLocale,\n\n options\n ).format(Math.round(value), unit);\n};\n"],"mappings":";;;;;;;;;AASA,MAAM,cAAc,MAAY,IAAU,SAAmC;CAE3E,MAAM,OADS,GAAG,SAAS,GAAG,KAAK,SAAS,IACvB;AAErB,SAAQ,MAAR;EACE,KAAK,SACH,QAAO;EACT,KAAK,SACH,QAAO,MAAM;EACf,KAAK,OACH,QAAO,MAAM;EACf,KAAK,MACH,QAAO,MAAM;EACf,KAAK,QACH,QAAO,OAAO,KAAK;EACrB,KAAK,UACH,QAAO,OAAO,KAAS;EACzB,KAAK,OACH,QAAO,OAAO,MAAM;EACtB,QACE,QAAO;;;;;;;;;;;;;AAcb,MAAa,gBACX,MACA,qBAA6B,IAAI,MAAM,EACvC,YAIW;CACX,MAAM,WAAW,IAAI,KAAK,KAAK;CAC/B,MAAM,SAAS,IAAI,KAAK,GAAG;CAC3B,MAAM,OAAO,SAAS,QAAQ;CAE9B,MAAM,QAAQ,WAAW,UAAU,QAAQ,KAAK;AAEhD,QAAOA,iCACL,KAAK,oBACL,SAAS,UAAUC,6CAAsB,eAEzC,QACD,CAAC,OAAO,KAAK,MAAM,MAAM,EAAE,KAAK"}
1
+ {"version":3,"file":"relativeTime.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/relativeTime.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\ntype RelativeTimeUnit = Intl.RelativeTimeFormatUnit;\n\n/**\n * Calculate the difference between 2 dates in the given unit.\n */\nconst diffInUnit = (from: Date, to: Date, unit: RelativeTimeUnit): number => {\n const msDiff = to.getTime() - from.getTime();\n const sec = msDiff / 1000;\n\n switch (unit) {\n case 'second':\n return sec;\n case 'minute':\n return sec / 60;\n case 'hour':\n return sec / 3600;\n case 'day':\n return sec / 86400;\n case 'month':\n return sec / (30 * 86400); // approx\n case 'quarter':\n return sec / (3 * 30 * 86400); // 3 months approx\n case 'year':\n return sec / (365 * 86400); // approx\n default:\n return sec;\n }\n};\n\n/**\n * Formats the difference between two dates as a localized relative time string.\n *\n * @example\n * relativeTime(new Date(Date.now() - 30000)); // \"30 seconds ago\"\n *\n * @example\n * relativeTime(\"2025-01-01\", new Date(), { locale: Locales.FRENCH, unit: \"day\" });\n * // \"il y a 443 jours\"\n */\nexport const relativeTime = (\n from: Date | string | number,\n to: Date | string | number = new Date(),\n options?: Intl.RelativeTimeFormatOptions & {\n locale?: LocalesValues;\n unit?: RelativeTimeUnit;\n }\n): string => {\n const fromDate = new Date(from);\n const toDate = new Date(to);\n const unit = options?.unit ?? 'second';\n\n const value = diffInUnit(fromDate, toDate, unit);\n\n return getCachedIntl(\n 'RelativeTimeFormat',\n options?.locale ?? internationalization?.defaultLocale,\n\n options\n ).format(Math.round(value), unit);\n};\n"],"mappings":";;;;;;;;AASA,MAAM,cAAc,MAAY,IAAU,SAAmC;CAE3E,MAAM,OADS,GAAG,QAAQ,IAAI,KAAK,QAAQ,KACtB;CAErB,QAAQ,MAAR;EACE,KAAK,UACH,OAAO;EACT,KAAK,UACH,OAAO,MAAM;EACf,KAAK,QACH,OAAO,MAAM;EACf,KAAK,OACH,OAAO,MAAM;EACf,KAAK,SACH,OAAO,OAAO,KAAK;EACrB,KAAK,WACH,OAAO,OAAO,KAAS;EACzB,KAAK,QACH,OAAO,OAAO,MAAM;EACtB,SACE,OAAO;CACX;AACF;;;;;;;;;;;AAYA,MAAa,gBACX,MACA,qBAA6B,IAAI,KAAK,GACtC,YAIW;CACX,MAAM,WAAW,IAAI,KAAK,IAAI;CAC9B,MAAM,SAAS,IAAI,KAAK,EAAE;CAC1B,MAAM,OAAO,SAAS,QAAQ;CAE9B,MAAM,QAAQ,WAAW,UAAU,QAAQ,IAAI;CAE/C,OAAOA,iCACL,sBACA,SAAS,UAAUC,6CAAsB,eAEzC,OACF,CAAC,CAAC,OAAO,KAAK,MAAM,KAAK,GAAG,IAAI;AAClC"}
@@ -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_utils_intl = require('../utils/intl.cjs');
4
3
  let _intlayer_config_built = require("@intlayer/config/built");
5
4
 
@@ -11,7 +10,7 @@ let _intlayer_config_built = require("@intlayer/config/built");
11
10
  * units(5, { unit: "kilometer", unitDisplay: "long", locale: "en-GB" });
12
11
  * // "5 kilometers"
13
12
  */
14
- const units = (value, options) => require_utils_intl.getCachedIntl(Intl.NumberFormat, options?.locale ?? _intlayer_config_built.internationalization?.defaultLocale, {
13
+ const units = (value, options) => require_utils_intl.getCachedIntl("NumberFormat", options?.locale ?? _intlayer_config_built.internationalization?.defaultLocale, {
15
14
  style: "unit",
16
15
  unit: options?.unit ?? "day",
17
16
  unitDisplay: options?.unitDisplay ?? "short",
@@ -1 +1 @@
1
- {"version":3,"file":"units.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/units.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value as a localized unit string.\n *\n * @example\n * units(5, { unit: \"kilometer\", unitDisplay: \"long\", locale: \"en-GB\" });\n * // \"5 kilometers\"\n */\nexport const units = (\n value: number | string,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n getCachedIntl(\n Intl.NumberFormat,\n options?.locale ?? internationalization?.defaultLocale,\n\n {\n style: 'unit',\n unit: options?.unit ?? 'day',\n unitDisplay: options?.unitDisplay ?? 'short',\n useGrouping: options?.useGrouping ?? false,\n }\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,SACX,OACA,YAEAA,iCACE,KAAK,cACL,SAAS,UAAUC,6CAAsB,eAEzC;CACE,OAAO;CACP,MAAM,SAAS,QAAQ;CACvB,aAAa,SAAS,eAAe;CACrC,aAAa,SAAS,eAAe;CACtC,CACF,CAAC,OAAO,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"units.cjs","names":["getCachedIntl","internationalization"],"sources":["../../../src/formatters/units.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value as a localized unit string.\n *\n * @example\n * units(5, { unit: \"kilometer\", unitDisplay: \"long\", locale: \"en-GB\" });\n * // \"5 kilometers\"\n */\nexport const units = (\n value: number | string,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n getCachedIntl(\n 'NumberFormat',\n options?.locale ?? internationalization?.defaultLocale,\n\n {\n style: 'unit',\n unit: options?.unit ?? 'day',\n unitDisplay: options?.unitDisplay ?? 'short',\n useGrouping: options?.useGrouping ?? false,\n }\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,SACX,OACA,YAEAA,iCACE,gBACA,SAAS,UAAUC,6CAAsB,eAEzC;CACE,OAAO;CACP,MAAM,SAAS,QAAQ;CACvB,aAAa,SAAS,eAAe;CACrC,aAAa,SAAS,eAAe;AACvC,CACF,CAAC,CAAC,OAAO,OAAO,KAAK,CAAC"}
@@ -3,6 +3,7 @@ const require_deepTransformPlugins_getEditedContent = require('./deepTransformPl
3
3
  const require_interpreter_getCondition = require('./interpreter/getCondition.cjs');
4
4
  const require_interpreter_getContent_deepTransform = require('./interpreter/getContent/deepTransform.cjs');
5
5
  const require_interpreter_getEnumeration = require('./interpreter/getEnumeration.cjs');
6
+ const require_interpreter_getInsertion = require('./interpreter/getInsertion.cjs');
6
7
  const require_dictionaryManipulator_qualifiedDictionary = require('./dictionaryManipulator/qualifiedDictionary.cjs');
7
8
  const require_interpreter_getDictionary = require('./interpreter/getDictionary.cjs');
8
9
  const require_interpreter_getIntlayer = require('./interpreter/getIntlayer.cjs');
@@ -18,6 +19,7 @@ const require_formatters_relativeTime = require('./formatters/relativeTime.cjs')
18
19
  const require_formatters_units = require('./formatters/units.cjs');
19
20
  const require_interpreter_getPlural = require('./interpreter/getPlural.cjs');
20
21
  const require_interpreter_getTranslation = require('./interpreter/getTranslation.cjs');
22
+ const require_interpreter_interpolableNode = require('./interpreter/interpolableNode.cjs');
21
23
  const require_interpreter_getContent_plugins = require('./interpreter/getContent/plugins.cjs');
22
24
  const require_interpreter_getContent_getContent = require('./interpreter/getContent/getContent.cjs');
23
25
  const require_interpreter_getHTML = require('./interpreter/getHTML.cjs');
@@ -64,6 +66,7 @@ const require_dictionaryManipulator_updateNodeChildren = require('./dictionaryMa
64
66
  const require_utils_checkIsURLAbsolute = require('./utils/checkIsURLAbsolute.cjs');
65
67
  const require_localization_getPathWithoutLocale = require('./localization/getPathWithoutLocale.cjs');
66
68
  const require_localization_comparePaths = require('./localization/comparePaths.cjs');
69
+ const require_localization_domainUtils = require('./localization/domainUtils.cjs');
67
70
  const require_localization_getPrefix = require('./localization/getPrefix.cjs');
68
71
  const require_localization_rewriteUtils = require('./localization/rewriteUtils.cjs');
69
72
  const require_localization_getLocalizedUrl = require('./localization/getLocalizedUrl.cjs');
@@ -88,6 +91,7 @@ const require_markdown_renderer = require('./markdown/renderer.cjs');
88
91
  const require_markdown_compiler = require('./markdown/compiler.cjs');
89
92
  const require_messageFormat_ICU = require('./messageFormat/ICU.cjs');
90
93
  const require_messageFormat_i18next = require('./messageFormat/i18next.cjs');
94
+ const require_messageFormat_navigatePath = require('./messageFormat/navigatePath.cjs');
91
95
  const require_messageFormat_po = require('./messageFormat/po.cjs');
92
96
  const require_messageFormat_vue_i18n = require('./messageFormat/vue-i18n.cjs');
93
97
  const require_messageFormat_resolveMessage = require('./messageFormat/resolveMessage.cjs');
@@ -225,11 +229,12 @@ exports.getContentNodeByKeyPath = require_dictionaryManipulator_getContentNodeBy
225
229
  exports.getCookie = require_utils_getCookie.getCookie;
226
230
  exports.getDefaultNode = require_dictionaryManipulator_getDefaultNode.getDefaultNode;
227
231
  exports.getDictionary = require_interpreter_getDictionary.getDictionary;
228
- exports.getDictionaryCompositeId = require_dictionaryManipulator_qualifiedDictionary.getDictionaryCompositeId;
229
- exports.getDictionaryQualifierId = require_dictionaryManipulator_qualifiedDictionary.getDictionaryQualifierId;
230
- exports.getDictionaryQualifierSegments = require_dictionaryManipulator_qualifiedDictionary.getDictionaryQualifierSegments;
232
+ exports.getDictionaryCompositeIds = require_dictionaryManipulator_qualifiedDictionary.getDictionaryCompositeIds;
233
+ exports.getDictionaryQualifierIds = require_dictionaryManipulator_qualifiedDictionary.getDictionaryQualifierIds;
231
234
  exports.getDictionaryQualifierTypes = require_dictionaryManipulator_qualifiedDictionary.getDictionaryQualifierTypes;
232
235
  exports.getDictionarySelectorCacheKey = require_dictionaryManipulator_qualifiedDictionary.getDictionarySelectorCacheKey;
236
+ exports.getDomainHostname = require_localization_domainUtils.getDomainHostname;
237
+ exports.getDomainOrigin = require_localization_domainUtils.getDomainOrigin;
233
238
  exports.getEditedContent = require_deepTransformPlugins_getEditedContent.getEditedContent;
234
239
  exports.getEditedDictionary = require_deepTransformPlugins_getEditedContent.getEditedDictionary;
235
240
  exports.getEmptyNode = require_dictionaryManipulator_getEmptyNode.getEmptyNode;
@@ -242,10 +247,13 @@ exports.getFilteredLocalesContent = require_deepTransformPlugins_getFilteredLoca
242
247
  exports.getFilteredLocalesDictionary = require_deepTransformPlugins_getFilteredLocalesContent.getFilteredLocalesDictionary;
243
248
  exports.getHTML = require_interpreter_getHTML.getHTML;
244
249
  exports.getHTMLTextDir = require_localization_getHTMLTextDir.getHTMLTextDir;
250
+ exports.getInsertion = require_interpreter_getInsertion.getInsertion;
245
251
  exports.getInsertionValues = require_transpiler_insertion_getInsertionValues.getInsertionValues;
246
252
  exports.getInternalPath = require_localization_rewriteUtils.getInternalPath;
253
+ exports.getInterpolableContent = require_interpreter_interpolableNode.getInterpolableContent;
247
254
  exports.getIntlayer = require_interpreter_getIntlayer.getIntlayer;
248
255
  exports.getLocale = require_localization_getLocale.getLocale;
256
+ exports.getLocaleFromDomain = require_localization_domainUtils.getLocaleFromDomain;
249
257
  exports.getLocaleFromPath = require_localization_getLocaleFromPath.getLocaleFromPath;
250
258
  exports.getLocaleFromStorage = require_utils_localeStorage.getLocaleFromStorage;
251
259
  exports.getLocaleFromStorageClient = require_utils_localeStorage.getLocaleFromStorageClient;
@@ -274,6 +282,7 @@ exports.getRewriteRules = require_localization_rewriteUtils.getRewriteRules;
274
282
  exports.getSplittedContent = require_deepTransformPlugins_getSplittedContent.getSplittedContent;
275
283
  exports.getSplittedDictionaryContent = require_deepTransformPlugins_getSplittedContent.getSplittedDictionaryContent;
276
284
  exports.getTranslation = require_interpreter_getTranslation.getTranslation;
285
+ exports.getVariantIds = require_dictionaryManipulator_qualifiedDictionary.getVariantIds;
277
286
  exports.html = require_transpiler_html_html.html;
278
287
  exports.i18nextToIntlayerFormatter = require_messageFormat_i18next.i18nextToIntlayerFormatter;
279
288
  exports.icuToIntlayerFormatter = require_messageFormat_ICU.icuToIntlayerFormatter;
@@ -286,6 +295,8 @@ exports.intlayerToI18nextFormatter = require_messageFormat_i18next.intlayerToI18
286
295
  exports.intlayerToICUFormatter = require_messageFormat_ICU.intlayerToICUFormatter;
287
296
  exports.intlayerToPortableObjectFormatter = require_messageFormat_po.intlayerToPortableObjectFormatter;
288
297
  exports.intlayerToVueI18nFormatter = require_messageFormat_vue_i18n.intlayerToVueI18nFormatter;
298
+ exports.isInterpolableWrapperNode = require_interpreter_interpolableNode.isInterpolableWrapperNode;
299
+ exports.isLocaleExclusiveOnDomain = require_localization_domainUtils.isLocaleExclusiveOnDomain;
289
300
  exports.isQualifiedDictionaryGroup = require_dictionaryManipulator_qualifiedDictionary.isQualifiedDictionaryGroup;
290
301
  exports.isQualifiedDynamicLoaderMap = require_dictionaryManipulator_qualifiedDictionary.isQualifiedDynamicLoaderMap;
291
302
  exports.isSameKeyPath = require_utils_isSameKeyPath.isSameKeyPath;
@@ -300,6 +311,7 @@ exports.localeStorageOptions = require_utils_localeStorage.localeStorageOptions;
300
311
  exports.md = require_transpiler_markdown_markdown.md;
301
312
  exports.mergeDictionaries = require_dictionaryManipulator_mergeDictionaries.mergeDictionaries;
302
313
  exports.mergeQualifiedDictionaries = require_dictionaryManipulator_mergeQualifiedDictionaries.mergeQualifiedDictionaries;
314
+ exports.navigatePath = require_messageFormat_navigatePath.navigatePath;
303
315
  exports.nest = require_transpiler_nesting_nesting.nest;
304
316
  exports.nestedPlugin = require_interpreter_getContent_plugins.nestedPlugin;
305
317
  exports.normalizeAttributeKey = require_markdown_utils.normalizeAttributeKey;
@@ -329,6 +341,7 @@ exports.pluralPlugin = require_interpreter_getContent_plugins.pluralPlugin;
329
341
  exports.portableObjectToIntlayerFormatter = require_messageFormat_po.portableObjectToIntlayerFormatter;
330
342
  exports.presets = require_formatters_date.presets;
331
343
  exports.qualifies = require_markdown_utils.qualifies;
344
+ exports.rebuildInterpolableContent = require_interpreter_interpolableNode.rebuildInterpolableContent;
332
345
  exports.reconstructQualifiedEntry = require_dictionaryManipulator_qualifiedDictionary.reconstructQualifiedEntry;
333
346
  exports.relativeTime = require_formatters_relativeTime.relativeTime;
334
347
  exports.removeContentNodeByKeyPath = require_dictionaryManipulator_removeContentNodeByKeyPath.removeContentNodeByKeyPath;
@@ -353,6 +366,7 @@ exports.splitInsertionTemplate = require_interpreter_splitAndJoinInsertion.split
353
366
  exports.startsWith = require_markdown_utils.startsWith;
354
367
  exports.stringifyYaml = require_utils_stringifyYaml.stringifyYaml;
355
368
  exports.t = require_transpiler_translation_translation.t;
369
+ exports.transformInterpolableNode = require_interpreter_interpolableNode.transformInterpolableNode;
356
370
  exports.translationPlugin = require_interpreter_getContent_plugins.translationPlugin;
357
371
  exports.trimEnd = require_markdown_utils.trimEnd;
358
372
  exports.trimLeadingWhitespaceOutsideFences = require_markdown_utils.trimLeadingWhitespaceOutsideFences;
@@ -1 +1 @@
1
- {"version":3,"file":"getCondition.cjs","names":[],"sources":["../../../src/interpreter/getCondition.ts"],"sourcesContent":["import type { ConditionContentStates } from '../transpiler';\n\n/**\n * Picks content based on a boolean condition.\n *\n * @param conditionContent - A map with 'true', 'false', and optionally 'fallback' keys.\n * @param state - The boolean state to match.\n * @returns The matching content.\n *\n * @example\n * ```ts\n * const content = getCondition({\n * 'true': 'The condition is validated',\n * 'false': 'The condition is not validated',\n * }, true);\n * // 'The condition is validated'\n * ```\n */\nexport const getCondition = <const Content>(\n conditionContent: ConditionContentStates<Content>,\n state?: boolean\n): Content => {\n const stateList = Object.keys(conditionContent);\n const fallbackState = stateList[\n stateList.length - 1\n ] as keyof typeof conditionContent;\n\n // Default or error handling if no keys match\n return (\n conditionContent[`${state}` as keyof typeof conditionContent] ??\n conditionContent.fallback ??\n (conditionContent[fallbackState] as Content)\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,MAAa,gBACX,kBACA,UACY;CACZ,MAAM,YAAY,OAAO,KAAK,iBAAiB;CAC/C,MAAM,gBAAgB,UACpB,UAAU,SAAS;AAIrB,QACE,iBAAiB,GAAG,YACpB,iBAAiB,YAChB,iBAAiB"}
1
+ {"version":3,"file":"getCondition.cjs","names":[],"sources":["../../../src/interpreter/getCondition.ts"],"sourcesContent":["import type { ConditionContentStates } from '../transpiler';\n\n/**\n * Picks content based on a boolean condition.\n *\n * @param conditionContent - A map with 'true', 'false', and optionally 'fallback' keys.\n * @param state - The boolean state to match.\n * @returns The matching content.\n *\n * @example\n * ```ts\n * const content = getCondition({\n * 'true': 'The condition is validated',\n * 'false': 'The condition is not validated',\n * }, true);\n * // 'The condition is validated'\n * ```\n */\nexport const getCondition = <const Content>(\n conditionContent: ConditionContentStates<Content>,\n state?: boolean\n): Content => {\n const stateList = Object.keys(conditionContent);\n const fallbackState = stateList[\n stateList.length - 1\n ] as keyof typeof conditionContent;\n\n // Default or error handling if no keys match\n return (\n conditionContent[`${state}` as keyof typeof conditionContent] ??\n conditionContent.fallback ??\n (conditionContent[fallbackState] as Content)\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,MAAa,gBACX,kBACA,UACY;CACZ,MAAM,YAAY,OAAO,KAAK,gBAAgB;CAC9C,MAAM,gBAAgB,UACpB,UAAU,SAAS;CAIrB,OACE,iBAAiB,GAAG,YACpB,iBAAiB,YAChB,iBAAiB;AAEtB"}
@@ -14,14 +14,15 @@ const deepTransformNode = (node, props) => {
14
14
  if (node === null || typeof node !== "object") return node;
15
15
  if (node.$$typeof !== void 0 || node.__v_isVNode !== void 0 || node._isVNode !== void 0 || node.isJSX !== void 0 || typeof node === "function") return node;
16
16
  if (Array.isArray(node)) return node.map((child, index) => {
17
- return deepTransformNode(child, {
17
+ const childProps = {
18
18
  ...props,
19
19
  children: child,
20
20
  keyPath: [...props.keyPath, {
21
21
  type: _intlayer_types_nodeType.ARRAY,
22
22
  key: index
23
23
  }]
24
- });
24
+ };
25
+ return deepTransformNode(child, childProps);
25
26
  });
26
27
  const result = {};
27
28
  for (const key in node) {
@@ -1 +1 @@
1
- {"version":3,"file":"deepTransform.cjs","names":["NodeTypes"],"sources":["../../../../src/interpreter/getContent/deepTransform.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/types/keyPath';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport type { NodeProps } from './plugins';\n\n/**\n * Recursively traverses a node (object/array/primitive).\n * Applies the *first* plugin that can transform a node, then stops descending further.\n * If no plugin transforms it, it recurses into its children.\n */\nexport const deepTransformNode = (node: any, props: NodeProps): any => {\n // Otherwise, if it's an object, check if any plugin can handle it:\n for (const plugin of props.plugins ?? []) {\n if (plugin.canHandle(node)) {\n // Return the transformed node => do NOT recurse further\n return plugin.transform(node, props, (node: any, props: any) =>\n deepTransformNode(node, props)\n );\n }\n }\n\n // If it's null/undefined or not an object, just return it directly:\n if (node === null || typeof node !== 'object') {\n return node;\n }\n\n // If it's a framework-specific virtual node or already a transformed Proxy,\n // return it directly to avoid re-transforming its internal properties.\n if (\n (node as any).$$typeof !== undefined ||\n (node as any).__v_isVNode !== undefined ||\n (node as any)._isVNode !== undefined ||\n (node as any).isJSX !== undefined ||\n typeof node === 'function' // Proxies for html/markdown are functions\n ) {\n return node;\n }\n\n // If it's an array, transform each element:\n if (Array.isArray(node)) {\n return node.map((child, index) => {\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.ARRAY, key: index } as KeyPath,\n ],\n };\n return deepTransformNode(child, childProps);\n });\n }\n\n // If no plugin transforms it, we keep traversing its properties.\n const result: Record<string, any> = {};\n for (const key in node) {\n const childProps = {\n ...props,\n children: node[key],\n keyPath: [...props.keyPath, { type: NodeTypes.OBJECT, key } as KeyPath],\n };\n\n if (props.eager) {\n // Eager mode: recurse immediately so plugins fire on every node, even\n // when the caller discards the returned tree (e.g. side-effect-only\n // plugins like missing-locale detection).\n result[key] = deepTransformNode(node[key], childProps);\n continue;\n }\n\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: function () {\n const transformed = deepTransformNode(node[key], childProps);\n\n // Memoize the result onto the property to avoid re-calculating on next read\n Object.defineProperty(this, key, {\n value: transformed,\n enumerable: true,\n configurable: true,\n });\n return transformed;\n },\n });\n }\n\n return result;\n};\n"],"mappings":";;;;;;;;;;;AASA,MAAa,qBAAqB,MAAW,UAA0B;AAErE,MAAK,MAAM,UAAU,MAAM,WAAW,EAAE,CACtC,KAAI,OAAO,UAAU,KAAK,CAExB,QAAO,OAAO,UAAU,MAAM,QAAQ,MAAW,UAC/C,kBAAkB,MAAM,MAAM,CAC/B;AAKL,KAAI,SAAS,QAAQ,OAAO,SAAS,SACnC,QAAO;AAKT,KACG,KAAa,aAAa,UAC1B,KAAa,gBAAgB,UAC7B,KAAa,aAAa,UAC1B,KAAa,UAAU,UACxB,OAAO,SAAS,WAEhB,QAAO;AAIT,KAAI,MAAM,QAAQ,KAAK,CACrB,QAAO,KAAK,KAAK,OAAO,UAAU;AAShC,SAAO,kBAAkB,OAAO;GAP9B,GAAG;GACH,UAAU;GACV,SAAS,CACP,GAAG,MAAM,SACT;IAAE,MAAMA,yBAAU;IAAO,KAAK;IAAO,CACtC;GAEuC,CAAC;GAC3C;CAIJ,MAAM,SAA8B,EAAE;AACtC,MAAK,MAAM,OAAO,MAAM;EACtB,MAAM,aAAa;GACjB,GAAG;GACH,UAAU,KAAK;GACf,SAAS,CAAC,GAAG,MAAM,SAAS;IAAE,MAAMA,yBAAU;IAAQ;IAAK,CAAY;GACxE;AAED,MAAI,MAAM,OAAO;AAIf,UAAO,OAAO,kBAAkB,KAAK,MAAM,WAAW;AACtD;;AAGF,SAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,KAAK,WAAY;IACf,MAAM,cAAc,kBAAkB,KAAK,MAAM,WAAW;AAG5D,WAAO,eAAe,MAAM,KAAK;KAC/B,OAAO;KACP,YAAY;KACZ,cAAc;KACf,CAAC;AACF,WAAO;;GAEV,CAAC;;AAGJ,QAAO"}
1
+ {"version":3,"file":"deepTransform.cjs","names":["NodeTypes"],"sources":["../../../../src/interpreter/getContent/deepTransform.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/types/keyPath';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport type { NodeProps } from './plugins';\n\n/**\n * Recursively traverses a node (object/array/primitive).\n * Applies the *first* plugin that can transform a node, then stops descending further.\n * If no plugin transforms it, it recurses into its children.\n */\nexport const deepTransformNode = (node: any, props: NodeProps): any => {\n // Otherwise, if it's an object, check if any plugin can handle it:\n for (const plugin of props.plugins ?? []) {\n if (plugin.canHandle(node)) {\n // Return the transformed node => do NOT recurse further\n return plugin.transform(node, props, (node: any, props: any) =>\n deepTransformNode(node, props)\n );\n }\n }\n\n // If it's null/undefined or not an object, just return it directly:\n if (node === null || typeof node !== 'object') {\n return node;\n }\n\n // If it's a framework-specific virtual node or already a transformed Proxy,\n // return it directly to avoid re-transforming its internal properties.\n if (\n (node as any).$$typeof !== undefined ||\n (node as any).__v_isVNode !== undefined ||\n (node as any)._isVNode !== undefined ||\n (node as any).isJSX !== undefined ||\n typeof node === 'function' // Proxies for html/markdown are functions\n ) {\n return node;\n }\n\n // If it's an array, transform each element:\n if (Array.isArray(node)) {\n return node.map((child, index) => {\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.ARRAY, key: index } as KeyPath,\n ],\n };\n return deepTransformNode(child, childProps);\n });\n }\n\n // If no plugin transforms it, we keep traversing its properties.\n const result: Record<string, any> = {};\n for (const key in node) {\n const childProps = {\n ...props,\n children: node[key],\n keyPath: [...props.keyPath, { type: NodeTypes.OBJECT, key } as KeyPath],\n };\n\n if (props.eager) {\n // Eager mode: recurse immediately so plugins fire on every node, even\n // when the caller discards the returned tree (e.g. side-effect-only\n // plugins like missing-locale detection).\n result[key] = deepTransformNode(node[key], childProps);\n continue;\n }\n\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: function () {\n const transformed = deepTransformNode(node[key], childProps);\n\n // Memoize the result onto the property to avoid re-calculating on next read\n Object.defineProperty(this, key, {\n value: transformed,\n enumerable: true,\n configurable: true,\n });\n return transformed;\n },\n });\n }\n\n return result;\n};\n"],"mappings":";;;;;;;;;;;AASA,MAAa,qBAAqB,MAAW,UAA0B;CAErE,KAAK,MAAM,UAAU,MAAM,WAAW,CAAC,GACrC,IAAI,OAAO,UAAU,IAAI,GAEvB,OAAO,OAAO,UAAU,MAAM,QAAQ,MAAW,UAC/C,kBAAkB,MAAM,KAAK,CAC/B;CAKJ,IAAI,SAAS,QAAQ,OAAO,SAAS,UACnC,OAAO;CAKT,IACG,KAAa,aAAa,UAC1B,KAAa,gBAAgB,UAC7B,KAAa,aAAa,UAC1B,KAAa,UAAU,UACxB,OAAO,SAAS,YAEhB,OAAO;CAIT,IAAI,MAAM,QAAQ,IAAI,GACpB,OAAO,KAAK,KAAK,OAAO,UAAU;EAChC,MAAM,aAAa;GACjB,GAAG;GACH,UAAU;GACV,SAAS,CACP,GAAG,MAAM,SACT;IAAE,MAAMA,yBAAU;IAAO,KAAK;GAAM,CACtC;EACF;EACA,OAAO,kBAAkB,OAAO,UAAU;CAC5C,CAAC;CAIH,MAAM,SAA8B,CAAC;CACrC,KAAK,MAAM,OAAO,MAAM;EACtB,MAAM,aAAa;GACjB,GAAG;GACH,UAAU,KAAK;GACf,SAAS,CAAC,GAAG,MAAM,SAAS;IAAE,MAAMA,yBAAU;IAAQ;GAAI,CAAY;EACxE;EAEA,IAAI,MAAM,OAAO;GAIf,OAAO,OAAO,kBAAkB,KAAK,MAAM,UAAU;GACrD;EACF;EAEA,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,KAAK,WAAY;IACf,MAAM,cAAc,kBAAkB,KAAK,MAAM,UAAU;IAG3D,OAAO,eAAe,MAAM,KAAK;KAC/B,OAAO;KACP,YAAY;KACZ,cAAc;IAChB,CAAC;IACD,OAAO;GACT;EACF,CAAC;CACH;CAEA,OAAO;AACT"}
@@ -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_interpreter_getContent_deepTransform = require('./deepTransform.cjs');
4
3
  const require_interpreter_getContent_plugins = require('./plugins.cjs');
5
4
  let _intlayer_config_built = require("@intlayer/config/built");
@@ -1 +1 @@
1
- {"version":3,"file":"getContent.cjs","names":["translationPlugin","internationalization","enumerationPlugin","conditionPlugin","insertionPlugin","nestedPlugin","filePlugin","genderPlugin","deepTransformNode"],"sources":["../../../../src/interpreter/getContent/getContent.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { ContentNode } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { deepTransformNode } from './deepTransform';\nimport {\n conditionPlugin,\n type DeepTransformContent,\n enumerationPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState,\n insertionPlugin,\n type NodeProps,\n nestedPlugin,\n type Plugins,\n translationPlugin,\n} from './plugins';\n\nexport const getBasePlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] =>\n [\n translationPlugin(\n locale ?? internationalization.defaultLocale,\n fallback ? internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n conditionPlugin,\n insertionPlugin,\n nestedPlugin(locale ?? internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n ] as Plugins[];\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getContent = <\n const T extends ContentNode,\n const L extends LocalesValues = DeclaredLocales,\n>(\n node: T,\n nodeProps: NodeProps,\n plugins: Plugins[] = []\n) =>\n deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T, IInterpreterPluginState, L>;\n"],"mappings":";;;;;;;AAqBA,MAAa,kBACX,QACA,WAAoB,SAEpB;CACEA,yDACE,UAAUC,4CAAqB,eAC/B,WAAWA,4CAAqB,gBAAgB,OACjD;CACDC;CACAC;CACAC;CACAC,oDAAa,UAAUJ,4CAAqB,cAAc;CAC1DK;CACAC;CACD;;;;;;;AAQH,MAAa,cAIX,MACA,WACA,UAAqB,EAAE,KAEvBC,+DAAkB,MAAM;CACtB,GAAG;CACH;CACD,CAAC"}
1
+ {"version":3,"file":"getContent.cjs","names":["translationPlugin","internationalization","enumerationPlugin","conditionPlugin","insertionPlugin","nestedPlugin","filePlugin","genderPlugin","deepTransformNode"],"sources":["../../../../src/interpreter/getContent/getContent.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { ContentNode } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { deepTransformNode } from './deepTransform';\nimport {\n conditionPlugin,\n type DeepTransformContent,\n enumerationPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState,\n insertionPlugin,\n type NodeProps,\n nestedPlugin,\n type Plugins,\n translationPlugin,\n} from './plugins';\n\nexport const getBasePlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] =>\n [\n translationPlugin(\n locale ?? internationalization.defaultLocale,\n fallback ? internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n conditionPlugin,\n insertionPlugin,\n nestedPlugin(locale ?? internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n ] as Plugins[];\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getContent = <\n const T extends ContentNode,\n const L extends LocalesValues = DeclaredLocales,\n>(\n node: T,\n nodeProps: NodeProps,\n plugins: Plugins[] = []\n) =>\n deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T, IInterpreterPluginState, L>;\n"],"mappings":";;;;;;AAqBA,MAAa,kBACX,QACA,WAAoB,SAEpB;CACEA,yDACE,UAAUC,4CAAqB,eAC/B,WAAWA,4CAAqB,gBAAgB,MAClD;CACAC;CACAC;CACAC;CACAC,oDAAa,UAAUJ,4CAAqB,aAAa;CACzDK;CACAC;AACF;;;;;;;AAQF,MAAa,cAIX,MACA,WACA,UAAqB,CAAC,MAEtBC,+DAAkB,MAAM;CACtB,GAAG;CACH;AACF,CAAC"}
@@ -7,6 +7,7 @@ const require_interpreter_getInsertion = require('../getInsertion.cjs');
7
7
  const require_interpreter_getNesting = require('../getNesting.cjs');
8
8
  const require_interpreter_getPlural = require('../getPlural.cjs');
9
9
  const require_interpreter_getTranslation = require('../getTranslation.cjs');
10
+ const require_interpreter_interpolableNode = require('../interpolableNode.cjs');
10
11
  let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
11
12
  _intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
12
13
 
@@ -61,7 +62,8 @@ const enumerationPlugin = process.env.INTLAYER_NODE_TYPE_ENUMERATION === "false"
61
62
  });
62
63
  }
63
64
  return (arg) => {
64
- const subResult = require_interpreter_getEnumeration.getEnumeration(result, typeof arg === "number" ? arg : arg.count);
65
+ const quantity = typeof arg === "number" ? arg : arg.count;
66
+ const subResult = require_interpreter_getEnumeration.getEnumeration(result, quantity);
65
67
  if (typeof subResult === "function" && typeof arg === "object") return subResult(arg);
66
68
  return subResult;
67
69
  };
@@ -81,8 +83,9 @@ const pluralPlugin = (locale) => process.env.INTLAYER_NODE_TYPE_PLURAL === "fals
81
83
  /** String plugin for plural. Replaces string node with a component that renders the insertion. */
82
84
  const pluralStringPlugin = {
83
85
  id: "plural-string-plugin",
84
- canHandle: (node) => typeof node === "string",
86
+ canHandle: (node) => typeof node === "string" || require_interpreter_interpolableNode.isInterpolableWrapperNode(node),
85
87
  transform: (node, subProps, deepTransformNode) => {
88
+ if (require_interpreter_interpolableNode.isInterpolableWrapperNode(node)) return (values) => require_interpreter_interpolableNode.transformInterpolableNode(node, values, subProps, props.plugins, deepTransformNode);
86
89
  const transformedResult = deepTransformNode(node, {
87
90
  ...subProps,
88
91
  children: node,
@@ -139,7 +142,8 @@ const conditionPlugin = process.env.INTLAYER_NODE_TYPE_CONDITION === "false" ? f
139
142
  });
140
143
  }
141
144
  return (arg) => {
142
- const subResult = require_interpreter_getCondition.getCondition(result, typeof arg === "boolean" ? arg : arg.value);
145
+ const value = typeof arg === "boolean" ? arg : arg.value;
146
+ const subResult = require_interpreter_getCondition.getCondition(result, value);
143
147
  if (typeof subResult === "function" && typeof arg === "object") return subResult(arg);
144
148
  return subResult;
145
149
  };
@@ -155,8 +159,9 @@ const insertionPlugin = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? f
155
159
  /** Insertion string plugin. Replaces string node with a component that render the insertion. */
156
160
  const insertionStringPlugin = {
157
161
  id: "insertion-string-plugin",
158
- canHandle: (node) => typeof node === "string",
162
+ canHandle: (node) => typeof node === "string" || require_interpreter_interpolableNode.isInterpolableWrapperNode(node),
159
163
  transform: (node, subProps, deepTransformNode) => {
164
+ if (require_interpreter_interpolableNode.isInterpolableWrapperNode(node)) return (values) => require_interpreter_interpolableNode.transformInterpolableNode(node, values, subProps, props.plugins, deepTransformNode);
160
165
  const transformedResult = deepTransformNode(node, {
161
166
  ...subProps,
162
167
  children: node,
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.cjs","names":["NodeTypes","getTranslation","getEnumeration","getInsertion","getPlural","getCondition","getGender","getNesting"],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type { NodeType } from '@intlayer/types/nodeType';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport type {\n ConditionContent,\n EnumerationContent,\n FileContent,\n Gender,\n GenderContent,\n InsertionContent,\n NestedContent,\n PluralContent,\n PluralContentState,\n TranslationContent,\n} from '../../transpiler';\nimport { getCondition } from '../getCondition';\nimport { getEnumeration } from '../getEnumeration';\nimport { getGender } from '../getGender';\nimport { getInsertion } from '../getInsertion';\nimport { type GetNestingResult, getNesting } from '../getNesting';\nimport { getPlural } from '../getPlural';\nimport { getTranslation } from '../getTranslation';\n\n// ── Tree-shake constants ──────────────────────────────────────────────────────\n// When these env vars are injected at build time, bundlers eliminate the\n// branches guarded by these constants.\n\n/** ---------------------------------------------\n * PLUGIN DEFINITION\n * --------------------------------------------- */\n\n/**\n * A plugin/transformer that can optionally transform a node during a single DFS pass.\n * - `canHandle` decides if the node is transformable by this plugin.\n * - `transform` returns the transformed node (and does not recurse further).\n *\n * > `transformFn` is a function that can be used to deeply transform inside the plugin.\n */\nexport type Plugins = {\n id: string;\n canHandle: (node: any) => boolean;\n transform: (\n node: any,\n props: NodeProps,\n transformFn: (node: any, props: NodeProps) => any\n ) => any;\n};\n\n/** ---------------------------------------------\n * FALLBACK PLUGIN\n *\n * Used to fallback a tree-shaken plugin\n * --------------------------------------------- */\n\nexport const fallbackPlugin: Plugins = {\n id: 'fallback-plugin',\n canHandle: () => false,\n transform: (node) => node,\n};\n\n/** ---------------------------------------------\n * TRANSLATION PLUGIN\n * --------------------------------------------- */\n\nexport type UnionKeys<T> = T extends unknown ? keyof T : never;\nexport type ValueAtKey<T, K> = T extends unknown\n ? K extends keyof T\n ? T[K]\n : never\n : never;\n\nexport type TranslationCond<T, S, L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.TRANSLATION]: infer U;\n}\n ? U extends Record<PropertyKey, unknown>\n ? U[keyof U] extends Record<PropertyKey, unknown>\n ? {\n [K in UnionKeys<U[keyof U]>]: L extends keyof U\n ? K extends keyof U[L]\n ? U[L][K]\n : ValueAtKey<U[keyof U], K>\n : ValueAtKey<U[keyof U], K>;\n } extends infer Content\n ? DeepTransformContent<Content, S>\n : never\n : (L extends keyof U ? U[L] : U[keyof U]) extends infer Content\n ? DeepTransformContent<Content, S>\n : never\n : never\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const translationPlugin = (\n locale: LocalesValues,\n fallback?: LocalesValues\n): Plugins =>\n process.env.INTLAYER_NODE_TYPE_TRANSLATION === 'false'\n ? fallbackPlugin\n : {\n id: 'translation-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.TRANSLATION,\n transform: (node: TranslationContent, props, deepTransformNode) => {\n const original = node[NodeTypes.TRANSLATION] ?? {};\n const result: Record<string, any> = {};\n\n for (const key in original) {\n const childProps = {\n ...props,\n children: original[key as keyof typeof original],\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.TRANSLATION, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(\n original[key as keyof typeof original],\n childProps\n );\n }\n\n return getTranslation(result, locale, fallback);\n },\n };\n\n/** ---------------------------------------------\n * ENUMERATION PLUGIN\n * --------------------------------------------- */\n\nexport type EnumerationCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.ENUMERATION]: object;\n}\n ? (\n quantity: number\n ) => DeepTransformContent<\n T[typeof NodeTypes.ENUMERATION][keyof T[typeof NodeTypes.ENUMERATION]],\n S\n >\n : never;\n\n/** Enumeration plugin. Replaces node with a function that takes quantity => string. */\nexport const enumerationPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_ENUMERATION === 'false'\n ? fallbackPlugin\n : {\n id: 'enumeration-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.ENUMERATION,\n transform: (node: EnumerationContent, props, deepTransformNode) => {\n const original = node[NodeTypes.ENUMERATION];\n const result: Record<string, any> = {};\n\n for (const key in original) {\n const child = original[key as unknown as keyof typeof original];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.ENUMERATION, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(child, childProps);\n }\n\n return (arg: number | { count: number }) => {\n const quantity = typeof arg === 'number' ? arg : arg.count;\n const subResult = getEnumeration(result, quantity);\n\n if (typeof subResult === 'function' && typeof arg === 'object') {\n return subResult(arg);\n }\n\n return subResult;\n };\n },\n };\n\n/** ---------------------------------------------\n * PLURAL PLUGIN\n * --------------------------------------------- */\n\nexport type PluralCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.PLURAL]: object;\n}\n ? (\n arg: number | { count: number; [key: string]: unknown }\n ) => DeepTransformContent<\n T[typeof NodeTypes.PLURAL][keyof T[typeof NodeTypes.PLURAL]],\n S\n >\n : never;\n\ntype SubResultFunction = (values: Record<string, string | number>) => string;\n\n/**\n * Plural plugin. Replaces node with a function that takes a count (or\n * `{ count, ...values }`) => string, picking the matching CLDR plural form\n * for the active locale and interpolating `{{count}}` (and other values).\n */\nexport const pluralPlugin = (locale?: LocalesValues): Plugins =>\n process.env.INTLAYER_NODE_TYPE_PLURAL === 'false'\n ? fallbackPlugin\n : {\n id: 'plural-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.PLURAL,\n transform: (node: PluralContent, props, deepTransformNode) => {\n const original = node[NodeTypes.PLURAL];\n const result: Record<string, any> = {};\n\n /** String plugin for plural. Replaces string node with a component that renders the insertion. */\n const pluralStringPlugin: Plugins = {\n id: 'plural-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, subProps, deepTransformNode) => {\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (values: { [k: string]: string | number }) => {\n const children = getInsertion(transformedResult, values);\n\n return deepTransformNode(children, {\n ...subProps,\n plugins: props.plugins,\n children,\n });\n };\n },\n };\n\n for (const key in original) {\n const child = original[key as keyof typeof original];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.PLURAL, key } as KeyPath,\n ],\n plugins: [pluralStringPlugin, ...(props.plugins ?? [])],\n };\n result[key] = deepTransformNode(child, childProps);\n }\n\n const effectiveLocale = String(locale ?? props.locale ?? 'en');\n\n return (arg: number | { count: number; [key: string]: unknown }) => {\n const count = typeof arg === 'number' ? arg : arg.count;\n const values =\n typeof arg === 'number'\n ? { count: arg }\n : (arg as { count: number; [key: string]: unknown });\n\n const subResult: string | SubResultFunction = getPlural(\n result as PluralContent['plural'] as PluralContentState<string>,\n count,\n effectiveLocale\n );\n\n if (typeof subResult === 'function') {\n return (subResult as SubResultFunction)(values);\n }\n\n return subResult;\n };\n },\n };\n\n/** ---------------------------------------------\n * CONDITION PLUGIN\n * --------------------------------------------- */\n\nexport type ConditionCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.CONDITION]: object;\n}\n ? (\n value: boolean | { value: boolean }\n ) => DeepTransformContent<\n T[typeof NodeTypes.CONDITION][keyof T[typeof NodeTypes.CONDITION]],\n S\n >\n : never;\n\n/** Condition plugin. Replaces node with a function that takes boolean => string. */\nexport const conditionPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_CONDITION === 'false'\n ? fallbackPlugin\n : {\n id: 'condition-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.CONDITION,\n transform: (node: ConditionContent, props, deepTransformNode) => {\n const original = node[NodeTypes.CONDITION];\n const result: Record<string, any> = {};\n\n for (const key in original) {\n const child = original[key as keyof typeof original];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.CONDITION, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(child, childProps);\n }\n\n return (arg: boolean | { value: boolean }) => {\n const value = typeof arg === 'boolean' ? arg : arg.value;\n const subResult = getCondition(result as any, value);\n\n if (typeof subResult === 'function' && typeof arg === 'object') {\n return subResult(arg);\n }\n\n return subResult;\n };\n },\n };\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\nexport type InsertionCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.INSERTION]: infer I;\n fields: readonly string[];\n}\n ? (\n values: {\n [K in T['fields'][number]]: string | number;\n }\n ) => I extends string\n ? DeepTransformContent<string, S>\n : DeepTransformContent<I, S>\n : never;\n\n/** Insertion plugin. Replaces node with a function that takes quantity => string. */\nexport const insertionPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_INSERTION === 'false'\n ? fallbackPlugin\n : {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.INSERTION,\n transform: (node: InsertionContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.INSERTION,\n },\n ];\n\n const children = node[NodeTypes.INSERTION];\n\n /** Insertion string plugin. Replaces string node with a component that render the insertion. */\n const insertionStringPlugin: Plugins = {\n id: 'insertion-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, subProps, deepTransformNode) => {\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (\n values: {\n [K in InsertionContent['fields'][number]]: string | number;\n }\n ) => {\n const children = getInsertion(transformedResult, values);\n\n return deepTransformNode(children, {\n ...subProps,\n plugins: props.plugins,\n children,\n });\n };\n },\n };\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [insertionStringPlugin, ...(props.plugins ?? [])],\n });\n },\n };\n\n/** ---------------------------------------------\n * GENDER PLUGIN\n * --------------------------------------------- */\n\nexport type GenderCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.GENDER]: object;\n}\n ? (\n value: Gender\n ) => DeepTransformContent<\n T[typeof NodeTypes.GENDER][keyof T[typeof NodeTypes.GENDER]],\n S\n >\n : never;\n\n/** Gender plugin. Replaces node with a function that takes gender => string. */\nexport const genderPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_GENDER === 'false'\n ? fallbackPlugin\n : {\n id: 'gender-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.GENDER,\n transform: (node: GenderContent, props, deepTransformNode) => {\n const original = node[NodeTypes.GENDER];\n const result: Record<string, any> = {};\n\n for (const key in original) {\n const child = original[key as keyof typeof original];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.GENDER, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(child, childProps);\n }\n\n return (value: Gender) => getGender(result as any, value);\n },\n };\n\n/** ---------------------------------------------\n * NESTED PLUGIN\n * --------------------------------------------- */\n\nexport type NestedCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.NESTED]: infer U;\n}\n ? U extends {\n dictionaryKey: infer K extends DictionaryKeys;\n path?: infer P;\n }\n ? GetNestingResult<K, P, S>\n : never\n : never;\n\n/** Nested plugin. Replaces node with the result of `getNesting`. */\nexport const nestedPlugin = (locale?: LocalesValues): Plugins =>\n process.env.INTLAYER_NODE_TYPE_NESTED === 'false'\n ? fallbackPlugin\n : {\n id: 'nested-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n (node?.nodeType === NodeTypes.NESTED || node?.nodeType === 'n'),\n transform: (node: NestedContent, props) =>\n getNesting(\n node[NodeTypes.NESTED].dictionaryKey,\n node[NodeTypes.NESTED].path,\n {\n ...props,\n locale: (locale ?? props.locale) as Locale,\n }\n ),\n };\n\n/** ---------------------------------------------\n * FILE PLUGIN\n * --------------------------------------------- */\n\nexport type FileCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.FILE]: string;\n content?: string;\n}\n ? DeepTransformContent<string, S>\n : never;\n\n/** File plugin. Replaces node with the result of `getNesting`. */\nexport const filePlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_FILE === 'false'\n ? fallbackPlugin\n : {\n id: 'file-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.FILE,\n transform: (node: FileContent, props, deepTransform) =>\n deepTransform(node.content, {\n ...props,\n children: node.content,\n }),\n };\n\n/**\n * PLUGIN RESULT\n */\n\n/**\n * Interface that defines the properties of a node.\n * This interface can be augmented in other packages, such as `react-intlayer`.\n */\nexport interface NodeProps {\n dictionaryKey: string;\n keyPath: KeyPath[];\n plugins?: Plugins[];\n locale?: Locale;\n dictionaryPath?: string;\n children?: any;\n /**\n * Forces eager traversal of plain objects in `deepTransformNode`. By default\n * traversal is lazy (property getters), so callers that discard the returned\n * value never trigger plugins on nested nodes. Set this when running plugins\n * for their side effects only (e.g. missing-locale detection).\n */\n eager?: boolean;\n}\n\n/**\n * Interface that defines the plugins that can be used to transform a node.\n * This interface can be augmented in other packages, such as `react-intlayer`.\n */\nexport interface IInterpreterPlugin<T, S, L extends LocalesValues> {\n translation: TranslationCond<T, S, L>;\n enumeration: EnumerationCond<T, S, L>;\n plural: PluralCond<T, S, L>;\n condition: ConditionCond<T, S, L>;\n insertion: InsertionCond<T, S, L>;\n gender: GenderCond<T, S, L>;\n nested: NestedCond<T, S, L>;\n file: FileCond<T, S, L>;\n}\n\n/**\n * Allow to avoid overwriting import from `intlayer` package when `IInterpreterPlugin<T>` interface is augmented in another package, such as `react-intlayer`.\n */\nexport type IInterpreterPluginState = {\n translation: true;\n enumeration: true;\n plural: true;\n condition: true;\n insertion: true;\n gender: true;\n nested: true;\n file: true;\n};\n\n/**\n * Utility type to check if a plugin can be applied to a node.\n */\ntype CheckApplyPlugin<\n T,\n K extends keyof IInterpreterPlugin<T, S, L>,\n S,\n L extends LocalesValues = DeclaredLocales,\n> = K extends keyof S // Test if the key is a key of S.\n ? // Test if the key of S is true. Then the plugin can be applied.\n S[K] extends true\n ? // Test if the key of S exist\n IInterpreterPlugin<T, S, L>[K] extends never\n ? never\n : // Test if the plugin condition is true (if it's not, the plugin is skipped for this node)\n IInterpreterPlugin<T, S, L>[K]\n : never\n : never;\n\n/**\n * Traverse recursively through an object or array, applying each plugin as needed.\n */\ntype Traverse<T, S, L extends LocalesValues = DeclaredLocales> =\n T extends ReadonlyArray<infer U> // Turn any read-only array into a plain mutable array\n ? Array<DeepTransformContent<U, S, L>>\n : T extends object\n ? { [K in keyof T]: DeepTransformContent<T[K], S, L> }\n : T;\n\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\n\n/**\n * Traverse recursively through an object or array, applying each plugin as needed.\n */\nexport type DeepTransformContent<\n T,\n S = IInterpreterPluginState,\n L extends LocalesValues = DeclaredLocales,\n> =\n IsAny<T> extends true\n ? T\n : CheckApplyPlugin<T, keyof IInterpreterPlugin<T, S, L>, S, L> extends never // Check if there is a plugin for T:\n ? // No plugin was found, so try to transform T recursively:\n Traverse<T, S, L>\n : // A plugin was found – use the plugin's transformation.\n CheckApplyPlugin<T, keyof IInterpreterPlugin<T, S, L>, S, L>;\n"],"mappings":"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"}
1
+ {"version":3,"file":"plugins.cjs","names":["NodeTypes","getTranslation","getEnumeration","isInterpolableWrapperNode","transformInterpolableNode","getInsertion","getPlural","getCondition","getGender","getNesting"],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type { NodeType } from '@intlayer/types/nodeType';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport type {\n ConditionContent,\n EnumerationContent,\n FileContent,\n Gender,\n GenderContent,\n InsertionContent,\n NestedContent,\n PluralContent,\n PluralContentState,\n TranslationContent,\n} from '../../transpiler';\nimport { getCondition } from '../getCondition';\nimport { getEnumeration } from '../getEnumeration';\nimport { getGender } from '../getGender';\nimport { getInsertion } from '../getInsertion';\nimport { type GetNestingResult, getNesting } from '../getNesting';\nimport { getPlural } from '../getPlural';\nimport { getTranslation } from '../getTranslation';\nimport {\n isInterpolableWrapperNode,\n transformInterpolableNode,\n} from '../interpolableNode';\n\n// ── Tree-shake constants ──────────────────────────────────────────────────────\n// When these env vars are injected at build time, bundlers eliminate the\n// branches guarded by these constants.\n\n/** ---------------------------------------------\n * PLUGIN DEFINITION\n * --------------------------------------------- */\n\n/**\n * A plugin/transformer that can optionally transform a node during a single DFS pass.\n * - `canHandle` decides if the node is transformable by this plugin.\n * - `transform` returns the transformed node (and does not recurse further).\n *\n * > `transformFn` is a function that can be used to deeply transform inside the plugin.\n */\nexport type Plugins = {\n id: string;\n canHandle: (node: any) => boolean;\n transform: (\n node: any,\n props: NodeProps,\n transformFn: (node: any, props: NodeProps) => any\n ) => any;\n};\n\n/** ---------------------------------------------\n * FALLBACK PLUGIN\n *\n * Used to fallback a tree-shaken plugin\n * --------------------------------------------- */\n\nexport const fallbackPlugin: Plugins = {\n id: 'fallback-plugin',\n canHandle: () => false,\n transform: (node) => node,\n};\n\n/** ---------------------------------------------\n * TRANSLATION PLUGIN\n * --------------------------------------------- */\n\nexport type UnionKeys<T> = T extends unknown ? keyof T : never;\nexport type ValueAtKey<T, K> = T extends unknown\n ? K extends keyof T\n ? T[K]\n : never\n : never;\n\nexport type TranslationCond<T, S, L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.TRANSLATION]: infer U;\n}\n ? U extends Record<PropertyKey, unknown>\n ? U[keyof U] extends Record<PropertyKey, unknown>\n ? {\n [K in UnionKeys<U[keyof U]>]: L extends keyof U\n ? K extends keyof U[L]\n ? U[L][K]\n : ValueAtKey<U[keyof U], K>\n : ValueAtKey<U[keyof U], K>;\n } extends infer Content\n ? DeepTransformContent<Content, S>\n : never\n : (L extends keyof U ? U[L] : U[keyof U]) extends infer Content\n ? DeepTransformContent<Content, S>\n : never\n : never\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const translationPlugin = (\n locale: LocalesValues,\n fallback?: LocalesValues\n): Plugins =>\n process.env.INTLAYER_NODE_TYPE_TRANSLATION === 'false'\n ? fallbackPlugin\n : {\n id: 'translation-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.TRANSLATION,\n transform: (node: TranslationContent, props, deepTransformNode) => {\n const original = node[NodeTypes.TRANSLATION] ?? {};\n const result: Record<string, any> = {};\n\n for (const key in original) {\n const childProps = {\n ...props,\n children: original[key as keyof typeof original],\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.TRANSLATION, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(\n original[key as keyof typeof original],\n childProps\n );\n }\n\n return getTranslation(result, locale, fallback);\n },\n };\n\n/** ---------------------------------------------\n * ENUMERATION PLUGIN\n * --------------------------------------------- */\n\nexport type EnumerationCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.ENUMERATION]: object;\n}\n ? (\n quantity: number\n ) => DeepTransformContent<\n T[typeof NodeTypes.ENUMERATION][keyof T[typeof NodeTypes.ENUMERATION]],\n S\n >\n : never;\n\n/** Enumeration plugin. Replaces node with a function that takes quantity => string. */\nexport const enumerationPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_ENUMERATION === 'false'\n ? fallbackPlugin\n : {\n id: 'enumeration-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.ENUMERATION,\n transform: (node: EnumerationContent, props, deepTransformNode) => {\n const original = node[NodeTypes.ENUMERATION];\n const result: Record<string, any> = {};\n\n for (const key in original) {\n const child = original[key as unknown as keyof typeof original];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.ENUMERATION, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(child, childProps);\n }\n\n return (arg: number | { count: number }) => {\n const quantity = typeof arg === 'number' ? arg : arg.count;\n const subResult = getEnumeration(result, quantity);\n\n if (typeof subResult === 'function' && typeof arg === 'object') {\n return subResult(arg);\n }\n\n return subResult;\n };\n },\n };\n\n/** ---------------------------------------------\n * PLURAL PLUGIN\n * --------------------------------------------- */\n\nexport type PluralCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.PLURAL]: object;\n}\n ? (\n arg: number | { count: number; [key: string]: unknown }\n ) => DeepTransformContent<\n T[typeof NodeTypes.PLURAL][keyof T[typeof NodeTypes.PLURAL]],\n S\n >\n : never;\n\ntype SubResultFunction = (values: Record<string, string | number>) => string;\n\n/**\n * Plural plugin. Replaces node with a function that takes a count (or\n * `{ count, ...values }`) => string, picking the matching CLDR plural form\n * for the active locale and interpolating `{{count}}` (and other values).\n */\nexport const pluralPlugin = (locale?: LocalesValues): Plugins =>\n process.env.INTLAYER_NODE_TYPE_PLURAL === 'false'\n ? fallbackPlugin\n : {\n id: 'plural-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.PLURAL,\n transform: (node: PluralContent, props, deepTransformNode) => {\n const original = node[NodeTypes.PLURAL];\n const result: Record<string, any> = {};\n\n /** String plugin for plural. Replaces string node with a component that renders the insertion. */\n const pluralStringPlugin: Plugins = {\n id: 'plural-string-plugin',\n canHandle: (node) =>\n typeof node === 'string' || isInterpolableWrapperNode(node),\n transform: (node, subProps, deepTransformNode) => {\n // `html()`/`markdown()` nodes carry their `{{count}}` placeholders\n // inside a raw string. Interpolate into that string, then re-run\n // the transform so the html/markdown renderer applies afterwards.\n if (isInterpolableWrapperNode(node)) {\n return (values: { [k: string]: string | number }) =>\n transformInterpolableNode(\n node,\n values,\n subProps,\n props.plugins,\n deepTransformNode\n );\n }\n\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (values: { [k: string]: string | number }) => {\n const children = getInsertion(transformedResult, values);\n\n return deepTransformNode(children, {\n ...subProps,\n plugins: props.plugins,\n children,\n });\n };\n },\n };\n\n for (const key in original) {\n const child = original[key as keyof typeof original];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.PLURAL, key } as KeyPath,\n ],\n plugins: [pluralStringPlugin, ...(props.plugins ?? [])],\n };\n result[key] = deepTransformNode(child, childProps);\n }\n\n const effectiveLocale = String(locale ?? props.locale ?? 'en');\n\n return (arg: number | { count: number; [key: string]: unknown }) => {\n const count = typeof arg === 'number' ? arg : arg.count;\n const values =\n typeof arg === 'number'\n ? { count: arg }\n : (arg as { count: number; [key: string]: unknown });\n\n const subResult: string | SubResultFunction = getPlural(\n result as PluralContent['plural'] as PluralContentState<string>,\n count,\n effectiveLocale\n );\n\n if (typeof subResult === 'function') {\n return (subResult as SubResultFunction)(values);\n }\n\n return subResult;\n };\n },\n };\n\n/** ---------------------------------------------\n * CONDITION PLUGIN\n * --------------------------------------------- */\n\nexport type ConditionCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.CONDITION]: object;\n}\n ? (\n value: boolean | { value: boolean }\n ) => DeepTransformContent<\n T[typeof NodeTypes.CONDITION][keyof T[typeof NodeTypes.CONDITION]],\n S\n >\n : never;\n\n/** Condition plugin. Replaces node with a function that takes boolean => string. */\nexport const conditionPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_CONDITION === 'false'\n ? fallbackPlugin\n : {\n id: 'condition-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.CONDITION,\n transform: (node: ConditionContent, props, deepTransformNode) => {\n const original = node[NodeTypes.CONDITION];\n const result: Record<string, any> = {};\n\n for (const key in original) {\n const child = original[key as keyof typeof original];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.CONDITION, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(child, childProps);\n }\n\n return (arg: boolean | { value: boolean }) => {\n const value = typeof arg === 'boolean' ? arg : arg.value;\n const subResult = getCondition(result as any, value);\n\n if (typeof subResult === 'function' && typeof arg === 'object') {\n return subResult(arg);\n }\n\n return subResult;\n };\n },\n };\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\nexport type InsertionCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.INSERTION]: infer I;\n fields: readonly string[];\n}\n ? (\n values: {\n [K in T['fields'][number]]: string | number;\n }\n ) => I extends string\n ? DeepTransformContent<string, S>\n : DeepTransformContent<I, S>\n : never;\n\n/** Insertion plugin. Replaces node with a function that takes quantity => string. */\nexport const insertionPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_INSERTION === 'false'\n ? fallbackPlugin\n : {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.INSERTION,\n transform: (node: InsertionContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.INSERTION,\n },\n ];\n\n const children = node[NodeTypes.INSERTION];\n\n /** Insertion string plugin. Replaces string node with a component that render the insertion. */\n const insertionStringPlugin: Plugins = {\n id: 'insertion-string-plugin',\n canHandle: (node) =>\n typeof node === 'string' || isInterpolableWrapperNode(node),\n transform: (node, subProps, deepTransformNode) => {\n // `html()`/`markdown()` nodes carry their `{{ … }}` placeholders\n // inside a raw string. Interpolate into that string, then re-run\n // the transform so the html/markdown renderer applies afterwards.\n if (isInterpolableWrapperNode(node)) {\n return (\n values: {\n [K in InsertionContent['fields'][number]]: string | number;\n }\n ) =>\n transformInterpolableNode(\n node,\n values,\n subProps,\n props.plugins,\n deepTransformNode\n );\n }\n\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (\n values: {\n [K in InsertionContent['fields'][number]]: string | number;\n }\n ) => {\n const children = getInsertion(transformedResult, values);\n\n return deepTransformNode(children, {\n ...subProps,\n plugins: props.plugins,\n children,\n });\n };\n },\n };\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [insertionStringPlugin, ...(props.plugins ?? [])],\n });\n },\n };\n\n/** ---------------------------------------------\n * GENDER PLUGIN\n * --------------------------------------------- */\n\nexport type GenderCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.GENDER]: object;\n}\n ? (\n value: Gender\n ) => DeepTransformContent<\n T[typeof NodeTypes.GENDER][keyof T[typeof NodeTypes.GENDER]],\n S\n >\n : never;\n\n/** Gender plugin. Replaces node with a function that takes gender => string. */\nexport const genderPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_GENDER === 'false'\n ? fallbackPlugin\n : {\n id: 'gender-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.GENDER,\n transform: (node: GenderContent, props, deepTransformNode) => {\n const original = node[NodeTypes.GENDER];\n const result: Record<string, any> = {};\n\n for (const key in original) {\n const child = original[key as keyof typeof original];\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeTypes.GENDER, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(child, childProps);\n }\n\n return (value: Gender) => getGender(result as any, value);\n },\n };\n\n/** ---------------------------------------------\n * NESTED PLUGIN\n * --------------------------------------------- */\n\nexport type NestedCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.NESTED]: infer U;\n}\n ? U extends {\n dictionaryKey: infer K extends DictionaryKeys;\n path?: infer P;\n }\n ? GetNestingResult<K, P, S>\n : never\n : never;\n\n/** Nested plugin. Replaces node with the result of `getNesting`. */\nexport const nestedPlugin = (locale?: LocalesValues): Plugins =>\n process.env.INTLAYER_NODE_TYPE_NESTED === 'false'\n ? fallbackPlugin\n : {\n id: 'nested-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n (node?.nodeType === NodeTypes.NESTED || node?.nodeType === 'n'),\n transform: (node: NestedContent, props) =>\n getNesting(\n node[NodeTypes.NESTED].dictionaryKey,\n node[NodeTypes.NESTED].path,\n {\n ...props,\n locale: (locale ?? props.locale) as Locale,\n }\n ),\n };\n\n/** ---------------------------------------------\n * FILE PLUGIN\n * --------------------------------------------- */\n\nexport type FileCond<T, S, _L> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.FILE]: string;\n content?: string;\n}\n ? DeepTransformContent<string, S>\n : never;\n\n/** File plugin. Replaces node with the result of `getNesting`. */\nexport const filePlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_FILE === 'false'\n ? fallbackPlugin\n : {\n id: 'file-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.FILE,\n transform: (node: FileContent, props, deepTransform) =>\n deepTransform(node.content, {\n ...props,\n children: node.content,\n }),\n };\n\n/**\n * PLUGIN RESULT\n */\n\n/**\n * Interface that defines the properties of a node.\n * This interface can be augmented in other packages, such as `react-intlayer`.\n */\nexport interface NodeProps {\n dictionaryKey: string;\n keyPath: KeyPath[];\n plugins?: Plugins[];\n locale?: Locale;\n dictionaryPath?: string;\n children?: any;\n /**\n * Forces eager traversal of plain objects in `deepTransformNode`. By default\n * traversal is lazy (property getters), so callers that discard the returned\n * value never trigger plugins on nested nodes. Set this when running plugins\n * for their side effects only (e.g. missing-locale detection).\n */\n eager?: boolean;\n}\n\n/**\n * Interface that defines the plugins that can be used to transform a node.\n * This interface can be augmented in other packages, such as `react-intlayer`.\n */\nexport interface IInterpreterPlugin<T, S, L extends LocalesValues> {\n translation: TranslationCond<T, S, L>;\n enumeration: EnumerationCond<T, S, L>;\n plural: PluralCond<T, S, L>;\n condition: ConditionCond<T, S, L>;\n insertion: InsertionCond<T, S, L>;\n gender: GenderCond<T, S, L>;\n nested: NestedCond<T, S, L>;\n file: FileCond<T, S, L>;\n}\n\n/**\n * Allow to avoid overwriting import from `intlayer` package when `IInterpreterPlugin<T>` interface is augmented in another package, such as `react-intlayer`.\n */\nexport type IInterpreterPluginState = {\n translation: true;\n enumeration: true;\n plural: true;\n condition: true;\n insertion: true;\n gender: true;\n nested: true;\n file: true;\n};\n\n/**\n * Utility type to check if a plugin can be applied to a node.\n */\ntype CheckApplyPlugin<\n T,\n K extends keyof IInterpreterPlugin<T, S, L>,\n S,\n L extends LocalesValues = DeclaredLocales,\n> = K extends keyof S // Test if the key is a key of S.\n ? // Test if the key of S is true. Then the plugin can be applied.\n S[K] extends true\n ? // Test if the key of S exist\n IInterpreterPlugin<T, S, L>[K] extends never\n ? never\n : // Test if the plugin condition is true (if it's not, the plugin is skipped for this node)\n IInterpreterPlugin<T, S, L>[K]\n : never\n : never;\n\n/**\n * Traverse recursively through an object or array, applying each plugin as needed.\n */\ntype Traverse<T, S, L extends LocalesValues = DeclaredLocales> =\n T extends ReadonlyArray<infer U> // Turn any read-only array into a plain mutable array\n ? Array<DeepTransformContent<U, S, L>>\n : T extends object\n ? { [K in keyof T]: DeepTransformContent<T[K], S, L> }\n : T;\n\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\n\n/**\n * Traverse recursively through an object or array, applying each plugin as needed.\n */\nexport type DeepTransformContent<\n T,\n S = IInterpreterPluginState,\n L extends LocalesValues = DeclaredLocales,\n> =\n IsAny<T> extends true\n ? T\n : CheckApplyPlugin<T, keyof IInterpreterPlugin<T, S, L>, S, L> extends never // Check if there is a plugin for T:\n ? // No plugin was found, so try to transform T recursively:\n Traverse<T, S, L>\n : // A plugin was found – use the plugin's transformation.\n CheckApplyPlugin<T, keyof IInterpreterPlugin<T, S, L>, S, L>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgEA,MAAa,iBAA0B;CACrC,IAAI;CACJ,iBAAiB;CACjB,YAAY,SAAS;AACvB;;AAmCA,MAAa,qBACX,QACA,aAEA,QAAQ,IAAI,mCAAmC,UAC3C,iBACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAAY,MAAM,aAAaA,yBAAU;CAC3D,YAAY,MAA0B,OAAO,sBAAsB;EACjE,MAAM,WAAW,KAAKA,yBAAU,gBAAgB,CAAC;EACjD,MAAM,SAA8B,CAAC;EAErC,KAAK,MAAM,OAAO,UAAU;GAC1B,MAAM,aAAa;IACjB,GAAG;IACH,UAAU,SAAS;IACnB,SAAS,CACP,GAAG,MAAM,SACT;KAAE,MAAMA,yBAAU;KAAa;IAAI,CACrC;GACF;GACA,OAAO,OAAO,kBACZ,SAAS,MACT,UACF;EACF;EAEA,OAAOC,kDAAe,QAAQ,QAAQ,QAAQ;CAChD;AACF;;AAmBN,MAAa,oBACX,QAAQ,IAAI,mCAAmC,UAC3C,iBACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAAY,MAAM,aAAaD,yBAAU;CAC3D,YAAY,MAA0B,OAAO,sBAAsB;EACjE,MAAM,WAAW,KAAKA,yBAAU;EAChC,MAAM,SAA8B,CAAC;EAErC,KAAK,MAAM,OAAO,UAAU;GAC1B,MAAM,QAAQ,SAAS;GASvB,OAAO,OAAO,kBAAkB,OAAO;IAPrC,GAAG;IACH,UAAU;IACV,SAAS,CACP,GAAG,MAAM,SACT;KAAE,MAAMA,yBAAU;KAAa;IAAI,CACrC;GAE8C,CAAC;EACnD;EAEA,QAAQ,QAAoC;GAC1C,MAAM,WAAW,OAAO,QAAQ,WAAW,MAAM,IAAI;GACrD,MAAM,YAAYE,kDAAe,QAAQ,QAAQ;GAEjD,IAAI,OAAO,cAAc,cAAc,OAAO,QAAQ,UACpD,OAAO,UAAU,GAAG;GAGtB,OAAO;EACT;CACF;AACF;;;;;;AAyBN,MAAa,gBAAgB,WAC3B,QAAQ,IAAI,8BAA8B,UACtC,iBACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAAY,MAAM,aAAaF,yBAAU;CAC3D,YAAY,MAAqB,OAAO,sBAAsB;EAC5D,MAAM,WAAW,KAAKA,yBAAU;EAChC,MAAM,SAA8B,CAAC;;EAGrC,MAAM,qBAA8B;GAClC,IAAI;GACJ,YAAY,SACV,OAAO,SAAS,YAAYG,+DAA0B,IAAI;GAC5D,YAAY,MAAM,UAAU,sBAAsB;IAIhD,IAAIA,+DAA0B,IAAI,GAChC,QAAQ,WACNC,+DACE,MACA,QACA,UACA,MAAM,SACN,iBACF;IAGJ,MAAM,oBAAoB,kBAAkB,MAAM;KAChD,GAAG;KACH,UAAU;KACV,SAAS,CACP,IAAI,MAAM,WAAY,CAAC,EAAe,CAAE,QACrC,WAAW,OAAO,OAAO,sBAC5B,CACF;IACF,CAAC;IAED,QAAQ,WAA6C;KACnD,MAAM,WAAWC,8CAAa,mBAAmB,MAAM;KAEvD,OAAO,kBAAkB,UAAU;MACjC,GAAG;MACH,SAAS,MAAM;MACf;KACF,CAAC;IACH;GACF;EACF;EAEA,KAAK,MAAM,OAAO,UAAU;GAC1B,MAAM,QAAQ,SAAS;GAUvB,OAAO,OAAO,kBAAkB,OAAO;IARrC,GAAG;IACH,UAAU;IACV,SAAS,CACP,GAAG,MAAM,SACT;KAAE,MAAML,yBAAU;KAAQ;IAAI,CAChC;IACA,SAAS,CAAC,oBAAoB,GAAI,MAAM,WAAW,CAAC,CAAE;GAER,CAAC;EACnD;EAEA,MAAM,kBAAkB,OAAO,UAAU,MAAM,UAAU,IAAI;EAE7D,QAAQ,QAA4D;GAClE,MAAM,QAAQ,OAAO,QAAQ,WAAW,MAAM,IAAI;GAClD,MAAM,SACJ,OAAO,QAAQ,WACX,EAAE,OAAO,IAAI,IACZ;GAEP,MAAM,YAAwCM,wCAC5C,QACA,OACA,eACF;GAEA,IAAI,OAAO,cAAc,YACvB,OAAQ,UAAgC,MAAM;GAGhD,OAAO;EACT;CACF;AACF;;AAmBN,MAAa,kBACX,QAAQ,IAAI,iCAAiC,UACzC,iBACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAAY,MAAM,aAAaN,yBAAU;CAC3D,YAAY,MAAwB,OAAO,sBAAsB;EAC/D,MAAM,WAAW,KAAKA,yBAAU;EAChC,MAAM,SAA8B,CAAC;EAErC,KAAK,MAAM,OAAO,UAAU;GAC1B,MAAM,QAAQ,SAAS;GASvB,OAAO,OAAO,kBAAkB,OAAO;IAPrC,GAAG;IACH,UAAU;IACV,SAAS,CACP,GAAG,MAAM,SACT;KAAE,MAAMA,yBAAU;KAAW;IAAI,CACnC;GAE8C,CAAC;EACnD;EAEA,QAAQ,QAAsC;GAC5C,MAAM,QAAQ,OAAO,QAAQ,YAAY,MAAM,IAAI;GACnD,MAAM,YAAYO,8CAAa,QAAe,KAAK;GAEnD,IAAI,OAAO,cAAc,cAAc,OAAO,QAAQ,UACpD,OAAO,UAAU,GAAG;GAGtB,OAAO;EACT;CACF;AACF;;AAqBN,MAAa,kBACX,QAAQ,IAAI,iCAAiC,UACzC,iBACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAAY,MAAM,aAAaP,yBAAU;CAC3D,YAAY,MAAwB,OAAO,sBAAsB;EAC/D,MAAM,aAAwB,CAC5B,GAAG,MAAM,SACT,EACE,MAAMA,yBAAU,UAClB,CACF;EAEA,MAAM,WAAW,KAAKA,yBAAU;;EAGhC,MAAM,wBAAiC;GACrC,IAAI;GACJ,YAAY,SACV,OAAO,SAAS,YAAYG,+DAA0B,IAAI;GAC5D,YAAY,MAAM,UAAU,sBAAsB;IAIhD,IAAIA,+DAA0B,IAAI,GAChC,QACE,WAIAC,+DACE,MACA,QACA,UACA,MAAM,SACN,iBACF;IAGJ,MAAM,oBAAoB,kBAAkB,MAAM;KAChD,GAAG;KACH,UAAU;KACV,SAAS,CACP,IAAI,MAAM,WAAY,CAAC,EAAe,CAAE,QACrC,WAAW,OAAO,OAAO,sBAC5B,CACF;IACF,CAAC;IAED,QACE,WAGG;KACH,MAAM,WAAWC,8CAAa,mBAAmB,MAAM;KAEvD,OAAO,kBAAkB,UAAU;MACjC,GAAG;MACH,SAAS,MAAM;MACf;KACF,CAAC;IACH;GACF;EACF;EAEA,OAAO,kBAAkB,UAAU;GACjC,GAAG;GACH;GACA,SAAS;GACT,SAAS,CAAC,uBAAuB,GAAI,MAAM,WAAW,CAAC,CAAE;EAC3D,CAAC;CACH;AACF;;AAmBN,MAAa,eACX,QAAQ,IAAI,8BAA8B,UACtC,iBACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAAY,MAAM,aAAaL,yBAAU;CAC3D,YAAY,MAAqB,OAAO,sBAAsB;EAC5D,MAAM,WAAW,KAAKA,yBAAU;EAChC,MAAM,SAA8B,CAAC;EAErC,KAAK,MAAM,OAAO,UAAU;GAC1B,MAAM,QAAQ,SAAS;GASvB,OAAO,OAAO,kBAAkB,OAAO;IAPrC,GAAG;IACH,UAAU;IACV,SAAS,CACP,GAAG,MAAM,SACT;KAAE,MAAMA,yBAAU;KAAQ;IAAI,CAChC;GAE8C,CAAC;EACnD;EAEA,QAAQ,UAAkBQ,wCAAU,QAAe,KAAK;CAC1D;AACF;;AAmBN,MAAa,gBAAgB,WAC3B,QAAQ,IAAI,8BAA8B,UACtC,iBACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,aACf,MAAM,aAAaR,yBAAU,UAAU,MAAM,aAAa;CAC7D,YAAY,MAAqB,UAC/BS,0CACE,KAAKT,yBAAU,OAAO,CAAC,eACvB,KAAKA,yBAAU,OAAO,CAAC,MACvB;EACE,GAAG;EACH,QAAS,UAAU,MAAM;CAC3B,CACF;AACJ;;AAeN,MAAa,aACX,QAAQ,IAAI,4BAA4B,UACpC,iBACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAAY,MAAM,aAAaA,yBAAU;CAC3D,YAAY,MAAmB,OAAO,kBACpC,cAAc,KAAK,SAAS;EAC1B,GAAG;EACH,UAAU,KAAK;CACjB,CAAC;AACL"}