@intlayer/core 8.4.3 → 8.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (780) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs +213 -1
  3. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -1
  4. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs +95 -1
  5. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -1
  6. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs +46 -1
  7. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -1
  8. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs +33 -1
  9. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -1
  10. package/dist/cjs/deepTransformPlugins/getMaskContent.cjs +27 -1
  11. package/dist/cjs/deepTransformPlugins/getMaskContent.cjs.map +1 -1
  12. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs +151 -1
  13. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -1
  14. package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs +87 -1
  15. package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs.map +1 -1
  16. package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs +60 -1
  17. package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -1
  18. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs +123 -1
  19. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs.map +1 -1
  20. package/dist/cjs/deepTransformPlugins/index.cjs +32 -1
  21. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +107 -1
  22. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -1
  23. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +65 -1
  24. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
  25. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +19 -1
  26. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
  27. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +56 -1
  28. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
  29. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +27 -1
  30. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
  31. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +24 -1
  32. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
  33. package/dist/cjs/dictionaryManipulator/getNodeType.cjs +55 -1
  34. package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
  35. package/dist/cjs/dictionaryManipulator/index.cjs +27 -1
  36. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +69 -1
  37. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
  38. package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs +30 -1
  39. package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs.map +1 -1
  40. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +48 -1
  41. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -1
  42. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +32 -1
  43. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
  44. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +40 -1
  45. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
  46. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs +39 -1
  47. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
  48. package/dist/cjs/formatters/compact.cjs +25 -1
  49. package/dist/cjs/formatters/compact.cjs.map +1 -1
  50. package/dist/cjs/formatters/currency.cjs +29 -1
  51. package/dist/cjs/formatters/currency.cjs.map +1 -1
  52. package/dist/cjs/formatters/date.cjs +60 -1
  53. package/dist/cjs/formatters/date.cjs.map +1 -1
  54. package/dist/cjs/formatters/index.cjs +23 -1
  55. package/dist/cjs/formatters/list.cjs +30 -1
  56. package/dist/cjs/formatters/list.cjs.map +1 -1
  57. package/dist/cjs/formatters/number.cjs +20 -1
  58. package/dist/cjs/formatters/number.cjs.map +1 -1
  59. package/dist/cjs/formatters/percentage.cjs +27 -1
  60. package/dist/cjs/formatters/percentage.cjs.map +1 -1
  61. package/dist/cjs/formatters/relativeTime.cjs +43 -1
  62. package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
  63. package/dist/cjs/formatters/units.cjs +23 -1
  64. package/dist/cjs/formatters/units.cjs.map +1 -1
  65. package/dist/cjs/getStorageAttributes.cjs +134 -1
  66. package/dist/cjs/getStorageAttributes.cjs.map +1 -1
  67. package/dist/cjs/index.cjs +315 -1
  68. package/dist/cjs/interpreter/getCondition.cjs +27 -1
  69. package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
  70. package/dist/cjs/interpreter/getContent/deepTransform.cjs +42 -1
  71. package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
  72. package/dist/cjs/interpreter/getContent/getContent.cjs +32 -1
  73. package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -0
  74. package/dist/cjs/interpreter/getContent/index.cjs +15 -1
  75. package/dist/cjs/interpreter/getContent/plugins.cjs +163 -1
  76. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -0
  77. package/dist/cjs/interpreter/getDictionary.cjs +25 -1
  78. package/dist/cjs/interpreter/getDictionary.cjs.map +1 -0
  79. package/dist/cjs/interpreter/getEnumeration.cjs +72 -1
  80. package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
  81. package/dist/cjs/interpreter/getGender.cjs +38 -1
  82. package/dist/cjs/interpreter/getGender.cjs.map +1 -1
  83. package/dist/cjs/interpreter/getHTML.cjs +124 -1
  84. package/dist/cjs/interpreter/getHTML.cjs.map +1 -1
  85. package/dist/cjs/interpreter/getInsertion.cjs +22 -1
  86. package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
  87. package/dist/cjs/interpreter/getIntlayer.cjs +41 -1
  88. package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -0
  89. package/dist/cjs/interpreter/getNesting.cjs +37 -1
  90. package/dist/cjs/interpreter/getNesting.cjs.map +1 -0
  91. package/dist/cjs/interpreter/getTranslation.cjs +112 -1
  92. package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
  93. package/dist/cjs/interpreter/index.cjs +32 -1
  94. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs +55 -1
  95. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
  96. package/dist/cjs/localization/getBrowserLocale.cjs +143 -1
  97. package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
  98. package/dist/cjs/localization/getHTMLTextDir.cjs +40 -1
  99. package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
  100. package/dist/cjs/localization/getLocale.cjs +27 -1
  101. package/dist/cjs/localization/getLocale.cjs.map +1 -1
  102. package/dist/cjs/localization/getLocaleFromPath.cjs +36 -1
  103. package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
  104. package/dist/cjs/localization/getLocaleLang.cjs +20 -1
  105. package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
  106. package/dist/cjs/localization/getLocaleName.cjs +10 -1
  107. package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
  108. package/dist/cjs/localization/getLocalizedUrl.cjs +73 -1
  109. package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
  110. package/dist/cjs/localization/getMultilingualUrls.cjs +46 -1
  111. package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
  112. package/dist/cjs/localization/getPathWithoutLocale.cjs +55 -1
  113. package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
  114. package/dist/cjs/localization/getPrefix.cjs +73 -1
  115. package/dist/cjs/localization/getPrefix.cjs.map +1 -1
  116. package/dist/cjs/localization/index.cjs +41 -1
  117. package/dist/cjs/localization/localeDetector.cjs +133 -1
  118. package/dist/cjs/localization/localeDetector.cjs.map +1 -1
  119. package/dist/cjs/localization/localeMapper.cjs +124 -1
  120. package/dist/cjs/localization/localeMapper.cjs.map +1 -1
  121. package/dist/cjs/localization/localeResolver.cjs +28 -1
  122. package/dist/cjs/localization/localeResolver.cjs.map +1 -1
  123. package/dist/cjs/localization/rewriteUtils.cjs +110 -1
  124. package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
  125. package/dist/cjs/localization/validatePrefix.cjs +45 -1
  126. package/dist/cjs/localization/validatePrefix.cjs.map +1 -1
  127. package/dist/cjs/markdown/compiler.cjs +810 -10
  128. package/dist/cjs/markdown/compiler.cjs.map +1 -1
  129. package/dist/cjs/markdown/constants.cjs +328 -1
  130. package/dist/cjs/markdown/constants.cjs.map +1 -1
  131. package/dist/cjs/markdown/index.cjs +126 -1
  132. package/dist/cjs/markdown/parser.cjs +66 -1
  133. package/dist/cjs/markdown/parser.cjs.map +1 -1
  134. package/dist/cjs/markdown/renderer.cjs +61 -1
  135. package/dist/cjs/markdown/renderer.cjs.map +1 -1
  136. package/dist/cjs/markdown/utils.cjs +391 -6
  137. package/dist/cjs/markdown/utils.cjs.map +1 -1
  138. package/dist/cjs/messageFormat/ICU.cjs +334 -1
  139. package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
  140. package/dist/cjs/messageFormat/i18next.cjs +345 -1
  141. package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
  142. package/dist/cjs/messageFormat/index.cjs +11 -1
  143. package/dist/cjs/messageFormat/verify-icu-format.cjs +64 -2
  144. package/dist/cjs/messageFormat/verify-icu-format.cjs.map +1 -1
  145. package/dist/cjs/messageFormat/vue-i18n.cjs +181 -1
  146. package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
  147. package/dist/cjs/transpiler/condition/condition.cjs +26 -1
  148. package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
  149. package/dist/cjs/transpiler/condition/index.cjs +4 -1
  150. package/dist/cjs/transpiler/enumeration/enumeration.cjs +28 -1
  151. package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
  152. package/dist/cjs/transpiler/enumeration/index.cjs +4 -1
  153. package/dist/cjs/transpiler/file/file.cjs +51 -1
  154. package/dist/cjs/transpiler/file/file.cjs.map +1 -1
  155. package/dist/cjs/transpiler/file/fileBrowser.cjs +24 -1
  156. package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
  157. package/dist/cjs/transpiler/file/index.cjs +5 -1
  158. package/dist/cjs/transpiler/gender/gender.cjs +26 -1
  159. package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
  160. package/dist/cjs/transpiler/gender/index.cjs +4 -1
  161. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +45 -1
  162. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -0
  163. package/dist/cjs/transpiler/html/html.cjs +44 -1
  164. package/dist/cjs/transpiler/html/html.cjs.map +1 -0
  165. package/dist/cjs/transpiler/html/htmlTags.cjs +116 -1
  166. package/dist/cjs/transpiler/html/htmlTags.cjs.map +1 -1
  167. package/dist/cjs/transpiler/html/index.cjs +9 -1
  168. package/dist/cjs/transpiler/html/validateHTML.cjs +65 -1
  169. package/dist/cjs/transpiler/html/validateHTML.cjs.map +1 -1
  170. package/dist/cjs/transpiler/index.cjs +29 -1
  171. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +11 -1
  172. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
  173. package/dist/cjs/transpiler/insertion/index.cjs +6 -1
  174. package/dist/cjs/transpiler/insertion/insertion.cjs +36 -1
  175. package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
  176. package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +23 -2
  177. package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
  178. package/dist/cjs/transpiler/markdown/index.cjs +8 -1
  179. package/dist/cjs/transpiler/markdown/markdown.cjs +62 -1
  180. package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
  181. package/dist/cjs/transpiler/markdown/validateMarkdown.cjs +74 -4
  182. package/dist/cjs/transpiler/markdown/validateMarkdown.cjs.map +1 -1
  183. package/dist/cjs/transpiler/nesting/index.cjs +4 -1
  184. package/dist/cjs/transpiler/nesting/nesting.cjs +27 -1
  185. package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
  186. package/dist/cjs/transpiler/translation/index.cjs +4 -1
  187. package/dist/cjs/transpiler/translation/translation.cjs +29 -1
  188. package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
  189. package/dist/cjs/utils/checkIsURLAbsolute.cjs +7 -1
  190. package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
  191. package/dist/cjs/utils/getCookie.cjs +32 -1
  192. package/dist/cjs/utils/getCookie.cjs.map +1 -1
  193. package/dist/cjs/utils/index.cjs +21 -1
  194. package/dist/cjs/utils/intl.cjs +91 -1
  195. package/dist/cjs/utils/intl.cjs.map +1 -1
  196. package/dist/cjs/utils/isSameKeyPath.cjs +7 -1
  197. package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
  198. package/dist/cjs/utils/isValidReactElement.cjs +14 -1
  199. package/dist/cjs/utils/isValidReactElement.cjs.map +1 -1
  200. package/dist/cjs/utils/localeStorage.cjs +140 -1
  201. package/dist/cjs/utils/localeStorage.cjs.map +1 -1
  202. package/dist/cjs/utils/parseYaml.cjs +322 -16
  203. package/dist/cjs/utils/parseYaml.cjs.map +1 -1
  204. package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs +207 -1
  205. package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs.map +1 -1
  206. package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs +89 -1
  207. package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -1
  208. package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs +42 -1
  209. package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs.map +1 -1
  210. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs +31 -1
  211. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -1
  212. package/dist/esm/deepTransformPlugins/getMaskContent.mjs +25 -1
  213. package/dist/esm/deepTransformPlugins/getMaskContent.mjs.map +1 -1
  214. package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs +145 -1
  215. package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs.map +1 -1
  216. package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs +86 -1
  217. package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs.map +1 -1
  218. package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs +59 -1
  219. package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -1
  220. package/dist/esm/deepTransformPlugins/getSplittedContent.mjs +119 -1
  221. package/dist/esm/deepTransformPlugins/getSplittedContent.mjs.map +1 -1
  222. package/dist/esm/deepTransformPlugins/index.mjs +12 -1
  223. package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs +104 -1
  224. package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -1
  225. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +62 -1
  226. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
  227. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs +16 -1
  228. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
  229. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs +53 -1
  230. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
  231. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs +24 -1
  232. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
  233. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +21 -1
  234. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
  235. package/dist/esm/dictionaryManipulator/getNodeType.mjs +52 -1
  236. package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
  237. package/dist/esm/dictionaryManipulator/index.mjs +14 -1
  238. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +66 -1
  239. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -1
  240. package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs +28 -1
  241. package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs.map +1 -1
  242. package/dist/esm/dictionaryManipulator/orderDictionaries.mjs +45 -1
  243. package/dist/esm/dictionaryManipulator/orderDictionaries.mjs.map +1 -1
  244. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +29 -1
  245. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
  246. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +37 -1
  247. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
  248. package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs +36 -1
  249. package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs.map +1 -1
  250. package/dist/esm/formatters/compact.mjs +22 -1
  251. package/dist/esm/formatters/compact.mjs.map +1 -1
  252. package/dist/esm/formatters/currency.mjs +26 -1
  253. package/dist/esm/formatters/currency.mjs.map +1 -1
  254. package/dist/esm/formatters/date.mjs +57 -1
  255. package/dist/esm/formatters/date.mjs.map +1 -1
  256. package/dist/esm/formatters/index.mjs +11 -1
  257. package/dist/esm/formatters/list.mjs +27 -1
  258. package/dist/esm/formatters/list.mjs.map +1 -1
  259. package/dist/esm/formatters/number.mjs +17 -1
  260. package/dist/esm/formatters/number.mjs.map +1 -1
  261. package/dist/esm/formatters/percentage.mjs +24 -1
  262. package/dist/esm/formatters/percentage.mjs.map +1 -1
  263. package/dist/esm/formatters/relativeTime.mjs +40 -1
  264. package/dist/esm/formatters/relativeTime.mjs.map +1 -1
  265. package/dist/esm/formatters/units.mjs +20 -1
  266. package/dist/esm/formatters/units.mjs.map +1 -1
  267. package/dist/esm/getStorageAttributes.mjs +132 -1
  268. package/dist/esm/getStorageAttributes.mjs.map +1 -1
  269. package/dist/esm/index.mjs +87 -1
  270. package/dist/esm/interpreter/getCondition.mjs +25 -1
  271. package/dist/esm/interpreter/getCondition.mjs.map +1 -1
  272. package/dist/esm/interpreter/getContent/deepTransform.mjs +39 -1
  273. package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
  274. package/dist/esm/interpreter/getContent/getContent.mjs +28 -1
  275. package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -0
  276. package/dist/esm/interpreter/getContent/index.mjs +5 -1
  277. package/dist/esm/interpreter/getContent/plugins.mjs +154 -1
  278. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -0
  279. package/dist/esm/interpreter/getDictionary.mjs +24 -1
  280. package/dist/esm/interpreter/getDictionary.mjs.map +1 -0
  281. package/dist/esm/interpreter/getEnumeration.mjs +69 -1
  282. package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
  283. package/dist/esm/interpreter/getGender.mjs +36 -1
  284. package/dist/esm/interpreter/getGender.mjs.map +1 -1
  285. package/dist/esm/interpreter/getHTML.mjs +122 -1
  286. package/dist/esm/interpreter/getHTML.mjs.map +1 -1
  287. package/dist/esm/interpreter/getInsertion.mjs +20 -1
  288. package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
  289. package/dist/esm/interpreter/getIntlayer.mjs +37 -1
  290. package/dist/esm/interpreter/getIntlayer.mjs.map +1 -0
  291. package/dist/esm/interpreter/getNesting.mjs +36 -1
  292. package/dist/esm/interpreter/getNesting.mjs.map +1 -0
  293. package/dist/esm/interpreter/getTranslation.mjs +110 -1
  294. package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
  295. package/dist/esm/interpreter/index.mjs +13 -1
  296. package/dist/esm/interpreter/splitAndJoinInsertion.mjs +53 -1
  297. package/dist/esm/interpreter/splitAndJoinInsertion.mjs.map +1 -1
  298. package/dist/esm/localization/getBrowserLocale.mjs +138 -1
  299. package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
  300. package/dist/esm/localization/getHTMLTextDir.mjs +38 -1
  301. package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
  302. package/dist/esm/localization/getLocale.mjs +24 -1
  303. package/dist/esm/localization/getLocale.mjs.map +1 -1
  304. package/dist/esm/localization/getLocaleFromPath.mjs +35 -1
  305. package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
  306. package/dist/esm/localization/getLocaleLang.mjs +18 -1
  307. package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
  308. package/dist/esm/localization/getLocaleName.mjs +9 -1
  309. package/dist/esm/localization/getLocaleName.mjs.map +1 -1
  310. package/dist/esm/localization/getLocalizedUrl.mjs +70 -1
  311. package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
  312. package/dist/esm/localization/getMultilingualUrls.mjs +45 -1
  313. package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
  314. package/dist/esm/localization/getPathWithoutLocale.mjs +52 -1
  315. package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
  316. package/dist/esm/localization/getPrefix.mjs +69 -1
  317. package/dist/esm/localization/getPrefix.mjs.map +1 -1
  318. package/dist/esm/localization/index.mjs +18 -1
  319. package/dist/esm/localization/localeDetector.mjs +131 -1
  320. package/dist/esm/localization/localeDetector.mjs.map +1 -1
  321. package/dist/esm/localization/localeMapper.mjs +119 -1
  322. package/dist/esm/localization/localeMapper.mjs.map +1 -1
  323. package/dist/esm/localization/localeResolver.mjs +25 -1
  324. package/dist/esm/localization/localeResolver.mjs.map +1 -1
  325. package/dist/esm/localization/rewriteUtils.mjs +104 -1
  326. package/dist/esm/localization/rewriteUtils.mjs.map +1 -1
  327. package/dist/esm/localization/validatePrefix.mjs +44 -1
  328. package/dist/esm/localization/validatePrefix.mjs.map +1 -1
  329. package/dist/esm/markdown/compiler.mjs +786 -10
  330. package/dist/esm/markdown/compiler.mjs.map +1 -1
  331. package/dist/esm/markdown/constants.mjs +247 -1
  332. package/dist/esm/markdown/constants.mjs.map +1 -1
  333. package/dist/esm/markdown/index.mjs +10 -1
  334. package/dist/esm/markdown/parser.mjs +65 -1
  335. package/dist/esm/markdown/parser.mjs.map +1 -1
  336. package/dist/esm/markdown/renderer.mjs +59 -1
  337. package/dist/esm/markdown/renderer.mjs.map +1 -1
  338. package/dist/esm/markdown/utils.mjs +361 -6
  339. package/dist/esm/markdown/utils.mjs.map +1 -1
  340. package/dist/esm/messageFormat/ICU.mjs +330 -1
  341. package/dist/esm/messageFormat/ICU.mjs.map +1 -1
  342. package/dist/esm/messageFormat/i18next.mjs +341 -1
  343. package/dist/esm/messageFormat/i18next.mjs.map +1 -1
  344. package/dist/esm/messageFormat/index.mjs +5 -1
  345. package/dist/esm/messageFormat/verify-icu-format.mjs +64 -2
  346. package/dist/esm/messageFormat/verify-icu-format.mjs.map +1 -1
  347. package/dist/esm/messageFormat/vue-i18n.mjs +177 -1
  348. package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
  349. package/dist/esm/transpiler/condition/condition.mjs +24 -1
  350. package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
  351. package/dist/esm/transpiler/condition/index.mjs +3 -1
  352. package/dist/esm/transpiler/enumeration/enumeration.mjs +26 -1
  353. package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
  354. package/dist/esm/transpiler/enumeration/index.mjs +3 -1
  355. package/dist/esm/transpiler/file/file.mjs +48 -1
  356. package/dist/esm/transpiler/file/file.mjs.map +1 -1
  357. package/dist/esm/transpiler/file/fileBrowser.mjs +22 -1
  358. package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
  359. package/dist/esm/transpiler/file/index.mjs +3 -1
  360. package/dist/esm/transpiler/gender/gender.mjs +24 -1
  361. package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
  362. package/dist/esm/transpiler/gender/index.mjs +3 -1
  363. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs +44 -1
  364. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -0
  365. package/dist/esm/transpiler/html/html.mjs +42 -1
  366. package/dist/esm/transpiler/html/html.mjs.map +1 -0
  367. package/dist/esm/transpiler/html/htmlTags.mjs +114 -1
  368. package/dist/esm/transpiler/html/htmlTags.mjs.map +1 -1
  369. package/dist/esm/transpiler/html/index.mjs +5 -1
  370. package/dist/esm/transpiler/html/validateHTML.mjs +62 -1
  371. package/dist/esm/transpiler/html/validateHTML.mjs.map +1 -1
  372. package/dist/esm/transpiler/index.mjs +15 -1
  373. package/dist/esm/transpiler/insertion/getInsertionValues.mjs +9 -1
  374. package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
  375. package/dist/esm/transpiler/insertion/index.mjs +4 -1
  376. package/dist/esm/transpiler/insertion/insertion.mjs +34 -1
  377. package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
  378. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +22 -2
  379. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
  380. package/dist/esm/transpiler/markdown/index.mjs +5 -1
  381. package/dist/esm/transpiler/markdown/markdown.mjs +60 -1
  382. package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
  383. package/dist/esm/transpiler/markdown/validateMarkdown.mjs +73 -4
  384. package/dist/esm/transpiler/markdown/validateMarkdown.mjs.map +1 -1
  385. package/dist/esm/transpiler/nesting/index.mjs +3 -1
  386. package/dist/esm/transpiler/nesting/nesting.mjs +25 -1
  387. package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
  388. package/dist/esm/transpiler/translation/index.mjs +3 -1
  389. package/dist/esm/transpiler/translation/translation.mjs +27 -1
  390. package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
  391. package/dist/esm/utils/checkIsURLAbsolute.mjs +5 -1
  392. package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
  393. package/dist/esm/utils/getCookie.mjs +30 -1
  394. package/dist/esm/utils/getCookie.mjs.map +1 -1
  395. package/dist/esm/utils/index.mjs +9 -1
  396. package/dist/esm/utils/intl.mjs +86 -1
  397. package/dist/esm/utils/intl.mjs.map +1 -1
  398. package/dist/esm/utils/isSameKeyPath.mjs +5 -1
  399. package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
  400. package/dist/esm/utils/isValidReactElement.mjs +12 -1
  401. package/dist/esm/utils/isValidReactElement.mjs.map +1 -1
  402. package/dist/esm/utils/localeStorage.mjs +135 -1
  403. package/dist/esm/utils/localeStorage.mjs.map +1 -1
  404. package/dist/esm/utils/parseYaml.mjs +320 -16
  405. package/dist/esm/utils/parseYaml.mjs.map +1 -1
  406. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +50 -2
  407. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -0
  408. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +42 -2
  409. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -0
  410. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +34 -2
  411. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -0
  412. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +18 -2
  413. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +1 -0
  414. package/dist/types/deepTransformPlugins/getMaskContent.d.ts +10 -2
  415. package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -0
  416. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +19 -2
  417. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +1 -0
  418. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts +32 -2
  419. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts.map +1 -0
  420. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +8 -2
  421. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -0
  422. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts +43 -2
  423. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts.map +1 -0
  424. package/dist/types/deepTransformPlugins/index.d.ts +10 -10
  425. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +25 -2
  426. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +1 -0
  427. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +8 -2
  428. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +1 -0
  429. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +9 -2
  430. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +1 -0
  431. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +9 -2
  432. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -0
  433. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +7 -2
  434. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -0
  435. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +7 -2
  436. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -0
  437. package/dist/types/dictionaryManipulator/getNodeType.d.ts +8 -2
  438. package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -0
  439. package/dist/types/dictionaryManipulator/index.d.ts +12 -12
  440. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +7 -2
  441. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -0
  442. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +9 -2
  443. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +1 -0
  444. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +15 -2
  445. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -0
  446. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +8 -2
  447. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +1 -0
  448. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +8 -2
  449. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +1 -0
  450. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +7 -2
  451. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +1 -0
  452. package/dist/types/formatters/compact.d.ts +20 -2
  453. package/dist/types/formatters/compact.d.ts.map +1 -0
  454. package/dist/types/formatters/currency.d.ts +20 -2
  455. package/dist/types/formatters/currency.d.ts.map +1 -0
  456. package/dist/types/formatters/date.d.ts +20 -2
  457. package/dist/types/formatters/date.d.ts.map +1 -0
  458. package/dist/types/formatters/index.d.ts +9 -9
  459. package/dist/types/formatters/list.d.ts +30 -2
  460. package/dist/types/formatters/list.d.ts.map +1 -0
  461. package/dist/types/formatters/number.d.ts +18 -2
  462. package/dist/types/formatters/number.d.ts.map +1 -0
  463. package/dist/types/formatters/percentage.d.ts +18 -2
  464. package/dist/types/formatters/percentage.d.ts.map +1 -0
  465. package/dist/types/formatters/relativeTime.d.ts +21 -2
  466. package/dist/types/formatters/relativeTime.d.ts.map +1 -0
  467. package/dist/types/formatters/units.d.ts +16 -2
  468. package/dist/types/formatters/units.d.ts.map +1 -0
  469. package/dist/types/getStorageAttributes.d.ts +29 -2
  470. package/dist/types/getStorageAttributes.d.ts.map +1 -0
  471. package/dist/types/index.d.ts +88 -80
  472. package/dist/types/interpreter/getCondition.d.ts +22 -2
  473. package/dist/types/interpreter/getCondition.d.ts.map +1 -0
  474. package/dist/types/interpreter/getContent/deepTransform.d.ts +12 -2
  475. package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -0
  476. package/dist/types/interpreter/getContent/getContent.d.ts +16 -2
  477. package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -0
  478. package/dist/types/interpreter/getContent/index.d.ts +3 -1
  479. package/dist/types/interpreter/getContent/plugins.d.ts +152 -2
  480. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -0
  481. package/dist/types/interpreter/getDictionary.d.ts +17 -2
  482. package/dist/types/interpreter/getDictionary.d.ts.map +1 -0
  483. package/dist/types/interpreter/getEnumeration.d.ts +58 -2
  484. package/dist/types/interpreter/getEnumeration.d.ts.map +1 -0
  485. package/dist/types/interpreter/getGender.d.ts +1 -1
  486. package/dist/types/interpreter/getGender.d.ts.map +1 -1
  487. package/dist/types/interpreter/getHTML.d.ts +32 -2
  488. package/dist/types/interpreter/getHTML.d.ts.map +1 -0
  489. package/dist/types/interpreter/getInsertion.d.ts +1 -1
  490. package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
  491. package/dist/types/interpreter/getIntlayer.d.ts +8 -2
  492. package/dist/types/interpreter/getIntlayer.d.ts.map +1 -0
  493. package/dist/types/interpreter/getNesting.d.ts +27 -2
  494. package/dist/types/interpreter/getNesting.d.ts.map +1 -0
  495. package/dist/types/interpreter/getTranslation.d.ts +30 -2
  496. package/dist/types/interpreter/getTranslation.d.ts.map +1 -0
  497. package/dist/types/interpreter/index.d.ts +11 -4
  498. package/dist/types/interpreter/splitAndJoinInsertion.d.ts +25 -2
  499. package/dist/types/interpreter/splitAndJoinInsertion.d.ts.map +1 -0
  500. package/dist/types/localization/getBrowserLocale.d.ts +35 -2
  501. package/dist/types/localization/getBrowserLocale.d.ts.map +1 -0
  502. package/dist/types/localization/getHTMLTextDir.d.ts +21 -2
  503. package/dist/types/localization/getHTMLTextDir.d.ts.map +1 -0
  504. package/dist/types/localization/getLocale.d.ts +11 -2
  505. package/dist/types/localization/getLocale.d.ts.map +1 -0
  506. package/dist/types/localization/getLocaleFromPath.d.ts +20 -2
  507. package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -0
  508. package/dist/types/localization/getLocaleLang.d.ts +20 -2
  509. package/dist/types/localization/getLocaleLang.d.ts.map +1 -0
  510. package/dist/types/localization/getLocaleName.d.ts +7 -2
  511. package/dist/types/localization/getLocaleName.d.ts.map +1 -0
  512. package/dist/types/localization/getLocalizedUrl.d.ts +44 -2
  513. package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -0
  514. package/dist/types/localization/getMultilingualUrls.d.ts +42 -2
  515. package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -0
  516. package/dist/types/localization/getPathWithoutLocale.d.ts +31 -2
  517. package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -0
  518. package/dist/types/localization/getPrefix.d.ts +83 -2
  519. package/dist/types/localization/getPrefix.d.ts.map +1 -0
  520. package/dist/types/localization/index.d.ts +16 -16
  521. package/dist/types/localization/localeDetector.d.ts +18 -2
  522. package/dist/types/localization/localeDetector.d.ts.map +1 -0
  523. package/dist/types/localization/localeMapper.d.ts +92 -2
  524. package/dist/types/localization/localeMapper.d.ts.map +1 -0
  525. package/dist/types/localization/localeResolver.d.ts +12 -2
  526. package/dist/types/localization/localeResolver.d.ts.map +1 -0
  527. package/dist/types/localization/rewriteUtils.d.ts +34 -2
  528. package/dist/types/localization/rewriteUtils.d.ts.map +1 -0
  529. package/dist/types/localization/validatePrefix.d.ts +34 -2
  530. package/dist/types/localization/validatePrefix.d.ts.map +1 -0
  531. package/dist/types/markdown/compiler.d.ts +9 -2
  532. package/dist/types/markdown/compiler.d.ts.map +1 -0
  533. package/dist/types/markdown/constants.d.ts +177 -2
  534. package/dist/types/markdown/constants.d.ts.map +1 -0
  535. package/dist/types/markdown/index.d.ts +10 -10
  536. package/dist/types/markdown/parser.d.ts +16 -2
  537. package/dist/types/markdown/parser.d.ts.map +1 -0
  538. package/dist/types/markdown/renderer.d.ts +22 -2
  539. package/dist/types/markdown/renderer.d.ts.map +1 -0
  540. package/dist/types/markdown/types.d.ts +333 -2
  541. package/dist/types/markdown/types.d.ts.map +1 -0
  542. package/dist/types/markdown/utils.d.ts +140 -2
  543. package/dist/types/markdown/utils.d.ts.map +1 -0
  544. package/dist/types/messageFormat/ICU.d.ts +11 -2
  545. package/dist/types/messageFormat/ICU.d.ts.map +1 -0
  546. package/dist/types/messageFormat/i18next.d.ts +9 -2
  547. package/dist/types/messageFormat/i18next.d.ts.map +1 -0
  548. package/dist/types/messageFormat/index.d.ts +3 -3
  549. package/dist/types/messageFormat/vue-i18n.d.ts +9 -2
  550. package/dist/types/messageFormat/vue-i18n.d.ts.map +1 -0
  551. package/dist/types/transpiler/condition/condition.d.ts +28 -2
  552. package/dist/types/transpiler/condition/condition.d.ts.map +1 -0
  553. package/dist/types/transpiler/condition/index.d.ts +1 -1
  554. package/dist/types/transpiler/enumeration/enumeration.d.ts +40 -2
  555. package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -0
  556. package/dist/types/transpiler/enumeration/index.d.ts +1 -1
  557. package/dist/types/transpiler/file/file.d.ts +28 -2
  558. package/dist/types/transpiler/file/file.d.ts.map +1 -0
  559. package/dist/types/transpiler/file/fileBrowser.d.ts +1 -1
  560. package/dist/types/transpiler/file/index.d.ts +1 -1
  561. package/dist/types/transpiler/gender/gender.d.ts +29 -2
  562. package/dist/types/transpiler/gender/gender.d.ts.map +1 -0
  563. package/dist/types/transpiler/gender/index.d.ts +1 -1
  564. package/dist/types/transpiler/html/html.d.ts +25 -2
  565. package/dist/types/transpiler/html/html.d.ts.map +1 -0
  566. package/dist/types/transpiler/html/htmlTags.d.ts +115 -2
  567. package/dist/types/transpiler/html/htmlTags.d.ts.map +1 -0
  568. package/dist/types/transpiler/html/index.d.ts +3 -3
  569. package/dist/types/transpiler/html/validateHTML.d.ts +21 -2
  570. package/dist/types/transpiler/html/validateHTML.d.ts.map +1 -0
  571. package/dist/types/transpiler/index.d.ts +15 -15
  572. package/dist/types/transpiler/insertion/getInsertionValues.d.ts +5 -2
  573. package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -0
  574. package/dist/types/transpiler/insertion/index.d.ts +2 -2
  575. package/dist/types/transpiler/insertion/insertion.d.ts +23 -2
  576. package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -0
  577. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts +5 -2
  578. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -0
  579. package/dist/types/transpiler/markdown/index.d.ts +4 -4
  580. package/dist/types/transpiler/markdown/markdown.d.ts +26 -2
  581. package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -0
  582. package/dist/types/transpiler/markdown/validateMarkdown.d.ts +18 -3
  583. package/dist/types/transpiler/markdown/validateMarkdown.d.ts.map +1 -0
  584. package/dist/types/transpiler/nesting/index.d.ts +1 -1
  585. package/dist/types/transpiler/nesting/nesting.d.ts +49 -2
  586. package/dist/types/transpiler/nesting/nesting.d.ts.map +1 -0
  587. package/dist/types/transpiler/translation/index.d.ts +1 -1
  588. package/dist/types/transpiler/translation/translation.d.ts +33 -2
  589. package/dist/types/transpiler/translation/translation.d.ts.map +1 -0
  590. package/dist/types/utils/checkIsURLAbsolute.d.ts +5 -2
  591. package/dist/types/utils/checkIsURLAbsolute.d.ts.map +1 -0
  592. package/dist/types/utils/getCookie.d.ts +11 -2
  593. package/dist/types/utils/getCookie.d.ts.map +1 -0
  594. package/dist/types/utils/index.d.ts +7 -7
  595. package/dist/types/utils/intl.d.ts +33 -2
  596. package/dist/types/utils/intl.d.ts.map +1 -0
  597. package/dist/types/utils/isSameKeyPath.d.ts +7 -2
  598. package/dist/types/utils/isSameKeyPath.d.ts.map +1 -0
  599. package/dist/types/utils/isValidReactElement.d.ts +12 -2
  600. package/dist/types/utils/isValidReactElement.d.ts.map +1 -0
  601. package/dist/types/utils/localeStorage.d.ts +108 -2
  602. package/dist/types/utils/localeStorage.d.ts.map +1 -0
  603. package/dist/types/utils/parseYaml.d.ts +5 -2
  604. package/dist/types/utils/parseYaml.d.ts.map +1 -0
  605. package/package.json +6 -6
  606. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  607. package/dist/cjs/getContent-DrqM8pqO.cjs +0 -2
  608. package/dist/cjs/getContent-DrqM8pqO.cjs.map +0 -1
  609. package/dist/cjs/html-CZ1N-VL0.cjs +0 -2
  610. package/dist/cjs/html-CZ1N-VL0.cjs.map +0 -1
  611. package/dist/esm/getContent-DKqtIZGL.mjs +0 -2
  612. package/dist/esm/getContent-DKqtIZGL.mjs.map +0 -1
  613. package/dist/esm/html-3bo80xzx.mjs +0 -2
  614. package/dist/esm/html-3bo80xzx.mjs.map +0 -1
  615. package/dist/types/ICU-tA3ZHN5U.d.ts +0 -11
  616. package/dist/types/ICU-tA3ZHN5U.d.ts.map +0 -1
  617. package/dist/types/checkIsURLAbsolute-CTf3JFU6.d.ts +0 -5
  618. package/dist/types/checkIsURLAbsolute-CTf3JFU6.d.ts.map +0 -1
  619. package/dist/types/compact-IHXcM4pT.d.ts +0 -20
  620. package/dist/types/compact-IHXcM4pT.d.ts.map +0 -1
  621. package/dist/types/compiler-DFiAsUdH.d.ts +0 -9
  622. package/dist/types/compiler-DFiAsUdH.d.ts.map +0 -1
  623. package/dist/types/condition-BDUtoh_1.d.ts +0 -28
  624. package/dist/types/condition-BDUtoh_1.d.ts.map +0 -1
  625. package/dist/types/constants-CI_D82B1.d.ts +0 -177
  626. package/dist/types/constants-CI_D82B1.d.ts.map +0 -1
  627. package/dist/types/currency-PbMCnHep.d.ts +0 -20
  628. package/dist/types/currency-PbMCnHep.d.ts.map +0 -1
  629. package/dist/types/date-C-PI8KqU.d.ts +0 -20
  630. package/dist/types/date-C-PI8KqU.d.ts.map +0 -1
  631. package/dist/types/editDictionaryByKeyPath-BYIHcsyf.d.ts +0 -8
  632. package/dist/types/editDictionaryByKeyPath-BYIHcsyf.d.ts.map +0 -1
  633. package/dist/types/enumeration-CtuvB5Zz.d.ts +0 -40
  634. package/dist/types/enumeration-CtuvB5Zz.d.ts.map +0 -1
  635. package/dist/types/file-C3q8xvQb.d.ts +0 -28
  636. package/dist/types/file-C3q8xvQb.d.ts.map +0 -1
  637. package/dist/types/gender-Dd39Ijmf.d.ts +0 -29
  638. package/dist/types/gender-Dd39Ijmf.d.ts.map +0 -1
  639. package/dist/types/getBrowserLocale-RD_Mwv1t.d.ts +0 -35
  640. package/dist/types/getBrowserLocale-RD_Mwv1t.d.ts.map +0 -1
  641. package/dist/types/getContentNodeByKeyPath-B0Tdi5mj.d.ts +0 -9
  642. package/dist/types/getContentNodeByKeyPath-B0Tdi5mj.d.ts.map +0 -1
  643. package/dist/types/getCookie-DPOvVv_h.d.ts +0 -11
  644. package/dist/types/getCookie-DPOvVv_h.d.ts.map +0 -1
  645. package/dist/types/getDefaultNode-DQNsje2D.d.ts +0 -9
  646. package/dist/types/getDefaultNode-DQNsje2D.d.ts.map +0 -1
  647. package/dist/types/getEmptyNode-DW27TTBj.d.ts +0 -7
  648. package/dist/types/getEmptyNode-DW27TTBj.d.ts.map +0 -1
  649. package/dist/types/getFilterMissingTranslationsContent-CDNQqoy1.d.ts +0 -50
  650. package/dist/types/getFilterMissingTranslationsContent-CDNQqoy1.d.ts.map +0 -1
  651. package/dist/types/getFilterTranslationsOnlyContent-D2YgBkHn.d.ts +0 -42
  652. package/dist/types/getFilterTranslationsOnlyContent-D2YgBkHn.d.ts.map +0 -1
  653. package/dist/types/getFilteredLocalesContent-D0GP-uEg.d.ts +0 -34
  654. package/dist/types/getFilteredLocalesContent-D0GP-uEg.d.ts.map +0 -1
  655. package/dist/types/getHTML-CP6OXtdo.d.ts +0 -32
  656. package/dist/types/getHTML-CP6OXtdo.d.ts.map +0 -1
  657. package/dist/types/getHTMLTextDir-4Zh8J3x7.d.ts +0 -21
  658. package/dist/types/getHTMLTextDir-4Zh8J3x7.d.ts.map +0 -1
  659. package/dist/types/getInsertionValues-Cu9IdbuE.d.ts +0 -5
  660. package/dist/types/getInsertionValues-Cu9IdbuE.d.ts.map +0 -1
  661. package/dist/types/getLocale-B9dECUM_.d.ts +0 -11
  662. package/dist/types/getLocale-B9dECUM_.d.ts.map +0 -1
  663. package/dist/types/getLocaleFromPath-621W32QA.d.ts +0 -26
  664. package/dist/types/getLocaleFromPath-621W32QA.d.ts.map +0 -1
  665. package/dist/types/getLocaleLang-Bcan1gS4.d.ts +0 -20
  666. package/dist/types/getLocaleLang-Bcan1gS4.d.ts.map +0 -1
  667. package/dist/types/getLocaleName-CfRAD9Hc.d.ts +0 -7
  668. package/dist/types/getLocaleName-CfRAD9Hc.d.ts.map +0 -1
  669. package/dist/types/getLocalizedContent-DOncZd-0.d.ts +0 -18
  670. package/dist/types/getLocalizedContent-DOncZd-0.d.ts.map +0 -1
  671. package/dist/types/getLocalizedUrl-BbqeA3-W.d.ts +0 -49
  672. package/dist/types/getLocalizedUrl-BbqeA3-W.d.ts.map +0 -1
  673. package/dist/types/getMarkdownMetadata-Bf1S1NQ0.d.ts +0 -5
  674. package/dist/types/getMarkdownMetadata-Bf1S1NQ0.d.ts.map +0 -1
  675. package/dist/types/getMaskContent-BwLFqp7v.d.ts +0 -10
  676. package/dist/types/getMaskContent-BwLFqp7v.d.ts.map +0 -1
  677. package/dist/types/getMissingLocalesContent-BYffYcdx.d.ts +0 -19
  678. package/dist/types/getMissingLocalesContent-BYffYcdx.d.ts.map +0 -1
  679. package/dist/types/getMultilingualDictionary-DO3i1MFs.d.ts +0 -32
  680. package/dist/types/getMultilingualDictionary-DO3i1MFs.d.ts.map +0 -1
  681. package/dist/types/getMultilingualUrls-CUxYYfA4.d.ts +0 -47
  682. package/dist/types/getMultilingualUrls-CUxYYfA4.d.ts.map +0 -1
  683. package/dist/types/getNodeChildren-OT7Liqke.d.ts +0 -7
  684. package/dist/types/getNodeChildren-OT7Liqke.d.ts.map +0 -1
  685. package/dist/types/getNodeType-Cp765I26.d.ts +0 -8
  686. package/dist/types/getNodeType-Cp765I26.d.ts.map +0 -1
  687. package/dist/types/getPathWithoutLocale-B_aIR7O0.d.ts +0 -31
  688. package/dist/types/getPathWithoutLocale-B_aIR7O0.d.ts.map +0 -1
  689. package/dist/types/getPrefix-X9XKkrZD.d.ts +0 -68
  690. package/dist/types/getPrefix-X9XKkrZD.d.ts.map +0 -1
  691. package/dist/types/getReplacedValuesContent-BvL25pdt.d.ts +0 -8
  692. package/dist/types/getReplacedValuesContent-BvL25pdt.d.ts.map +0 -1
  693. package/dist/types/getSplittedContent-YD4JDMfB.d.ts +0 -43
  694. package/dist/types/getSplittedContent-YD4JDMfB.d.ts.map +0 -1
  695. package/dist/types/getStorageAttributes-CIO2xWqQ.d.ts +0 -29
  696. package/dist/types/getStorageAttributes-CIO2xWqQ.d.ts.map +0 -1
  697. package/dist/types/getTranslation-BG2Wg-af.d.ts +0 -30
  698. package/dist/types/getTranslation-BG2Wg-af.d.ts.map +0 -1
  699. package/dist/types/html-Dn6KrpJ3.d.ts +0 -25
  700. package/dist/types/html-Dn6KrpJ3.d.ts.map +0 -1
  701. package/dist/types/htmlTags-YxTtVUx6.d.ts +0 -115
  702. package/dist/types/htmlTags-YxTtVUx6.d.ts.map +0 -1
  703. package/dist/types/i18next-qY0AixrB.d.ts +0 -9
  704. package/dist/types/i18next-qY0AixrB.d.ts.map +0 -1
  705. package/dist/types/index-1CTsSKEn.d.ts +0 -1
  706. package/dist/types/index-B8xF2zGo.d.ts +0 -1
  707. package/dist/types/index-BcsOTSQF.d.ts +0 -1
  708. package/dist/types/index-BnEeKNKW.d.ts +0 -322
  709. package/dist/types/index-BnEeKNKW.d.ts.map +0 -1
  710. package/dist/types/index-Cf8zm5QQ.d.ts +0 -1
  711. package/dist/types/index-CfvILin8.d.ts +0 -1
  712. package/dist/types/index-DK_kKFOF.d.ts +0 -1
  713. package/dist/types/index-DeJa0xZp.d.ts +0 -1
  714. package/dist/types/index-Vlqtiwjx.d.ts +0 -1
  715. package/dist/types/insertContentInDictionary-DZ3UzG4K.d.ts +0 -25
  716. package/dist/types/insertContentInDictionary-DZ3UzG4K.d.ts.map +0 -1
  717. package/dist/types/insertion-M5fwK-29.d.ts +0 -23
  718. package/dist/types/insertion-M5fwK-29.d.ts.map +0 -1
  719. package/dist/types/intl-B2Ap8I5x.d.ts +0 -33
  720. package/dist/types/intl-B2Ap8I5x.d.ts.map +0 -1
  721. package/dist/types/isSameKeyPath-CkH8NdJh.d.ts +0 -7
  722. package/dist/types/isSameKeyPath-CkH8NdJh.d.ts.map +0 -1
  723. package/dist/types/isValidReactElement-BsoJ01oP.d.ts +0 -12
  724. package/dist/types/isValidReactElement-BsoJ01oP.d.ts.map +0 -1
  725. package/dist/types/list-BdjJM2Gx.d.ts +0 -30
  726. package/dist/types/list-BdjJM2Gx.d.ts.map +0 -1
  727. package/dist/types/localeDetector-BWNCQRiZ.d.ts +0 -18
  728. package/dist/types/localeDetector-BWNCQRiZ.d.ts.map +0 -1
  729. package/dist/types/localeMapper-DoAnasqf.d.ts +0 -92
  730. package/dist/types/localeMapper-DoAnasqf.d.ts.map +0 -1
  731. package/dist/types/localeResolver-bb7AWQNX.d.ts +0 -12
  732. package/dist/types/localeResolver-bb7AWQNX.d.ts.map +0 -1
  733. package/dist/types/localeStorage-CZHwY0u3.d.ts +0 -108
  734. package/dist/types/localeStorage-CZHwY0u3.d.ts.map +0 -1
  735. package/dist/types/markdown-MzfikrI1.d.ts +0 -26
  736. package/dist/types/markdown-MzfikrI1.d.ts.map +0 -1
  737. package/dist/types/mergeDictionaries-D6WUMQN5.d.ts +0 -7
  738. package/dist/types/mergeDictionaries-D6WUMQN5.d.ts.map +0 -1
  739. package/dist/types/normalizeDictionary-coviIGTW.d.ts +0 -9
  740. package/dist/types/normalizeDictionary-coviIGTW.d.ts.map +0 -1
  741. package/dist/types/number-C8izkCmU.d.ts +0 -16
  742. package/dist/types/number-C8izkCmU.d.ts.map +0 -1
  743. package/dist/types/orderDictionaries-SSCMY6qG.d.ts +0 -15
  744. package/dist/types/orderDictionaries-SSCMY6qG.d.ts.map +0 -1
  745. package/dist/types/parseYaml-D5gxutvA.d.ts +0 -5
  746. package/dist/types/parseYaml-D5gxutvA.d.ts.map +0 -1
  747. package/dist/types/parser-BVwR6Tjw.d.ts +0 -16
  748. package/dist/types/parser-BVwR6Tjw.d.ts.map +0 -1
  749. package/dist/types/percentage-BqsvW0Zw.d.ts +0 -16
  750. package/dist/types/percentage-BqsvW0Zw.d.ts.map +0 -1
  751. package/dist/types/relativeTime-mJaYEq7H.d.ts +0 -11
  752. package/dist/types/relativeTime-mJaYEq7H.d.ts.map +0 -1
  753. package/dist/types/removeContentNodeByKeyPath-CotCOOsD.d.ts +0 -8
  754. package/dist/types/removeContentNodeByKeyPath-CotCOOsD.d.ts.map +0 -1
  755. package/dist/types/renameContentNodeByKeyPath-BuyH5gOr.d.ts +0 -8
  756. package/dist/types/renameContentNodeByKeyPath-BuyH5gOr.d.ts.map +0 -1
  757. package/dist/types/renderer-C06x2Orf.d.ts +0 -22
  758. package/dist/types/renderer-C06x2Orf.d.ts.map +0 -1
  759. package/dist/types/rewriteUtils-Bd82NiGR.d.ts +0 -34
  760. package/dist/types/rewriteUtils-Bd82NiGR.d.ts.map +0 -1
  761. package/dist/types/splitAndJoinInsertion-bkuLa7o2.d.ts +0 -25
  762. package/dist/types/splitAndJoinInsertion-bkuLa7o2.d.ts.map +0 -1
  763. package/dist/types/translation-CiC-Avxc.d.ts +0 -33
  764. package/dist/types/translation-CiC-Avxc.d.ts.map +0 -1
  765. package/dist/types/types-C2Om0aEM.d.ts +0 -333
  766. package/dist/types/types-C2Om0aEM.d.ts.map +0 -1
  767. package/dist/types/units-CouGqa8j.d.ts +0 -16
  768. package/dist/types/units-CouGqa8j.d.ts.map +0 -1
  769. package/dist/types/updateNodeChildren-B5Tu1UBZ.d.ts +0 -7
  770. package/dist/types/updateNodeChildren-B5Tu1UBZ.d.ts.map +0 -1
  771. package/dist/types/utils-Dcmgh_80.d.ts +0 -140
  772. package/dist/types/utils-Dcmgh_80.d.ts.map +0 -1
  773. package/dist/types/validateHTML-U7UKTtFd.d.ts +0 -21
  774. package/dist/types/validateHTML-U7UKTtFd.d.ts.map +0 -1
  775. package/dist/types/validateMarkdown-BUaTDDIu.d.ts +0 -18
  776. package/dist/types/validateMarkdown-BUaTDDIu.d.ts.map +0 -1
  777. package/dist/types/validatePrefix-Dtmg7QLq.d.ts +0 -38
  778. package/dist/types/validatePrefix-Dtmg7QLq.d.ts.map +0 -1
  779. package/dist/types/vue-i18n-JtUB7N_m.d.ts +0 -9
  780. package/dist/types/vue-i18n-JtUB7N_m.d.ts.map +0 -1
@@ -1,2 +1,182 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);const e=require(`../interpreter/getContent/deepTransform.cjs`),t=require(`../transpiler/enumeration/enumeration.cjs`),n=require(`../transpiler/insertion/insertion.cjs`);let r=require(`@intlayer/types/nodeType`);const i=e=>{let t=0,n=[],r=``;for(;t<e.length;){let i=e[t];if(i===`{`){r&&=(n.push(r),``),t++;let i=``;for(;t<e.length&&e[t]!==`}`;)i+=e[t],t++;t<e.length&&t++,n.push({type:`argument`,name:i.trim()})}else r+=i,t++}return r&&n.push(r),n},a=e=>{let t=[],n=``,r=0;for(;r<e.length;){let i=e[r];i===`\\`&&r+1<e.length&&e[r+1]===`|`?(n+=`|`,r+=2):i===`|`?(t.push(n.trim()),n=``,r++):(n+=i,r++)}return t.push(n.trim()),t.map(i)},o=e=>{if(e.length===0)return``;if(e.length===1&&typeof e[0]==`string`)return e[0];let t=``;for(let n of e)typeof n==`string`?t+=n:t+=`{{${n.name}}}`;return n.insert(t)},s=e=>{if(e.length===1)return o(e[0]);let n={};return e.length===2?(n[1]=o(e[0]),n.fallback=o(e[1])):e.length===3?(n[0]=o(e[0]),n[1]=o(e[1]),n.fallback=o(e[2])):e.forEach((t,r)=>{r===e.length-1?n.fallback=o(t):n[r.toString()]=o(t)}),n.__intlayer_vue_i18n_var=`count`,t.enu(n)},c={canHandle:e=>typeof e==`string`&&(e.includes(`{`)||e.includes(`|`)),transform:e=>{try{return s(a(e))}catch{return e}}},l={canHandle:e=>{if(typeof e==`string`||e&&typeof e==`object`&&(e.nodeType===r.NodeType.Insertion||e.nodeType===r.NodeType.Enumeration||e.nodeType===r.NodeType.Gender||e.nodeType===`composite`))return!0;if(Array.isArray(e)){if(e.length===0)return!1;let t=!1,n=!1;for(let i of e)typeof i==`string`||(i&&typeof i==`object`&&(i.nodeType===r.NodeType.Insertion||i.nodeType===r.NodeType.Enumeration||i.nodeType===r.NodeType.Gender||i.nodeType===`composite`)?t=!0:n=!0);return!(n||!t)}return!1},transform:(e,t,n)=>{if(typeof e==`string`)return e.replace(/\{\{([^}]+)\}\}/g,`{$1}`);if(e.nodeType===r.NodeType.Insertion)return e.insertion.replace(/\{\{([^}]+)\}\}/g,`{$1}`);if(e.nodeType===r.NodeType.Enumeration){let r=e.enumeration,i={};for(let[e,a]of Object.entries(r)){if(e===`__intlayer_vue_i18n_var`)continue;let r=n(a,t);i[e]=typeof r==`string`?r:JSON.stringify(r)}let a=Object.keys(i);if(a.includes(`0`)){let e=a.filter(e=>/^\d+$/.test(e)).map(Number),t=Math.max(...e),n=i.fallback||i.other,r=[];if(t<=1&&!a.includes(`2`))return`${i[0]||``} | ${i[1]||``} | ${n}`;let o=Math.max(1,t);for(let e=0;e<=o;e++){let t=e.toString();i[t]?r.push(i[t]):r.push(``)}return r.push(n),r.join(` | `).replace(/ \| {2}\| /g,` | | `)}return a.includes(`1`)&&(a.includes(`fallback`)||a.includes(`other`))?`${i[1]} | ${i.fallback||i.other}`:a.length===1&&(a.includes(`fallback`)||a.includes(`other`))?i.fallback||i.other:i.fallback||Object.values(i)[0]}if(e.nodeType===r.NodeType.Gender){let r=e.gender,i={};for(let[e,a]of Object.entries(r)){let r=e;e===`fallback`&&(r=`other`),i[r]=n(a,t)}return i}return Array.isArray(e)||e.nodeType===`composite`&&Array.isArray(e.composite)?(Array.isArray(e)?e:e.composite).map(e=>n(e,t)).join(``):n(e,t)}},u=t=>e.deepTransformNode(t,{dictionaryKey:`vue-i18n`,keyPath:[],plugins:[{id:`vue-i18n`,...l}]}),d=t=>e.deepTransformNode(t,{dictionaryKey:`vue-i18n`,keyPath:[],plugins:[{id:`vue-i18n`,...c}]});exports.intlayerToVueI18nFormatter=u,exports.vueI18nToIntlayerFormatter=d;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_interpreter_getContent_deepTransform = require('../interpreter/getContent/deepTransform.cjs');
4
+ const require_transpiler_enumeration_enumeration = require('../transpiler/enumeration/enumeration.cjs');
5
+ const require_transpiler_insertion_insertion = require('../transpiler/insertion/insertion.cjs');
6
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
7
+ _intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
8
+
9
+ //#region src/messageFormat/vue-i18n.ts
10
+ const parseVueI18nPart = (text) => {
11
+ let index = 0;
12
+ const nodes = [];
13
+ let currentText = "";
14
+ while (index < text.length) {
15
+ const char = text[index];
16
+ if (char === "{") {
17
+ if (currentText) {
18
+ nodes.push(currentText);
19
+ currentText = "";
20
+ }
21
+ index++;
22
+ let name = "";
23
+ while (index < text.length && text[index] !== "}") {
24
+ name += text[index];
25
+ index++;
26
+ }
27
+ if (index < text.length) index++;
28
+ nodes.push({
29
+ type: "argument",
30
+ name: name.trim()
31
+ });
32
+ } else {
33
+ currentText += char;
34
+ index++;
35
+ }
36
+ }
37
+ if (currentText) nodes.push(currentText);
38
+ return nodes;
39
+ };
40
+ const parseVueI18n = (text) => {
41
+ const parts = [];
42
+ let currentPart = "";
43
+ let index = 0;
44
+ while (index < text.length) {
45
+ const char = text[index];
46
+ if (char === "\\" && index + 1 < text.length && text[index + 1] === "|") {
47
+ currentPart += "|";
48
+ index += 2;
49
+ } else if (char === "|") {
50
+ parts.push(currentPart.trim());
51
+ currentPart = "";
52
+ index++;
53
+ } else {
54
+ currentPart += char;
55
+ index++;
56
+ }
57
+ }
58
+ parts.push(currentPart.trim());
59
+ return parts.map(parseVueI18nPart);
60
+ };
61
+ const vueI18nPartToIntlayer = (nodes) => {
62
+ if (nodes.length === 0) return "";
63
+ if (nodes.length === 1 && typeof nodes[0] === "string") return nodes[0];
64
+ let str = "";
65
+ for (const node of nodes) if (typeof node === "string") str += node;
66
+ else str += `{{${node.name}}}`;
67
+ return require_transpiler_insertion_insertion.insert(str);
68
+ };
69
+ const vueI18nNodesToIntlayer = (parts) => {
70
+ if (parts.length === 1) return vueI18nPartToIntlayer(parts[0]);
71
+ const options = {};
72
+ const varName = "count";
73
+ if (parts.length === 2) {
74
+ options["1"] = vueI18nPartToIntlayer(parts[0]);
75
+ options.fallback = vueI18nPartToIntlayer(parts[1]);
76
+ } else if (parts.length === 3) {
77
+ options["0"] = vueI18nPartToIntlayer(parts[0]);
78
+ options["1"] = vueI18nPartToIntlayer(parts[1]);
79
+ options.fallback = vueI18nPartToIntlayer(parts[2]);
80
+ } else parts.forEach((part, index) => {
81
+ if (index === parts.length - 1) options.fallback = vueI18nPartToIntlayer(part);
82
+ else options[index.toString()] = vueI18nPartToIntlayer(part);
83
+ });
84
+ options.__intlayer_vue_i18n_var = varName;
85
+ return require_transpiler_enumeration_enumeration.enu(options);
86
+ };
87
+ const vueI18nToIntlayerPlugin = {
88
+ canHandle: (node) => typeof node === "string" && (node.includes("{") || node.includes("|")),
89
+ transform: (node) => {
90
+ try {
91
+ return vueI18nNodesToIntlayer(parseVueI18n(node));
92
+ } catch {
93
+ return node;
94
+ }
95
+ }
96
+ };
97
+ const intlayerToVueI18nPlugin = {
98
+ canHandle: (node) => {
99
+ if (typeof node === "string") return true;
100
+ if (node && typeof node === "object" && (node.nodeType === _intlayer_types_nodeType.INSERTION || node.nodeType === _intlayer_types_nodeType.ENUMERATION || node.nodeType === _intlayer_types_nodeType.GENDER || node.nodeType === "composite")) return true;
101
+ if (Array.isArray(node)) {
102
+ if (node.length === 0) return false;
103
+ let hasNode = false;
104
+ let hasPlainObjectOrArray = false;
105
+ for (const item of node) if (typeof item === "string") {} else if (item && typeof item === "object" && (item.nodeType === _intlayer_types_nodeType.INSERTION || item.nodeType === _intlayer_types_nodeType.ENUMERATION || item.nodeType === _intlayer_types_nodeType.GENDER || item.nodeType === "composite")) hasNode = true;
106
+ else hasPlainObjectOrArray = true;
107
+ if (hasPlainObjectOrArray) return false;
108
+ if (!hasNode) return false;
109
+ return true;
110
+ }
111
+ return false;
112
+ },
113
+ transform: (node, props, next) => {
114
+ if (typeof node === "string") return node.replace(/\{\{([^}]+)\}\}/g, "{$1}");
115
+ if (node.nodeType === _intlayer_types_nodeType.INSERTION) return node[_intlayer_types_nodeType.INSERTION].replace(/\{\{([^}]+)\}\}/g, "{$1}");
116
+ if (node.nodeType === _intlayer_types_nodeType.ENUMERATION) {
117
+ const options = node[_intlayer_types_nodeType.ENUMERATION];
118
+ const transformedOptions = {};
119
+ for (const [key, val] of Object.entries(options)) {
120
+ if (key === "__intlayer_vue_i18n_var") continue;
121
+ const childVal = next(val, props);
122
+ transformedOptions[key] = typeof childVal === "string" ? childVal : JSON.stringify(childVal);
123
+ }
124
+ const keys = Object.keys(transformedOptions);
125
+ if (keys.includes("0")) {
126
+ const indices = keys.filter((key) => /^\d+$/.test(key)).map(Number);
127
+ const maxIndex = Math.max(...indices);
128
+ const fallback = transformedOptions.fallback || transformedOptions.other;
129
+ const resultParts = [];
130
+ if (maxIndex <= 1 && !keys.includes("2")) return `${transformedOptions["0"] || ""} | ${transformedOptions["1"] || ""} | ${fallback}`;
131
+ const limit = Math.max(1, maxIndex);
132
+ for (let i = 0; i <= limit; i++) {
133
+ const key = i.toString();
134
+ if (transformedOptions[key]) resultParts.push(transformedOptions[key]);
135
+ else resultParts.push("");
136
+ }
137
+ resultParts.push(fallback);
138
+ return resultParts.join(" | ").replace(/ \| {2}\| /g, " | | ");
139
+ }
140
+ if (keys.includes("1") && (keys.includes("fallback") || keys.includes("other"))) return `${transformedOptions["1"]} | ${transformedOptions.fallback || transformedOptions.other}`;
141
+ if (keys.length === 1 && (keys.includes("fallback") || keys.includes("other"))) return transformedOptions.fallback || transformedOptions.other;
142
+ return transformedOptions.fallback || Object.values(transformedOptions)[0];
143
+ }
144
+ if (node.nodeType === _intlayer_types_nodeType.GENDER) {
145
+ const options = node[_intlayer_types_nodeType.GENDER];
146
+ const transformedOptions = {};
147
+ for (const [key, val] of Object.entries(options)) {
148
+ let newKey = key;
149
+ if (key === "fallback") newKey = "other";
150
+ transformedOptions[newKey] = next(val, props);
151
+ }
152
+ return transformedOptions;
153
+ }
154
+ if (Array.isArray(node) || node.nodeType === "composite" && Array.isArray(node.composite)) return (Array.isArray(node) ? node : node.composite).map((item) => next(item, props)).join("");
155
+ return next(node, props);
156
+ }
157
+ };
158
+ const intlayerToVueI18nFormatter = (message) => {
159
+ return require_interpreter_getContent_deepTransform.deepTransformNode(message, {
160
+ dictionaryKey: "vue-i18n",
161
+ keyPath: [],
162
+ plugins: [{
163
+ id: "vue-i18n",
164
+ ...intlayerToVueI18nPlugin
165
+ }]
166
+ });
167
+ };
168
+ const vueI18nToIntlayerFormatter = (message) => {
169
+ return require_interpreter_getContent_deepTransform.deepTransformNode(message, {
170
+ dictionaryKey: "vue-i18n",
171
+ keyPath: [],
172
+ plugins: [{
173
+ id: "vue-i18n",
174
+ ...vueI18nToIntlayerPlugin
175
+ }]
176
+ });
177
+ };
178
+
179
+ //#endregion
180
+ exports.intlayerToVueI18nFormatter = intlayerToVueI18nFormatter;
181
+ exports.vueI18nToIntlayerFormatter = vueI18nToIntlayerFormatter;
2
182
  //# sourceMappingURL=vue-i18n.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"vue-i18n.cjs","names":["insert","enu","NodeType","deepTransformNode"],"sources":["../../../src/messageFormat/vue-i18n.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\n\nimport { NodeType } from '@intlayer/types/nodeType';\nimport { deepTransformNode } from '../interpreter';\nimport { enu, insert } from '../transpiler';\nimport type { JsonValue } from './ICU';\n\n// Types for our AST\ntype VueI18nNode =\n | string\n | {\n type: 'argument';\n name: string;\n };\n\nconst parseVueI18nPart = (text: string): VueI18nNode[] => {\n let index = 0;\n const nodes: VueI18nNode[] = [];\n let currentText = '';\n\n while (index < text.length) {\n const char = text[index];\n\n if (char === '{') {\n if (currentText) {\n nodes.push(currentText);\n currentText = '';\n }\n index++; // skip {\n let name = '';\n while (index < text.length && text[index] !== '}') {\n name += text[index];\n index++;\n }\n if (index < text.length) {\n index++; // skip }\n }\n nodes.push({ type: 'argument', name: name.trim() });\n } else {\n currentText += char;\n index++;\n }\n }\n\n if (currentText) {\n nodes.push(currentText);\n }\n\n return nodes;\n};\n\nconst parseVueI18n = (text: string): VueI18nNode[][] => {\n // Split by | but handle escaped \\|\n const parts: string[] = [];\n let currentPart = '';\n let index = 0;\n\n while (index < text.length) {\n const char = text[index];\n if (char === '\\\\' && index + 1 < text.length && text[index + 1] === '|') {\n currentPart += '|';\n index += 2;\n } else if (char === '|') {\n parts.push(currentPart.trim()); // Trim to remove surrounding spaces\n currentPart = '';\n index++;\n } else {\n currentPart += char;\n index++;\n }\n }\n parts.push(currentPart.trim()); // Trim last part too\n\n return parts.map(parseVueI18nPart);\n};\n\nconst vueI18nPartToIntlayer = (nodes: VueI18nNode[]): any => {\n if (nodes.length === 0) return '';\n if (nodes.length === 1 && typeof nodes[0] === 'string') return nodes[0];\n\n let str = '';\n for (const node of nodes) {\n if (typeof node === 'string') {\n str += node;\n } else {\n str += `{{${node.name}}}`;\n }\n }\n return insert(str);\n};\n\nconst vueI18nNodesToIntlayer = (parts: VueI18nNode[][]): any => {\n if (parts.length === 1) {\n return vueI18nPartToIntlayer(parts[0]);\n }\n\n // Handle pluralization (choice)\n const options: Record<string, any> = {};\n const varName = 'count'; // Default variable for vue-i18n choices\n\n if (parts.length === 2) {\n // 2 choices: 1 | other\n options['1'] = vueI18nPartToIntlayer(parts[0]);\n options.fallback = vueI18nPartToIntlayer(parts[1]);\n } else if (parts.length === 3) {\n // 3 choices: 0 | 1 | other\n options['0'] = vueI18nPartToIntlayer(parts[0]);\n options['1'] = vueI18nPartToIntlayer(parts[1]);\n options.fallback = vueI18nPartToIntlayer(parts[2]);\n } else {\n // > 3 choices: 0 | 1 | 2 | ... | other\n parts.forEach((part, index) => {\n if (index === parts.length - 1) {\n options.fallback = vueI18nPartToIntlayer(part);\n } else {\n options[index.toString()] = vueI18nPartToIntlayer(part);\n }\n });\n }\n\n // Preserve variable name\n options.__intlayer_vue_i18n_var = varName;\n\n return enu(options);\n};\n\nconst vueI18nToIntlayerPlugin = {\n canHandle: (node: any) =>\n typeof node === 'string' && (node.includes('{') || node.includes('|')),\n transform: (node: any) => {\n try {\n const ast = parseVueI18n(node);\n return vueI18nNodesToIntlayer(ast);\n } catch {\n return node;\n }\n },\n};\n\nconst intlayerToVueI18nPlugin = {\n canHandle: (node: any) => {\n if (typeof node === 'string') return true;\n\n if (\n node &&\n typeof node === 'object' &&\n (node.nodeType === NodeType.Insertion ||\n node.nodeType === NodeType.Enumeration ||\n node.nodeType === NodeType.Gender ||\n node.nodeType === 'composite')\n ) {\n return true;\n }\n\n if (Array.isArray(node)) {\n if (node.length === 0) return false;\n\n let hasNode = false;\n let hasPlainObjectOrArray = false;\n\n for (const item of node) {\n if (typeof item === 'string') {\n } else if (\n item &&\n typeof item === 'object' &&\n (item.nodeType === NodeType.Insertion ||\n item.nodeType === NodeType.Enumeration ||\n item.nodeType === NodeType.Gender ||\n item.nodeType === 'composite')\n ) {\n hasNode = true;\n } else {\n hasPlainObjectOrArray = true;\n }\n }\n\n // If it contains plain objects or nested arrays, it's a structural array\n if (hasPlainObjectOrArray) return false;\n // If it contains ONLY strings, it's a structural array, not a composite string\n if (!hasNode) return false;\n\n return true;\n }\n\n return false;\n },\n transform: (node: any, props: any, next: any) => {\n if (typeof node === 'string') {\n // replace {{...}} with {...} even in strings\n return node.replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n }\n\n if (node.nodeType === NodeType.Insertion) {\n // {{name}} -> {name}\n return node.insertion.replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n }\n\n if (node.nodeType === NodeType.Enumeration) {\n const options = node.enumeration;\n\n const transformedOptions: Record<string, string> = {};\n for (const [key, val] of Object.entries(options)) {\n if (key === '__intlayer_vue_i18n_var') continue;\n const childVal = next(val, props);\n transformedOptions[key] =\n typeof childVal === 'string' ? childVal : JSON.stringify(childVal);\n }\n\n const keys = Object.keys(transformedOptions);\n\n if (keys.includes('0')) {\n const indices = keys.filter((key) => /^\\d+$/.test(key)).map(Number);\n const maxIndex = Math.max(...indices);\n\n const fallback =\n transformedOptions.fallback || transformedOptions.other;\n const resultParts = [];\n\n if (maxIndex <= 1 && !keys.includes('2')) {\n const zero = transformedOptions['0'] || '';\n const one = transformedOptions['1'] || '';\n return `${zero} | ${one} | ${fallback}`;\n }\n\n const limit = Math.max(1, maxIndex);\n\n for (let i = 0; i <= limit; i++) {\n const key = i.toString();\n if (transformedOptions[key]) {\n resultParts.push(transformedOptions[key]);\n } else {\n resultParts.push('');\n }\n }\n resultParts.push(fallback);\n return resultParts.join(' | ').replace(/ \\| {2}\\| /g, ' | | ');\n }\n\n if (\n keys.includes('1') &&\n (keys.includes('fallback') || keys.includes('other'))\n ) {\n return `${transformedOptions['1']} | ${transformedOptions.fallback || transformedOptions.other}`;\n }\n\n if (\n keys.length === 1 &&\n (keys.includes('fallback') || keys.includes('other'))\n ) {\n return transformedOptions.fallback || transformedOptions.other;\n }\n\n return (\n transformedOptions.fallback || Object.values(transformedOptions)[0]\n );\n }\n\n if (node.nodeType === NodeType.Gender) {\n const options = node.gender;\n const transformedOptions: Record<string, any> = {};\n\n for (const [key, val] of Object.entries(options)) {\n let newKey = key;\n if (key === 'fallback') newKey = 'other';\n\n const childVal = next(val, props);\n transformedOptions[newKey] = childVal;\n }\n return transformedOptions;\n }\n\n if (\n Array.isArray(node) ||\n (node.nodeType === 'composite' && Array.isArray(node.composite))\n ) {\n const arr = Array.isArray(node) ? node : node.composite;\n const items = arr.map((item: any) => next(item, props));\n return items.join('');\n }\n\n return next(node, props);\n },\n};\n\nexport const intlayerToVueI18nFormatter = (\n message: Dictionary['content']\n): JsonValue => {\n return deepTransformNode(message, {\n dictionaryKey: 'vue-i18n',\n keyPath: [],\n plugins: [{ id: 'vue-i18n', ...intlayerToVueI18nPlugin }],\n });\n};\n\nexport const vueI18nToIntlayerFormatter = (\n message: JsonValue\n): Dictionary['content'] => {\n return deepTransformNode(message, {\n dictionaryKey: 'vue-i18n',\n keyPath: [],\n plugins: [{ id: 'vue-i18n', ...vueI18nToIntlayerPlugin }],\n });\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"vue-i18n.cjs","names":["insert","enu","NodeTypes","deepTransformNode"],"sources":["../../../src/messageFormat/vue-i18n.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { deepTransformNode } from '../interpreter';\nimport { enu, insert } from '../transpiler';\nimport type { JsonValue } from './ICU';\n\n// Types for our AST\ntype VueI18nNode =\n | string\n | {\n type: 'argument';\n name: string;\n };\n\nconst parseVueI18nPart = (text: string): VueI18nNode[] => {\n let index = 0;\n const nodes: VueI18nNode[] = [];\n let currentText = '';\n\n while (index < text.length) {\n const char = text[index];\n\n if (char === '{') {\n if (currentText) {\n nodes.push(currentText);\n currentText = '';\n }\n index++; // skip {\n let name = '';\n while (index < text.length && text[index] !== '}') {\n name += text[index];\n index++;\n }\n if (index < text.length) {\n index++; // skip }\n }\n nodes.push({ type: 'argument', name: name.trim() });\n } else {\n currentText += char;\n index++;\n }\n }\n\n if (currentText) {\n nodes.push(currentText);\n }\n\n return nodes;\n};\n\nconst parseVueI18n = (text: string): VueI18nNode[][] => {\n // Split by | but handle escaped \\|\n const parts: string[] = [];\n let currentPart = '';\n let index = 0;\n\n while (index < text.length) {\n const char = text[index];\n if (char === '\\\\' && index + 1 < text.length && text[index + 1] === '|') {\n currentPart += '|';\n index += 2;\n } else if (char === '|') {\n parts.push(currentPart.trim()); // Trim to remove surrounding spaces\n currentPart = '';\n index++;\n } else {\n currentPart += char;\n index++;\n }\n }\n parts.push(currentPart.trim()); // Trim last part too\n\n return parts.map(parseVueI18nPart);\n};\n\nconst vueI18nPartToIntlayer = (nodes: VueI18nNode[]): any => {\n if (nodes.length === 0) return '';\n if (nodes.length === 1 && typeof nodes[0] === 'string') return nodes[0];\n\n let str = '';\n for (const node of nodes) {\n if (typeof node === 'string') {\n str += node;\n } else {\n str += `{{${node.name}}}`;\n }\n }\n return insert(str);\n};\n\nconst vueI18nNodesToIntlayer = (parts: VueI18nNode[][]): any => {\n if (parts.length === 1) {\n return vueI18nPartToIntlayer(parts[0]);\n }\n\n // Handle pluralization (choice)\n const options: Record<string, any> = {};\n const varName = 'count'; // Default variable for vue-i18n choices\n\n if (parts.length === 2) {\n // 2 choices: 1 | other\n options['1'] = vueI18nPartToIntlayer(parts[0]);\n options.fallback = vueI18nPartToIntlayer(parts[1]);\n } else if (parts.length === 3) {\n // 3 choices: 0 | 1 | other\n options['0'] = vueI18nPartToIntlayer(parts[0]);\n options['1'] = vueI18nPartToIntlayer(parts[1]);\n options.fallback = vueI18nPartToIntlayer(parts[2]);\n } else {\n // > 3 choices: 0 | 1 | 2 | ... | other\n parts.forEach((part, index) => {\n if (index === parts.length - 1) {\n options.fallback = vueI18nPartToIntlayer(part);\n } else {\n options[index.toString()] = vueI18nPartToIntlayer(part);\n }\n });\n }\n\n // Preserve variable name\n options.__intlayer_vue_i18n_var = varName;\n\n return enu(options);\n};\n\nconst vueI18nToIntlayerPlugin = {\n canHandle: (node: any) =>\n typeof node === 'string' && (node.includes('{') || node.includes('|')),\n transform: (node: any) => {\n try {\n const ast = parseVueI18n(node);\n return vueI18nNodesToIntlayer(ast);\n } catch {\n return node;\n }\n },\n};\n\nconst intlayerToVueI18nPlugin = {\n canHandle: (node: any) => {\n if (typeof node === 'string') return true;\n\n if (\n node &&\n typeof node === 'object' &&\n (node.nodeType === NodeTypes.INSERTION ||\n node.nodeType === NodeTypes.ENUMERATION ||\n node.nodeType === NodeTypes.GENDER ||\n node.nodeType === 'composite')\n ) {\n return true;\n }\n\n if (Array.isArray(node)) {\n if (node.length === 0) return false;\n\n let hasNode = false;\n let hasPlainObjectOrArray = false;\n\n for (const item of node) {\n if (typeof item === 'string') {\n } else if (\n item &&\n typeof item === 'object' &&\n (item.nodeType === NodeTypes.INSERTION ||\n item.nodeType === NodeTypes.ENUMERATION ||\n item.nodeType === NodeTypes.GENDER ||\n item.nodeType === 'composite')\n ) {\n hasNode = true;\n } else {\n hasPlainObjectOrArray = true;\n }\n }\n\n // If it contains plain objects or nested arrays, it's a structural array\n if (hasPlainObjectOrArray) return false;\n // If it contains ONLY strings, it's a structural array, not a composite string\n if (!hasNode) return false;\n\n return true;\n }\n\n return false;\n },\n transform: (node: any, props: any, next: any) => {\n if (typeof node === 'string') {\n // replace {{...}} with {...} even in strings\n return node.replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n }\n\n if (node.nodeType === NodeTypes.INSERTION) {\n // {{name}} -> {name}\n return node[NodeTypes.INSERTION].replace(/\\{\\{([^}]+)\\}\\}/g, '{$1}');\n }\n\n if (node.nodeType === NodeTypes.ENUMERATION) {\n const options = node[NodeTypes.ENUMERATION];\n\n const transformedOptions: Record<string, string> = {};\n for (const [key, val] of Object.entries(options)) {\n if (key === '__intlayer_vue_i18n_var') continue;\n const childVal = next(val, props);\n transformedOptions[key] =\n typeof childVal === 'string' ? childVal : JSON.stringify(childVal);\n }\n\n const keys = Object.keys(transformedOptions);\n\n if (keys.includes('0')) {\n const indices = keys.filter((key) => /^\\d+$/.test(key)).map(Number);\n const maxIndex = Math.max(...indices);\n\n const fallback =\n transformedOptions.fallback || transformedOptions.other;\n const resultParts = [];\n\n if (maxIndex <= 1 && !keys.includes('2')) {\n const zero = transformedOptions['0'] || '';\n const one = transformedOptions['1'] || '';\n return `${zero} | ${one} | ${fallback}`;\n }\n\n const limit = Math.max(1, maxIndex);\n\n for (let i = 0; i <= limit; i++) {\n const key = i.toString();\n if (transformedOptions[key]) {\n resultParts.push(transformedOptions[key]);\n } else {\n resultParts.push('');\n }\n }\n resultParts.push(fallback);\n return resultParts.join(' | ').replace(/ \\| {2}\\| /g, ' | | ');\n }\n\n if (\n keys.includes('1') &&\n (keys.includes('fallback') || keys.includes('other'))\n ) {\n return `${transformedOptions['1']} | ${transformedOptions.fallback || transformedOptions.other}`;\n }\n\n if (\n keys.length === 1 &&\n (keys.includes('fallback') || keys.includes('other'))\n ) {\n return transformedOptions.fallback || transformedOptions.other;\n }\n\n return (\n transformedOptions.fallback || Object.values(transformedOptions)[0]\n );\n }\n\n if (node.nodeType === NodeTypes.GENDER) {\n const options = node[NodeTypes.GENDER];\n const transformedOptions: Record<string, any> = {};\n\n for (const [key, val] of Object.entries(options)) {\n let newKey = key;\n if (key === 'fallback') newKey = 'other';\n\n const childVal = next(val, props);\n transformedOptions[newKey] = childVal;\n }\n return transformedOptions;\n }\n\n if (\n Array.isArray(node) ||\n (node.nodeType === 'composite' && Array.isArray(node.composite))\n ) {\n const arr = Array.isArray(node) ? node : node.composite;\n const items = arr.map((item: any) => next(item, props));\n return items.join('');\n }\n\n return next(node, props);\n },\n};\n\nexport const intlayerToVueI18nFormatter = (\n message: Dictionary['content']\n): JsonValue => {\n return deepTransformNode(message, {\n dictionaryKey: 'vue-i18n',\n keyPath: [],\n plugins: [{ id: 'vue-i18n', ...intlayerToVueI18nPlugin }],\n });\n};\n\nexport const vueI18nToIntlayerFormatter = (\n message: JsonValue\n): Dictionary['content'] => {\n return deepTransformNode(message, {\n dictionaryKey: 'vue-i18n',\n keyPath: [],\n plugins: [{ id: 'vue-i18n', ...vueI18nToIntlayerPlugin }],\n });\n};\n"],"mappings":"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"}
@@ -1,2 +1,27 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=t=>(0,e.formatNodeType)(e.NodeType.Condition,t);exports.cond=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
4
+
5
+ //#region src/transpiler/condition/condition.ts
6
+ /**
7
+ * Function intended to be used to build intlayer dictionaries.
8
+ *
9
+ * Allow to pick a content based on a condition.
10
+ *
11
+ * Usage:
12
+ *
13
+ * ```ts
14
+ * cond({
15
+ * 'true': 'The condition is validated',
16
+ * 'false': 'The condition is not validated',
17
+ * });
18
+ * ```
19
+ *
20
+ * The last key provided will be used as the fallback value.
21
+ *
22
+ */
23
+ const condition = (content) => (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.CONDITION, content);
24
+
25
+ //#endregion
26
+ exports.cond = condition;
2
27
  //# sourceMappingURL=condition.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"condition.cjs","names":["NodeType"],"sources":["../../../../src/transpiler/condition/condition.ts"],"sourcesContent":["import { formatNodeType, NodeType } from '@intlayer/types/nodeType';\nimport type { TypedNodeModel } from '@intlayer/types/nodeType';;\n\nexport type ConditionContentStates<Content> = Record<`${boolean}`, Content> & {\n fallback?: Content;\n};\n\nexport type ConditionContent<Content = unknown> = TypedNodeModel<\n NodeType.Condition,\n ConditionContentStates<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a condition.\n *\n * Usage:\n *\n * ```ts\n * cond({\n * 'true': 'The condition is validated',\n * 'false': 'The condition is not validated',\n * });\n * ```\n *\n * The last key provided will be used as the fallback value.\n *\n */\nconst condition = <Content>(content?: ConditionContentStates<Content>) =>\n formatNodeType(NodeType.Condition, content);\n\nexport { condition as cond };\n"],"mappings":"iJA6BA,MAAM,EAAsB,IAAA,EAAA,EAAA,gBACXA,EAAAA,SAAS,UAAW,EAAQ"}
1
+ {"version":3,"file":"condition.cjs","names":["CONDITION"],"sources":["../../../../src/transpiler/condition/condition.ts"],"sourcesContent":["import type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { CONDITION, formatNodeType } from '@intlayer/types/nodeType';\n\nexport type ConditionContentStates<Content> = Record<`${boolean}`, Content> & {\n fallback?: Content;\n};\n\nexport type ConditionContent<Content = unknown> = TypedNodeModel<\n typeof CONDITION,\n ConditionContentStates<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a condition.\n *\n * Usage:\n *\n * ```ts\n * cond({\n * 'true': 'The condition is validated',\n * 'false': 'The condition is not validated',\n * });\n * ```\n *\n * The last key provided will be used as the fallback value.\n *\n */\nconst condition = <Content>(content?: ConditionContentStates<Content>) =>\n formatNodeType(CONDITION, content);\n\nexport { condition as cond };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,aAAsB,yDACXA,oCAAW,QAAQ"}
@@ -1 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./condition.cjs`);exports.cond=e.cond;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_transpiler_condition_condition = require('./condition.cjs');
3
+
4
+ exports.cond = require_transpiler_condition_condition.cond;
@@ -1,2 +1,29 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=t=>(0,e.formatNodeType)(e.NodeType.Enumeration,t);exports.enu=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
4
+
5
+ //#region src/transpiler/enumeration/enumeration.ts
6
+ /**
7
+ * Function intended to be used to build intlayer dictionaries.
8
+ *
9
+ * Allow to pick a content based on a quantity.
10
+ *
11
+ * Usage:
12
+ *
13
+ * ```ts
14
+ * enu({
15
+ * '<=-2.3': 'You have less than -2.3',
16
+ * '<1': 'You have less than one',
17
+ * '2': 'You have two',
18
+ * '>=3': 'You have three or more',
19
+ * });
20
+ * ```
21
+ *
22
+ * > The order of the keys will define the priority of the content.
23
+ *
24
+ */
25
+ const enumeration = (content) => (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.ENUMERATION, content);
26
+
27
+ //#endregion
28
+ exports.enu = enumeration;
2
29
  //# sourceMappingURL=enumeration.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"enumeration.cjs","names":["NodeType"],"sources":["../../../../src/transpiler/enumeration/enumeration.ts"],"sourcesContent":["import type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { formatNodeType, NodeType } from '@intlayer/types/nodeType';\n\ntype Positive = number | `${number}`;\ntype Negative = `-${number}`;\ntype Numbers = Positive | Negative;\n\ntype Equal = Numbers;\ntype EqualString = `=${Numbers}`;\ntype Superior = `>${Numbers}`;\ntype SuperiorOrEqual = `>=${Numbers}`;\ntype Inferior = `<${Numbers}`;\ntype InferiorOrEqual = `<=${Numbers}`;\n\nexport type EnterFormat =\n | Equal\n | EqualString\n | Superior\n | SuperiorOrEqual\n | Inferior\n | InferiorOrEqual;\n\nexport type EnumerationContentState<Content> = Partial<\n Record<EnterFormat, Content>\n> & {\n fallback?: Content;\n};\n\nexport type EnumerationContent<Content = unknown> = TypedNodeModel<\n NodeType.Enumeration,\n EnumerationContentState<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * enu({\n * '<=-2.3': 'You have less than -2.3',\n * '<1': 'You have less than one',\n * '2': 'You have two',\n * '>=3': 'You have three or more',\n * });\n * ```\n *\n * > The order of the keys will define the priority of the content.\n *\n */\nconst enumeration = <Content = unknown>(\n content?: EnumerationContentState<Content>\n) => formatNodeType(NodeType.Enumeration, content);\n\nexport { enumeration as enu };\n"],"mappings":"iJAoDA,MAAM,EACJ,IAAA,EAAA,EAAA,gBACkBA,EAAAA,SAAS,YAAa,EAAQ"}
1
+ {"version":3,"file":"enumeration.cjs","names":["ENUMERATION"],"sources":["../../../../src/transpiler/enumeration/enumeration.ts"],"sourcesContent":["import type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { ENUMERATION, formatNodeType } from '@intlayer/types/nodeType';\n\ntype Positive = number | `${number}`;\ntype Negative = `-${number}`;\ntype Numbers = Positive | Negative;\n\ntype Equal = Numbers;\ntype EqualString = `=${Numbers}`;\ntype Superior = `>${Numbers}`;\ntype SuperiorOrEqual = `>=${Numbers}`;\ntype Inferior = `<${Numbers}`;\ntype InferiorOrEqual = `<=${Numbers}`;\n\nexport type EnterFormat =\n | Equal\n | EqualString\n | Superior\n | SuperiorOrEqual\n | Inferior\n | InferiorOrEqual;\n\nexport type EnumerationContentState<Content> = Partial<\n Record<EnterFormat, Content>\n> & {\n fallback?: Content;\n};\n\nexport type EnumerationContent<Content = unknown> = TypedNodeModel<\n typeof ENUMERATION,\n EnumerationContentState<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * enu({\n * '<=-2.3': 'You have less than -2.3',\n * '<1': 'You have less than one',\n * '2': 'You have two',\n * '>=3': 'You have three or more',\n * });\n * ```\n *\n * > The order of the keys will define the priority of the content.\n *\n */\nconst enumeration = <Content = unknown>(\n content?: EnumerationContentState<Content>\n) => formatNodeType(ENUMERATION, content);\n\nexport { enumeration as enu };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,eACJ,yDACkBA,sCAAa,QAAQ"}
@@ -1 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./enumeration.cjs`);exports.enu=e.enu;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_transpiler_enumeration_enumeration = require('./enumeration.cjs');
3
+
4
+ exports.enu = require_transpiler_enumeration_enumeration.enu;
@@ -1,2 +1,52 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`),t=require(`@intlayer/config/logger`),n=require(`node:fs`),r=require(`node:path`);const i=(i,a,o)=>{let s=i.startsWith(`./`)||i.startsWith(`../`),c=(0,t.getAppLogger)(),l;if((0,r.isAbsolute)(i)?(c(`Using absolute path for file is not recommended. Use relative paths instead. Path: ${i}, imported from: ${a}`,{level:`warn`}),l=i):l=s?(0,r.resolve)(a,i):(0,r.resolve)(o,i),(0,n.existsSync)(l)&&(0,n.statSync)(l).isFile())try{let t=(0,n.readFileSync)(l,`utf8`);return(0,e.formatNodeType)(e.NodeType.File,i,{content:t,fixedPath:(0,r.relative)(o,l)})}catch{c(`Unable to read path: ${(0,t.colorizePath)((0,r.relative)(o,l))}`,{level:`warn`})}else c(`File not found: ${(0,t.colorizePath)((0,r.relative)(o,l))}`,{level:`warn`});return(0,e.formatNodeType)(e.NodeType.File,i,{content:`-`})},a=e=>{let{INTLAYER_FILE_PATH:t,INTLAYER_BASE_DIR:n}=globalThis;return i(e,(0,r.dirname)(t),n)};exports.file=a,exports.fileContent=i;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
4
+ let _intlayer_config_logger = require("@intlayer/config/logger");
5
+ let node_fs = require("node:fs");
6
+ let node_path = require("node:path");
7
+
8
+ //#region src/transpiler/file/file.ts
9
+ const fileContent = (path, callerDir, baseDir) => {
10
+ const isRelativePath = path.startsWith("./") || path.startsWith("../");
11
+ const appLogger = (0, _intlayer_config_logger.getAppLogger)();
12
+ let filePath;
13
+ if ((0, node_path.isAbsolute)(path)) {
14
+ appLogger(`Using absolute path for file is not recommended. Use relative paths instead. Path: ${path}, imported from: ${callerDir}`, { level: "warn" });
15
+ filePath = path;
16
+ } else if (isRelativePath) filePath = (0, node_path.resolve)(callerDir, path);
17
+ else filePath = (0, node_path.resolve)(baseDir, path);
18
+ if ((0, node_fs.existsSync)(filePath) && (0, node_fs.statSync)(filePath).isFile()) try {
19
+ return (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.FILE, path, {
20
+ content: (0, node_fs.readFileSync)(filePath, "utf8"),
21
+ fixedPath: (0, node_path.relative)(baseDir, filePath)
22
+ });
23
+ } catch {
24
+ appLogger(`Unable to read path: ${(0, _intlayer_config_logger.colorizePath)((0, node_path.relative)(baseDir, filePath))}`, { level: "warn" });
25
+ }
26
+ else appLogger(`File not found: ${(0, _intlayer_config_logger.colorizePath)((0, node_path.relative)(baseDir, filePath))}`, { level: "warn" });
27
+ return (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.FILE, path, { content: `-` });
28
+ };
29
+ /**
30
+ * Function intended to be used to build intlayer dictionaries.
31
+ *
32
+ * Allow identify the usage of an external resource.
33
+ *
34
+ * Usage:
35
+ *
36
+ * ```ts
37
+ * file('/path/to/file.md') // absolute path
38
+ *
39
+ * // or
40
+ *
41
+ * file('path/to/file.md') // relative path
42
+ * ```
43
+ */
44
+ const file = (path) => {
45
+ const { INTLAYER_FILE_PATH, INTLAYER_BASE_DIR } = globalThis;
46
+ return fileContent(path, (0, node_path.dirname)(INTLAYER_FILE_PATH), INTLAYER_BASE_DIR);
47
+ };
48
+
49
+ //#endregion
50
+ exports.file = file;
51
+ exports.fileContent = fileContent;
2
52
  //# sourceMappingURL=file.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"file.cjs","names":["NodeType"],"sources":["../../../../src/transpiler/file/file.ts"],"sourcesContent":["import { existsSync, readFileSync, statSync } from 'node:fs';\nimport { dirname, isAbsolute, relative, resolve } from 'node:path';\nimport { colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { formatNodeType, NodeType } from '@intlayer/types/nodeType';\n\nexport type FileContentConstructor<T extends Record<string, any> = {}> =\n TypedNodeModel<NodeType.File, string, T>;\n\nexport type FileContent = FileContentConstructor<{\n content: string;\n fixedPath?: string;\n}>;\n\nexport const fileContent = (\n path: string,\n callerDir: string,\n baseDir: string\n): FileContent => {\n const isRelativePath = path.startsWith('./') || path.startsWith('../');\n const appLogger = getAppLogger();\n\n let filePath: string;\n if (isAbsolute(path)) {\n appLogger(\n `Using absolute path for file is not recommended. Use relative paths instead. Path: ${path}, imported from: ${callerDir}`,\n { level: 'warn' }\n );\n filePath = path;\n } else if (isRelativePath) {\n filePath = resolve(callerDir, path);\n } else {\n filePath = resolve(baseDir, path);\n }\n\n if (existsSync(filePath) && statSync(filePath).isFile()) {\n try {\n const content = readFileSync(filePath, 'utf8');\n\n return formatNodeType(NodeType.File, path, {\n content,\n fixedPath: relative(baseDir, filePath),\n });\n } catch {\n appLogger(\n `Unable to read path: ${colorizePath(relative(baseDir, filePath))}`,\n { level: 'warn' }\n );\n }\n } else {\n appLogger(`File not found: ${colorizePath(relative(baseDir, filePath))}`, {\n level: 'warn',\n });\n }\n\n return formatNodeType(NodeType.File, path, {\n content: `-`,\n });\n};\n\ntype GlobalIntlayerFilePath = {\n INTLAYER_FILE_PATH: string;\n INTLAYER_BASE_DIR: string;\n};\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow identify the usage of an external resource.\n *\n * Usage:\n *\n * ```ts\n * file('/path/to/file.md') // absolute path\n *\n * // or\n *\n * file('path/to/file.md') // relative path\n * ```\n */\nexport const file = (path: string): FileContent => {\n const { INTLAYER_FILE_PATH, INTLAYER_BASE_DIR } =\n globalThis as unknown as GlobalIntlayerFilePath;\n\n const callerDir = dirname(INTLAYER_FILE_PATH);\n const baseDir = INTLAYER_BASE_DIR;\n\n return fileContent(path, callerDir, baseDir);\n};\n"],"mappings":"kOAcA,MAAa,GACX,EACA,EACA,IACgB,CAChB,IAAM,EAAiB,EAAK,WAAW,KAAK,EAAI,EAAK,WAAW,MAAM,CAChE,GAAA,EAAA,EAAA,eAA0B,CAE5B,EAaJ,IAZA,EAAA,EAAA,YAAe,EAAK,EAClB,EACE,sFAAsF,EAAK,mBAAmB,IAC9G,CAAE,MAAO,OAAQ,CAClB,CACD,EAAW,GAIX,EAHS,GACT,EAAA,EAAA,SAAmB,EAAW,EAAK,EAEnC,EAAA,EAAA,SAAmB,EAAS,EAAK,EAGnC,EAAA,EAAA,YAAe,EAAS,GAAA,EAAA,EAAA,UAAa,EAAS,CAAC,QAAQ,CACrD,GAAI,CACF,IAAM,GAAA,EAAA,EAAA,cAAuB,EAAU,OAAO,CAE9C,OAAA,EAAA,EAAA,gBAAsBA,EAAAA,SAAS,KAAM,EAAM,CACzC,UACA,WAAA,EAAA,EAAA,UAAoB,EAAS,EAAS,CACvC,CAAC,MACI,CACN,EACE,yBAAA,EAAA,EAAA,eAAA,EAAA,EAAA,UAA8C,EAAS,EAAS,CAAC,GACjE,CAAE,MAAO,OAAQ,CAClB,MAGH,EAAU,oBAAA,EAAA,EAAA,eAAA,EAAA,EAAA,UAAyC,EAAS,EAAS,CAAC,GAAI,CACxE,MAAO,OACR,CAAC,CAGJ,OAAA,EAAA,EAAA,gBAAsBA,EAAAA,SAAS,KAAM,EAAM,CACzC,QAAS,IACV,CAAC,EAuBS,EAAQ,GAA8B,CACjD,GAAM,CAAE,qBAAoB,qBAC1B,WAKF,OAAO,EAAY,GAAA,EAAA,EAAA,SAHO,EAAmB,CAC7B,EAE4B"}
1
+ {"version":3,"file":"file.cjs","names":["FILE"],"sources":["../../../../src/transpiler/file/file.ts"],"sourcesContent":["import { existsSync, readFileSync, statSync } from 'node:fs';\nimport { dirname, isAbsolute, relative, resolve } from 'node:path';\nimport { colorizePath, getAppLogger } from '@intlayer/config/logger';\nimport type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { FILE, formatNodeType } from '@intlayer/types/nodeType';\n\nexport type FileContentConstructor<T extends Record<string, any> = {}> =\n TypedNodeModel<typeof FILE, string, T>;\n\nexport type FileContent = FileContentConstructor<{\n content: string;\n fixedPath?: string;\n}>;\n\nexport const fileContent = (\n path: string,\n callerDir: string,\n baseDir: string\n): FileContent => {\n const isRelativePath = path.startsWith('./') || path.startsWith('../');\n const appLogger = getAppLogger();\n\n let filePath: string;\n if (isAbsolute(path)) {\n appLogger(\n `Using absolute path for file is not recommended. Use relative paths instead. Path: ${path}, imported from: ${callerDir}`,\n { level: 'warn' }\n );\n filePath = path;\n } else if (isRelativePath) {\n filePath = resolve(callerDir, path);\n } else {\n filePath = resolve(baseDir, path);\n }\n\n if (existsSync(filePath) && statSync(filePath).isFile()) {\n try {\n const content = readFileSync(filePath, 'utf8');\n\n return formatNodeType(FILE, path, {\n content,\n fixedPath: relative(baseDir, filePath),\n });\n } catch {\n appLogger(\n `Unable to read path: ${colorizePath(relative(baseDir, filePath))}`,\n { level: 'warn' }\n );\n }\n } else {\n appLogger(`File not found: ${colorizePath(relative(baseDir, filePath))}`, {\n level: 'warn',\n });\n }\n\n return formatNodeType(FILE, path, {\n content: `-`,\n });\n};\n\ntype GlobalIntlayerFilePath = {\n INTLAYER_FILE_PATH: string;\n INTLAYER_BASE_DIR: string;\n};\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow identify the usage of an external resource.\n *\n * Usage:\n *\n * ```ts\n * file('/path/to/file.md') // absolute path\n *\n * // or\n *\n * file('path/to/file.md') // relative path\n * ```\n */\nexport const file = (path: string): FileContent => {\n const { INTLAYER_FILE_PATH, INTLAYER_BASE_DIR } =\n globalThis as unknown as GlobalIntlayerFilePath;\n\n const callerDir = dirname(INTLAYER_FILE_PATH);\n const baseDir = INTLAYER_BASE_DIR;\n\n return fileContent(path, callerDir, baseDir);\n};\n"],"mappings":";;;;;;;;AAcA,MAAa,eACX,MACA,WACA,YACgB;CAChB,MAAM,iBAAiB,KAAK,WAAW,KAAK,IAAI,KAAK,WAAW,MAAM;CACtE,MAAM,uDAA0B;CAEhC,IAAI;AACJ,+BAAe,KAAK,EAAE;AACpB,YACE,sFAAsF,KAAK,mBAAmB,aAC9G,EAAE,OAAO,QAAQ,CAClB;AACD,aAAW;YACF,eACT,mCAAmB,WAAW,KAAK;KAEnC,mCAAmB,SAAS,KAAK;AAGnC,6BAAe,SAAS,0BAAa,SAAS,CAAC,QAAQ,CACrD,KAAI;AAGF,sDAAsBA,+BAAM,MAAM;GAChC,mCAH2B,UAAU,OAAO;GAI5C,mCAAoB,SAAS,SAAS;GACvC,CAAC;SACI;AACN,YACE,0FAA8C,SAAS,SAAS,CAAC,IACjE,EAAE,OAAO,QAAQ,CAClB;;KAGH,WAAU,qFAAyC,SAAS,SAAS,CAAC,IAAI,EACxE,OAAO,QACR,CAAC;AAGJ,qDAAsBA,+BAAM,MAAM,EAChC,SAAS,KACV,CAAC;;;;;;;;;;;;;;;;;AAuBJ,MAAa,QAAQ,SAA8B;CACjD,MAAM,EAAE,oBAAoB,sBAC1B;AAKF,QAAO,YAAY,6BAHO,mBAAmB,EAC7B,kBAE4B"}
@@ -1,2 +1,25 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>{throw Error(`file is not available in browser`)};exports.file=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/transpiler/file/fileBrowser.ts
4
+ /**
5
+ * Function intended to be used to build intlayer dictionaries.
6
+ *
7
+ * Allow identify the usage of an external resource.
8
+ *
9
+ * Usage:
10
+ *
11
+ * ```ts
12
+ * file('/path/to/file.md') // absolute path
13
+ *
14
+ * // or
15
+ *
16
+ * file('path/to/file.md') // relative path
17
+ * ```
18
+ */
19
+ const file = (_path) => {
20
+ throw new Error("file is not available in browser");
21
+ };
22
+
23
+ //#endregion
24
+ exports.file = file;
2
25
  //# sourceMappingURL=fileBrowser.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileBrowser.cjs","names":[],"sources":["../../../../src/transpiler/file/fileBrowser.ts"],"sourcesContent":["import type { FileContent } from './file';\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow identify the usage of an external resource.\n *\n * Usage:\n *\n * ```ts\n * file('/path/to/file.md') // absolute path\n *\n * // or\n *\n * file('path/to/file.md') // relative path\n * ```\n */\nexport const file = (_path: string): FileContent => {\n throw new Error('file is not available in browser');\n\n // return formatNodeType(NodeType.File, path, {\n // content: '',\n // fixedPath: '',\n // });\n};\n"],"mappings":"mEAiBA,MAAa,EAAQ,GAA+B,CAClD,MAAU,MAAM,mCAAmC"}
1
+ {"version":3,"file":"fileBrowser.cjs","names":[],"sources":["../../../../src/transpiler/file/fileBrowser.ts"],"sourcesContent":["import type { FileContent } from './file';\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow identify the usage of an external resource.\n *\n * Usage:\n *\n * ```ts\n * file('/path/to/file.md') // absolute path\n *\n * // or\n *\n * file('path/to/file.md') // relative path\n * ```\n */\nexport const file = (_path: string): FileContent => {\n throw new Error('file is not available in browser');\n\n // return formatNodeType(NodeTypes.File, path, {\n // content: '',\n // fixedPath: '',\n // });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAa,QAAQ,UAA+B;AAClD,OAAM,IAAI,MAAM,mCAAmC"}
@@ -1 +1,5 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./file.cjs`);exports.file=e.file,exports.fileContent=e.fileContent;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_transpiler_file_file = require('./file.cjs');
3
+
4
+ exports.file = require_transpiler_file_file.file;
5
+ exports.fileContent = require_transpiler_file_file.fileContent;
@@ -1,2 +1,27 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=t=>(0,e.formatNodeType)(e.NodeType.Gender,t);exports.gender=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
4
+
5
+ //#region src/transpiler/gender/gender.ts
6
+ /**
7
+ * Function intended to be used to build intlayer dictionaries.
8
+ *
9
+ * Allow to pick a content based on a gender.
10
+ *
11
+ * Usage:
12
+ *
13
+ * ```ts
14
+ * gender({
15
+ * 'true': 'The gender is validated',
16
+ * 'false': 'The gender is not validated',
17
+ * });
18
+ * ```
19
+ *
20
+ * The last key provided will be used as the fallback value.
21
+ *
22
+ */
23
+ const gender = (content) => (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.GENDER, content);
24
+
25
+ //#endregion
26
+ exports.gender = gender;
2
27
  //# sourceMappingURL=gender.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"gender.cjs","names":["NodeType"],"sources":["../../../../src/transpiler/gender/gender.ts"],"sourcesContent":["import type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { formatNodeType, NodeType } from '@intlayer/types/nodeType';\n\nexport type Gender = 'male' | 'female' | 'fallback';\n\nexport type GenderContentStates<Content> = Record<`${Gender}`, Content> & {\n fallback?: Content;\n};\n\nexport type GenderContent<Content = unknown> = TypedNodeModel<\n NodeType.Gender,\n GenderContentStates<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a gender.\n *\n * Usage:\n *\n * ```ts\n * gender({\n * 'true': 'The gender is validated',\n * 'false': 'The gender is not validated',\n * });\n * ```\n *\n * The last key provided will be used as the fallback value.\n *\n */\nconst gender = <Content>(content?: GenderContentStates<Content>) =>\n formatNodeType(NodeType.Gender, content);\n\nexport { gender };\n"],"mappings":"iJA+BA,MAAM,EAAmB,IAAA,EAAA,EAAA,gBACRA,EAAAA,SAAS,OAAQ,EAAQ"}
1
+ {"version":3,"file":"gender.cjs","names":["GENDER"],"sources":["../../../../src/transpiler/gender/gender.ts"],"sourcesContent":["import type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { formatNodeType, GENDER } from '@intlayer/types/nodeType';\n\nexport type Gender = 'male' | 'female' | 'fallback';\n\nexport type GenderContentStates<Content> = Record<`${Gender}`, Content> & {\n fallback?: Content;\n};\n\nexport type GenderContent<Content = unknown> = TypedNodeModel<\n typeof GENDER,\n GenderContentStates<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a gender.\n *\n * Usage:\n *\n * ```ts\n * gender({\n * 'true': 'The gender is validated',\n * 'false': 'The gender is not validated',\n * });\n * ```\n *\n * The last key provided will be used as the fallback value.\n *\n */\nconst gender = <Content>(content?: GenderContentStates<Content>) =>\n formatNodeType(GENDER, content);\n\nexport { gender };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,UAAmB,yDACRA,iCAAQ,QAAQ"}
@@ -1 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./gender.cjs`);exports.gender=e.gender;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_transpiler_gender_gender = require('./gender.cjs');
3
+
4
+ exports.gender = require_transpiler_gender_gender.gender;
@@ -1 +1,45 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../html-CZ1N-VL0.cjs`);exports.getHTMLCustomComponents=e.n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_transpiler_html_htmlTags = require('./htmlTags.cjs');
3
+
4
+ //#region src/transpiler/html/getHTMLCustomComponents.ts
5
+ const parseAttributes = (attributesString) => {
6
+ const attributes = {};
7
+ if (!attributesString || !attributesString.trim()) return attributes;
8
+ [...attributesString.matchAll(/([a-zA-Z0-9-:_@]+)(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?/g)].forEach((match) => {
9
+ const attrName = match[1];
10
+ attributes[attrName] = "string";
11
+ });
12
+ return attributes;
13
+ };
14
+ /**
15
+ * Extracts component names from an HTML string.
16
+ * - Standard HTML tags are set to `true`.
17
+ * - Custom components are parsed to extract their attributes/props.
18
+ */
19
+ const getHTMLCustomComponents = (content) => {
20
+ if (typeof content !== "string") throw new Error("content must be a string");
21
+ const matches = [...content.matchAll(/<(\/)?([a-zA-Z0-9.-]+)\s*([\s\S]*?)(\/?)>/g)];
22
+ const components = {};
23
+ matches.forEach((match) => {
24
+ const isClosing = !!match[1];
25
+ const tagName = match[2];
26
+ const attributesString = match[3];
27
+ const isSelfClosing = !!match[4];
28
+ if (require_transpiler_html_htmlTags.HTML_TAGS.includes(tagName.toLowerCase())) {
29
+ components[tagName] = true;
30
+ return;
31
+ }
32
+ if (!components[tagName]) components[tagName] = {};
33
+ if (components[tagName] === true) return;
34
+ if (isClosing) return;
35
+ const attributes = parseAttributes(attributesString);
36
+ const componentDef = components[tagName];
37
+ Object.assign(componentDef, attributes);
38
+ if (!isSelfClosing) componentDef.children = "string";
39
+ });
40
+ return components;
41
+ };
42
+
43
+ //#endregion
44
+ exports.getHTMLCustomComponents = getHTMLCustomComponents;
45
+ //# sourceMappingURL=getHTMLCustomComponents.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHTMLCustomComponents.cjs","names":["HTML_TAGS"],"sources":["../../../../src/transpiler/html/getHTMLCustomComponents.ts"],"sourcesContent":["import { HTML_TAGS } from './index';\n\nconst parseAttributes = (attributesString: string): Record<string, string> => {\n const attributes: Record<string, string> = {};\n\n if (!attributesString || !attributesString.trim()) {\n return attributes;\n }\n\n // Regex to match attribute names\n // Matches: name=\"value\", name='value', name=value, or just name\n const attrRegex =\n /([a-zA-Z0-9-:_@]+)(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^>\\s]+))?/g;\n\n const matches = [...attributesString.matchAll(attrRegex)];\n\n matches.forEach((match) => {\n const attrName = match[1];\n attributes[attrName] = 'string';\n });\n\n return attributes;\n};\n\n/**\n * Extracts component names from an HTML string.\n * - Standard HTML tags are set to `true`.\n * - Custom components are parsed to extract their attributes/props.\n */\nexport const getHTMLCustomComponents = (\n content: string\n): Record<string, Record<string, string> | true> => {\n if (typeof content !== 'string') {\n throw new Error('content must be a string');\n }\n\n // Regex to match tags: <Tag ...>, </Tag>, or <Tag ... />\n // Captures: 1: Closing slash (if any), 2: Tag Name, 3: Attributes, 4: Self-closing slash (if any)\n const tagRegex = /<(\\/)?([a-zA-Z0-9.-]+)\\s*([\\s\\S]*?)(\\/?)>/g;\n const matches = [...content.matchAll(tagRegex)];\n\n const components: Record<string, Record<string, string> | true> = {};\n\n matches.forEach((match) => {\n const isClosing = !!match[1];\n const tagName = match[2];\n const attributesString = match[3];\n const isSelfClosing = !!match[4];\n\n // Component extraction logic\n if ((HTML_TAGS as readonly string[]).includes(tagName.toLowerCase())) {\n components[tagName] = true;\n return;\n }\n\n if (!components[tagName]) {\n components[tagName] = {};\n }\n\n // Safety check if we somehow have a collision or logic issue, though loop order handles it\n if (components[tagName] === true) {\n return;\n }\n\n if (isClosing) {\n return;\n }\n\n // Parse attributes for custom components\n const attributes = parseAttributes(attributesString);\n const componentDef = components[tagName] as Record<string, string>;\n Object.assign(componentDef, attributes);\n\n // If not self-closing, assume it has children\n if (!isSelfClosing) {\n componentDef.children = 'string';\n }\n });\n\n return components;\n};\n"],"mappings":";;;;AAEA,MAAM,mBAAmB,qBAAqD;CAC5E,MAAM,aAAqC,EAAE;AAE7C,KAAI,CAAC,oBAAoB,CAAC,iBAAiB,MAAM,CAC/C,QAAO;AAUT,CAFgB,CAAC,GAAG,iBAAiB,SAFnC,6DAEsD,CAAC,CAEjD,SAAS,UAAU;EACzB,MAAM,WAAW,MAAM;AACvB,aAAW,YAAY;GACvB;AAEF,QAAO;;;;;;;AAQT,MAAa,2BACX,YACkD;AAClD,KAAI,OAAO,YAAY,SACrB,OAAM,IAAI,MAAM,2BAA2B;CAM7C,MAAM,UAAU,CAAC,GAAG,QAAQ,SADX,6CAC6B,CAAC;CAE/C,MAAM,aAA4D,EAAE;AAEpE,SAAQ,SAAS,UAAU;EACzB,MAAM,YAAY,CAAC,CAAC,MAAM;EAC1B,MAAM,UAAU,MAAM;EACtB,MAAM,mBAAmB,MAAM;EAC/B,MAAM,gBAAgB,CAAC,CAAC,MAAM;AAG9B,MAAKA,2CAAgC,SAAS,QAAQ,aAAa,CAAC,EAAE;AACpE,cAAW,WAAW;AACtB;;AAGF,MAAI,CAAC,WAAW,SACd,YAAW,WAAW,EAAE;AAI1B,MAAI,WAAW,aAAa,KAC1B;AAGF,MAAI,UACF;EAIF,MAAM,aAAa,gBAAgB,iBAAiB;EACpD,MAAM,eAAe,WAAW;AAChC,SAAO,OAAO,cAAc,WAAW;AAGvC,MAAI,CAAC,cACH,cAAa,WAAW;GAE1B;AAEF,QAAO"}
@@ -1 +1,44 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../html-CZ1N-VL0.cjs`);exports.html=e.t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_transpiler_html_getHTMLCustomComponents = require('./getHTMLCustomComponents.cjs');
4
+ const require_transpiler_html_validateHTML = require('./validateHTML.cjs');
5
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
6
+
7
+ //#region src/transpiler/html/html.ts
8
+ /**
9
+ * Function intended to be used to build intlayer dictionaries.
10
+ *
11
+ * Allow to parse HTML/JSX-like strings and replace tags with components during interpretation.
12
+ *
13
+ * Usage:
14
+ *
15
+ * ```ts
16
+ * html('Hello <b>World</b>')
17
+ * ```
18
+ *
19
+ */
20
+ const html = (content, components) => {
21
+ const getComponents = () => {
22
+ if (components) return components;
23
+ if (typeof content === "string") {
24
+ const { issues } = require_transpiler_html_validateHTML.validateHTML(content);
25
+ for (const issue of issues) if (issue.type === "error") console.error(`[intlayer/html] ${issue.message}`);
26
+ else console.warn(`[intlayer/html] ${issue.message}`);
27
+ return require_transpiler_html_getHTMLCustomComponents.getHTMLCustomComponents(content);
28
+ }
29
+ let stringContent;
30
+ if (typeof content === "function") stringContent = content();
31
+ else if (typeof content.then === "function") stringContent = async () => require_transpiler_html_getHTMLCustomComponents.getHTMLCustomComponents(await content);
32
+ if (typeof stringContent === "string") return require_transpiler_html_getHTMLCustomComponents.getHTMLCustomComponents(stringContent);
33
+ try {
34
+ return require_transpiler_html_getHTMLCustomComponents.getHTMLCustomComponents(JSON.stringify(content));
35
+ } catch (_e) {
36
+ return [];
37
+ }
38
+ };
39
+ return (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.HTML, content, { tags: getComponents() });
40
+ };
41
+
42
+ //#endregion
43
+ exports.html = html;
44
+ //# sourceMappingURL=html.cjs.map