@intlayer/core 6.1.6 → 7.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs +213 -0
- package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -0
- package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs +95 -0
- package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -0
- package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs +46 -0
- package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -0
- package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs +33 -0
- package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -0
- package/dist/cjs/deepTransformPlugins/getMaskContent.cjs +27 -0
- package/dist/cjs/deepTransformPlugins/getMaskContent.cjs.map +1 -0
- package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs +45 -0
- package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -0
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs +60 -0
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -0
- package/dist/cjs/deepTransformPlugins/index.cjs +25 -0
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +107 -0
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -0
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +59 -91
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +13 -39
- package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +48 -94
- package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +24 -68
- package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +21 -56
- package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs +32 -49
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getUnmergedDictionaryByKeyPath.cjs +18 -50
- package/dist/cjs/dictionaryManipulator/getUnmergedDictionaryByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/index.cjs +28 -41
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +69 -0
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -0
- package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs +30 -0
- package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs.map +1 -0
- package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +48 -0
- package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -0
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +29 -54
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +37 -63
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs +36 -76
- package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
- package/dist/cjs/formatters/compact.cjs +24 -46
- package/dist/cjs/formatters/compact.cjs.map +1 -1
- package/dist/cjs/formatters/currency.cjs +28 -50
- package/dist/cjs/formatters/currency.cjs.map +1 -1
- package/dist/cjs/formatters/date.cjs +56 -79
- package/dist/cjs/formatters/date.cjs.map +1 -1
- package/dist/cjs/formatters/index.cjs +17 -37
- package/dist/cjs/formatters/list.cjs +29 -47
- package/dist/cjs/formatters/list.cjs.map +1 -1
- package/dist/cjs/formatters/number.cjs +17 -43
- package/dist/cjs/formatters/number.cjs.map +1 -1
- package/dist/cjs/formatters/percentage.cjs +22 -51
- package/dist/cjs/formatters/percentage.cjs.map +1 -1
- package/dist/cjs/formatters/relativeTime.cjs +28 -70
- package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
- package/dist/cjs/formatters/units.cjs +22 -48
- package/dist/cjs/formatters/units.cjs.map +1 -1
- package/dist/cjs/getStorageAttributes.cjs +116 -0
- package/dist/cjs/getStorageAttributes.cjs.map +1 -0
- package/dist/cjs/index.cjs +154 -45
- package/dist/cjs/interpreter/getCondition.cjs +30 -30
- package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/deepTransform.cjs +38 -63
- package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/getContent.cjs +31 -54
- package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/index.cjs +13 -27
- package/dist/cjs/interpreter/getContent/plugins.cjs +135 -175
- package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
- package/dist/cjs/interpreter/getDictionary.cjs +21 -39
- package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
- package/dist/cjs/interpreter/getEnumeration.cjs +69 -42
- package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
- package/dist/cjs/interpreter/getGender.cjs +33 -34
- package/dist/cjs/interpreter/getGender.cjs.map +1 -1
- package/dist/cjs/interpreter/getInsertion.cjs +18 -27
- package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
- package/dist/cjs/interpreter/getIntlayer.cjs +13 -48
- package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
- package/dist/cjs/interpreter/getNesting.cjs +26 -41
- package/dist/cjs/interpreter/getNesting.cjs.map +1 -1
- package/dist/cjs/interpreter/getTranslation.cjs +29 -32
- package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
- package/dist/cjs/interpreter/index.cjs +26 -39
- package/dist/cjs/localization/getBrowserLocale.cjs +144 -0
- package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -0
- package/dist/cjs/localization/getHTMLTextDir.cjs +49 -255
- package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleFromPath.cjs +40 -56
- package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleLang.cjs +18 -27
- package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleName.cjs +7 -32
- package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
- package/dist/cjs/localization/getLocalizedUrl.cjs +46 -47
- package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
- package/dist/cjs/localization/getMultilingualUrls.cjs +69 -65
- package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
- package/dist/cjs/localization/getPathWithoutLocale.cjs +53 -61
- package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
- package/dist/cjs/localization/index.cjs +26 -63
- package/dist/cjs/localization/localeDetector.cjs +108 -39
- package/dist/cjs/localization/localeDetector.cjs.map +1 -1
- package/dist/cjs/localization/localeMapper.cjs +118 -72
- package/dist/cjs/localization/localeMapper.cjs.map +1 -1
- package/dist/cjs/localization/localeResolver.cjs +26 -61
- package/dist/cjs/localization/localeResolver.cjs.map +1 -1
- package/dist/cjs/transpiler/condition/condition.cjs +26 -29
- package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
- package/dist/cjs/transpiler/condition/index.cjs +3 -23
- package/dist/cjs/transpiler/enumeration/enumeration.cjs +28 -29
- package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
- package/dist/cjs/transpiler/enumeration/index.cjs +3 -23
- package/dist/cjs/transpiler/file/file.cjs +52 -71
- package/dist/cjs/transpiler/file/file.cjs.map +1 -1
- package/dist/cjs/transpiler/file/fileBrowser.cjs +24 -33
- package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
- package/dist/cjs/transpiler/file/index.cjs +4 -23
- package/dist/cjs/transpiler/gender/gender.cjs +26 -29
- package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
- package/dist/cjs/transpiler/gender/index.cjs +3 -23
- package/dist/cjs/transpiler/index.cjs +19 -35
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +8 -31
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
- package/dist/cjs/transpiler/insertion/index.cjs +5 -25
- package/dist/cjs/transpiler/insertion/insertion.cjs +34 -51
- package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +53 -86
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/index.cjs +5 -25
- package/dist/cjs/transpiler/markdown/markdown.cjs +33 -52
- package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
- package/dist/cjs/transpiler/nesting/index.cjs +3 -23
- package/dist/cjs/transpiler/nesting/nesting.cjs +26 -31
- package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
- package/dist/cjs/transpiler/translation/index.cjs +3 -23
- package/dist/cjs/transpiler/translation/translation.cjs +29 -29
- package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
- package/dist/cjs/utils/checkIsURLAbsolute.cjs +5 -27
- package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
- package/dist/cjs/utils/intl.cjs +48 -74
- package/dist/cjs/utils/intl.cjs.map +1 -1
- package/dist/cjs/utils/isSameKeyPath.cjs +6 -30
- package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
- package/dist/cjs/utils/isValidReactElement.cjs +12 -27
- package/dist/cjs/utils/isValidReactElement.cjs.map +1 -1
- package/dist/cjs/utils/localeStorage.cjs +143 -0
- package/dist/cjs/utils/localeStorage.cjs.map +1 -0
- package/dist/cjs/utils/parseYaml.cjs +185 -55
- package/dist/cjs/utils/parseYaml.cjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs +208 -0
- package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs.map +1 -0
- package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs +90 -0
- package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -0
- package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs +43 -0
- package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs.map +1 -0
- package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs +32 -0
- package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -0
- package/dist/esm/deepTransformPlugins/getMaskContent.mjs +26 -0
- package/dist/esm/deepTransformPlugins/getMaskContent.mjs.map +1 -0
- package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs +41 -0
- package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs.map +1 -0
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs +60 -0
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -0
- package/dist/esm/deepTransformPlugins/index.mjs +10 -0
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs +105 -0
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -0
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +57 -67
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs +11 -15
- package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getDefaultNode.mjs +46 -70
- package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getEmptyNode.mjs +22 -44
- package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +19 -32
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getNodeType.mjs +31 -26
- package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getUnmergedDictionaryByKeyPath.mjs +14 -15
- package/dist/esm/dictionaryManipulator/getUnmergedDictionaryByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/index.mjs +15 -11
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +66 -0
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -0
- package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs +29 -0
- package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs.map +1 -0
- package/dist/esm/dictionaryManipulator/orderDictionaries.mjs +46 -0
- package/dist/esm/dictionaryManipulator/orderDictionaries.mjs.map +1 -0
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +27 -30
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +35 -39
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs +34 -52
- package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs.map +1 -1
- package/dist/esm/formatters/compact.mjs +21 -11
- package/dist/esm/formatters/compact.mjs.map +1 -1
- package/dist/esm/formatters/currency.mjs +25 -15
- package/dist/esm/formatters/currency.mjs.map +1 -1
- package/dist/esm/formatters/date.mjs +53 -44
- package/dist/esm/formatters/date.mjs.map +1 -1
- package/dist/esm/formatters/index.mjs +10 -9
- package/dist/esm/formatters/list.mjs +26 -12
- package/dist/esm/formatters/list.mjs.map +1 -1
- package/dist/esm/formatters/number.mjs +14 -8
- package/dist/esm/formatters/number.mjs.map +1 -1
- package/dist/esm/formatters/percentage.mjs +19 -16
- package/dist/esm/formatters/percentage.mjs.map +1 -1
- package/dist/esm/formatters/relativeTime.mjs +25 -35
- package/dist/esm/formatters/relativeTime.mjs.map +1 -1
- package/dist/esm/formatters/units.mjs +19 -13
- package/dist/esm/formatters/units.mjs.map +1 -1
- package/dist/esm/getStorageAttributes.mjs +114 -0
- package/dist/esm/getStorageAttributes.mjs.map +1 -0
- package/dist/esm/index.mjs +67 -13
- package/dist/esm/interpreter/getCondition.mjs +29 -6
- package/dist/esm/interpreter/getCondition.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/deepTransform.mjs +36 -39
- package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/getContent.mjs +28 -26
- package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/index.mjs +5 -4
- package/dist/esm/interpreter/getContent/plugins.mjs +121 -139
- package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
- package/dist/esm/interpreter/getDictionary.mjs +20 -14
- package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
- package/dist/esm/interpreter/getEnumeration.mjs +67 -17
- package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
- package/dist/esm/interpreter/getGender.mjs +32 -10
- package/dist/esm/interpreter/getGender.mjs.map +1 -1
- package/dist/esm/interpreter/getInsertion.mjs +17 -3
- package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
- package/dist/esm/interpreter/getIntlayer.mjs +10 -13
- package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
- package/dist/esm/interpreter/getNesting.mjs +25 -16
- package/dist/esm/interpreter/getNesting.mjs.map +1 -1
- package/dist/esm/interpreter/getTranslation.mjs +28 -8
- package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
- package/dist/esm/interpreter/index.mjs +11 -10
- package/dist/esm/localization/getBrowserLocale.mjs +139 -0
- package/dist/esm/localization/getBrowserLocale.mjs.map +1 -0
- package/dist/esm/localization/getHTMLTextDir.mjs +47 -231
- package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
- package/dist/esm/localization/getLocaleFromPath.mjs +36 -21
- package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
- package/dist/esm/localization/getLocaleLang.mjs +17 -3
- package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
- package/dist/esm/localization/getLocaleName.mjs +7 -8
- package/dist/esm/localization/getLocaleName.mjs.map +1 -1
- package/dist/esm/localization/getLocalizedUrl.mjs +43 -12
- package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
- package/dist/esm/localization/getMultilingualUrls.mjs +65 -29
- package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
- package/dist/esm/localization/getPathWithoutLocale.mjs +50 -26
- package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
- package/dist/esm/localization/index.mjs +7 -21
- package/dist/esm/localization/localeDetector.mjs +109 -6
- package/dist/esm/localization/localeDetector.mjs.map +1 -1
- package/dist/esm/localization/localeMapper.mjs +112 -35
- package/dist/esm/localization/localeMapper.mjs.map +1 -1
- package/dist/esm/localization/localeResolver.mjs +23 -26
- package/dist/esm/localization/localeResolver.mjs.map +1 -1
- package/dist/esm/transpiler/condition/condition.mjs +23 -7
- package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
- package/dist/esm/transpiler/condition/index.mjs +3 -2
- package/dist/esm/transpiler/enumeration/enumeration.mjs +25 -7
- package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
- package/dist/esm/transpiler/enumeration/index.mjs +3 -2
- package/dist/esm/transpiler/file/file.mjs +46 -40
- package/dist/esm/transpiler/file/file.mjs.map +1 -1
- package/dist/esm/transpiler/file/fileBrowser.mjs +22 -9
- package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
- package/dist/esm/transpiler/file/index.mjs +3 -2
- package/dist/esm/transpiler/gender/gender.mjs +23 -7
- package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
- package/dist/esm/transpiler/gender/index.mjs +3 -2
- package/dist/esm/transpiler/index.mjs +11 -8
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs +7 -7
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
- package/dist/esm/transpiler/insertion/index.mjs +4 -3
- package/dist/esm/transpiler/insertion/insertion.mjs +31 -29
- package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +52 -61
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/index.mjs +4 -3
- package/dist/esm/transpiler/markdown/markdown.mjs +29 -29
- package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
- package/dist/esm/transpiler/nesting/index.mjs +3 -2
- package/dist/esm/transpiler/nesting/nesting.mjs +23 -9
- package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
- package/dist/esm/transpiler/translation/index.mjs +3 -2
- package/dist/esm/transpiler/translation/translation.mjs +26 -7
- package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
- package/dist/esm/utils/checkIsURLAbsolute.mjs +4 -3
- package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
- package/dist/esm/utils/intl.mjs +44 -49
- package/dist/esm/utils/intl.mjs.map +1 -1
- package/dist/esm/utils/isSameKeyPath.mjs +5 -6
- package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
- package/dist/esm/utils/isValidReactElement.mjs +11 -3
- package/dist/esm/utils/isValidReactElement.mjs.map +1 -1
- package/dist/esm/utils/localeStorage.mjs +139 -0
- package/dist/esm/utils/localeStorage.mjs.map +1 -0
- package/dist/esm/utils/parseYaml.mjs +184 -31
- package/dist/esm/utils/parseYaml.mjs.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +46 -0
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +38 -0
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +30 -0
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +18 -0
- package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getMaskContent.d.ts +10 -0
- package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +16 -0
- package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +8 -0
- package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/index.d.ts +9 -0
- package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +25 -0
- package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +6 -3
- package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +6 -3
- package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +6 -3
- package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +6 -2
- package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +6 -2
- package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getNodeType.d.ts +6 -3
- package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/getUnmergedDictionaryByKeyPath.d.ts +8 -3
- package/dist/types/dictionaryManipulator/getUnmergedDictionaryByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/index.d.ts +14 -11
- package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +7 -0
- package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +8 -0
- package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +16 -0
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +6 -3
- package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +6 -3
- package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +6 -2
- package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +1 -1
- package/dist/types/formatters/compact.d.ts +8 -3
- package/dist/types/formatters/compact.d.ts.map +1 -1
- package/dist/types/formatters/currency.d.ts +8 -3
- package/dist/types/formatters/currency.d.ts.map +1 -1
- package/dist/types/formatters/date.d.ts +8 -3
- package/dist/types/formatters/date.d.ts.map +1 -1
- package/dist/types/formatters/index.d.ts +9 -9
- package/dist/types/formatters/list.d.ts +8 -3
- package/dist/types/formatters/list.d.ts.map +1 -1
- package/dist/types/formatters/number.d.ts +8 -3
- package/dist/types/formatters/number.d.ts.map +1 -1
- package/dist/types/formatters/percentage.d.ts +8 -3
- package/dist/types/formatters/percentage.d.ts.map +1 -1
- package/dist/types/formatters/relativeTime.d.ts +8 -5
- package/dist/types/formatters/relativeTime.d.ts.map +1 -1
- package/dist/types/formatters/units.d.ts +8 -3
- package/dist/types/formatters/units.d.ts.map +1 -1
- package/dist/types/getStorageAttributes.d.ts +25 -0
- package/dist/types/getStorageAttributes.d.ts.map +1 -0
- package/dist/types/index.d.ts +67 -13
- package/dist/types/interpreter/getCondition.d.ts +7 -2
- package/dist/types/interpreter/getCondition.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/deepTransform.d.ts +7 -2
- package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/getContent.d.ts +8 -4
- package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/index.d.ts +4 -4
- package/dist/types/interpreter/getContent/plugins.d.ts +68 -66
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/interpreter/getDictionary.d.ts +8 -4
- package/dist/types/interpreter/getDictionary.d.ts.map +1 -1
- package/dist/types/interpreter/getEnumeration.d.ts +8 -3
- package/dist/types/interpreter/getEnumeration.d.ts.map +1 -1
- package/dist/types/interpreter/getGender.d.ts +7 -4
- package/dist/types/interpreter/getGender.d.ts.map +1 -1
- package/dist/types/interpreter/getInsertion.d.ts +7 -2
- package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
- package/dist/types/interpreter/getIntlayer.d.ts +7 -5
- package/dist/types/interpreter/getIntlayer.d.ts.map +1 -1
- package/dist/types/interpreter/getNesting.d.ts +9 -6
- package/dist/types/interpreter/getNesting.d.ts.map +1 -1
- package/dist/types/interpreter/getTranslation.d.ts +7 -3
- package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
- package/dist/types/interpreter/index.d.ts +10 -10
- package/dist/types/localization/getBrowserLocale.d.ts +35 -0
- package/dist/types/localization/getBrowserLocale.d.ts.map +1 -0
- package/dist/types/localization/getHTMLTextDir.d.ts +6 -3
- package/dist/types/localization/getHTMLTextDir.d.ts.map +1 -1
- package/dist/types/localization/getLocaleFromPath.d.ts +7 -2
- package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -1
- package/dist/types/localization/getLocaleLang.d.ts +7 -2
- package/dist/types/localization/getLocaleLang.d.ts.map +1 -1
- package/dist/types/localization/getLocaleName.d.ts +6 -2
- package/dist/types/localization/getLocaleName.d.ts.map +1 -1
- package/dist/types/localization/getLocalizedUrl.d.ts +30 -17
- package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -1
- package/dist/types/localization/getMultilingualUrls.d.ts +28 -12
- package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -1
- package/dist/types/localization/getPathWithoutLocale.d.ts +11 -3
- package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts +12 -12
- package/dist/types/localization/localeDetector.d.ts +7 -2
- package/dist/types/localization/localeDetector.d.ts.map +1 -1
- package/dist/types/localization/localeMapper.d.ts +23 -19
- package/dist/types/localization/localeMapper.d.ts.map +1 -1
- package/dist/types/localization/localeResolver.d.ts +7 -2
- package/dist/types/localization/localeResolver.d.ts.map +1 -1
- package/dist/types/transpiler/condition/condition.d.ts +8 -5
- package/dist/types/transpiler/condition/condition.d.ts.map +1 -1
- package/dist/types/transpiler/condition/index.d.ts +2 -2
- package/dist/types/transpiler/enumeration/enumeration.d.ts +9 -6
- package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -1
- package/dist/types/transpiler/enumeration/index.d.ts +2 -2
- package/dist/types/transpiler/file/file.d.ts +11 -6
- package/dist/types/transpiler/file/file.d.ts.map +1 -1
- package/dist/types/transpiler/file/fileBrowser.d.ts +7 -2
- package/dist/types/transpiler/file/fileBrowser.d.ts.map +1 -1
- package/dist/types/transpiler/file/index.d.ts +2 -2
- package/dist/types/transpiler/gender/gender.d.ts +9 -6
- package/dist/types/transpiler/gender/gender.d.ts.map +1 -1
- package/dist/types/transpiler/gender/index.d.ts +2 -2
- package/dist/types/transpiler/index.d.ts +11 -9
- package/dist/types/transpiler/insertion/getInsertionValues.d.ts +4 -1
- package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -1
- package/dist/types/transpiler/insertion/index.d.ts +3 -3
- package/dist/types/transpiler/insertion/insertion.d.ts +8 -5
- package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -1
- package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts +4 -1
- package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -1
- package/dist/types/transpiler/markdown/index.d.ts +3 -3
- package/dist/types/transpiler/markdown/markdown.d.ts +8 -5
- package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -1
- package/dist/types/transpiler/nesting/index.d.ts +2 -2
- package/dist/types/transpiler/nesting/nesting.d.ts +24 -25
- package/dist/types/transpiler/nesting/nesting.d.ts.map +1 -1
- package/dist/types/transpiler/translation/index.d.ts +2 -2
- package/dist/types/transpiler/translation/translation.d.ts +9 -6
- package/dist/types/transpiler/translation/translation.d.ts.map +1 -1
- package/dist/types/utils/checkIsURLAbsolute.d.ts +4 -1
- package/dist/types/utils/checkIsURLAbsolute.d.ts.map +1 -1
- package/dist/types/utils/intl.d.ts +9 -10
- package/dist/types/utils/intl.d.ts.map +1 -1
- package/dist/types/utils/isSameKeyPath.d.ts +6 -2
- package/dist/types/utils/isSameKeyPath.d.ts.map +1 -1
- package/dist/types/utils/isValidReactElement.d.ts +4 -1
- package/dist/types/utils/isValidReactElement.d.ts.map +1 -1
- package/dist/types/utils/localeStorage.d.ts +105 -0
- package/dist/types/utils/localeStorage.d.ts.map +1 -0
- package/dist/types/utils/parseYaml.d.ts +4 -1
- package/dist/types/utils/parseYaml.d.ts.map +1 -1
- package/package.json +36 -121
- package/LICENSE +0 -202
- package/dist/cjs/deepTranformPlugins/getFilterTranslationsOnlyContent.cjs +0 -130
- package/dist/cjs/deepTranformPlugins/getFilterTranslationsOnlyContent.cjs.map +0 -1
- package/dist/cjs/deepTranformPlugins/getFilteredLocalesContent.cjs +0 -62
- package/dist/cjs/deepTranformPlugins/getFilteredLocalesContent.cjs.map +0 -1
- package/dist/cjs/deepTranformPlugins/getLocalisedContent.cjs +0 -51
- package/dist/cjs/deepTranformPlugins/getLocalisedContent.cjs.map +0 -1
- package/dist/cjs/deepTranformPlugins/getMaskContent.cjs +0 -49
- package/dist/cjs/deepTranformPlugins/getMaskContent.cjs.map +0 -1
- package/dist/cjs/deepTranformPlugins/getMissingLocalesContent.cjs +0 -78
- package/dist/cjs/deepTranformPlugins/getMissingLocalesContent.cjs.map +0 -1
- package/dist/cjs/deepTranformPlugins/getReplacedValuesContent.cjs +0 -82
- package/dist/cjs/deepTranformPlugins/getReplacedValuesContent.cjs.map +0 -1
- package/dist/cjs/deepTranformPlugins/index.cjs +0 -33
- package/dist/cjs/deepTranformPlugins/index.cjs.map +0 -1
- package/dist/cjs/dictionaryManipulator/index.cjs.map +0 -1
- package/dist/cjs/formatters/index.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/interpreter/getContent/index.cjs.map +0 -1
- package/dist/cjs/interpreter/getIntlayerAsync.cjs +0 -37
- package/dist/cjs/interpreter/getIntlayerAsync.cjs.map +0 -1
- package/dist/cjs/interpreter/index.cjs.map +0 -1
- package/dist/cjs/localization/index.cjs.map +0 -1
- package/dist/cjs/localization/localeList.cjs +0 -256
- package/dist/cjs/localization/localeList.cjs.map +0 -1
- package/dist/cjs/transpiler/condition/index.cjs.map +0 -1
- package/dist/cjs/transpiler/enumeration/index.cjs.map +0 -1
- package/dist/cjs/transpiler/file/index.cjs.map +0 -1
- package/dist/cjs/transpiler/gender/index.cjs.map +0 -1
- package/dist/cjs/transpiler/index.cjs.map +0 -1
- package/dist/cjs/transpiler/insertion/index.cjs.map +0 -1
- package/dist/cjs/transpiler/markdown/index.cjs.map +0 -1
- package/dist/cjs/transpiler/nesting/index.cjs.map +0 -1
- package/dist/cjs/transpiler/translation/index.cjs.map +0 -1
- package/dist/cjs/types/dictionary.cjs +0 -17
- package/dist/cjs/types/dictionary.cjs.map +0 -1
- package/dist/cjs/types/index.cjs +0 -29
- package/dist/cjs/types/index.cjs.map +0 -1
- package/dist/cjs/types/intlayer.cjs +0 -35
- package/dist/cjs/types/intlayer.cjs.map +0 -1
- package/dist/cjs/types/keyPath.cjs +0 -17
- package/dist/cjs/types/keyPath.cjs.map +0 -1
- package/dist/cjs/types/nodeType.cjs +0 -53
- package/dist/cjs/types/nodeType.cjs.map +0 -1
- package/dist/cjs/types/translation.cjs +0 -17
- package/dist/cjs/types/translation.cjs.map +0 -1
- package/dist/esm/deepTranformPlugins/getFilterTranslationsOnlyContent.mjs +0 -95
- package/dist/esm/deepTranformPlugins/getFilterTranslationsOnlyContent.mjs.map +0 -1
- package/dist/esm/deepTranformPlugins/getFilteredLocalesContent.mjs +0 -40
- package/dist/esm/deepTranformPlugins/getFilteredLocalesContent.mjs.map +0 -1
- package/dist/esm/deepTranformPlugins/getLocalisedContent.mjs +0 -19
- package/dist/esm/deepTranformPlugins/getLocalisedContent.mjs.map +0 -1
- package/dist/esm/deepTranformPlugins/getMaskContent.mjs +0 -24
- package/dist/esm/deepTranformPlugins/getMaskContent.mjs.map +0 -1
- package/dist/esm/deepTranformPlugins/getMissingLocalesContent.mjs +0 -43
- package/dist/esm/deepTranformPlugins/getMissingLocalesContent.mjs.map +0 -1
- package/dist/esm/deepTranformPlugins/getReplacedValuesContent.mjs +0 -60
- package/dist/esm/deepTranformPlugins/getReplacedValuesContent.mjs.map +0 -1
- package/dist/esm/deepTranformPlugins/index.mjs +0 -7
- package/dist/esm/deepTranformPlugins/index.mjs.map +0 -1
- package/dist/esm/dictionaryManipulator/index.mjs.map +0 -1
- package/dist/esm/formatters/index.mjs.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/interpreter/getContent/index.mjs.map +0 -1
- package/dist/esm/interpreter/getIntlayerAsync.mjs +0 -13
- package/dist/esm/interpreter/getIntlayerAsync.mjs.map +0 -1
- package/dist/esm/interpreter/index.mjs.map +0 -1
- package/dist/esm/localization/index.mjs.map +0 -1
- package/dist/esm/localization/localeList.mjs +0 -232
- package/dist/esm/localization/localeList.mjs.map +0 -1
- package/dist/esm/transpiler/condition/index.mjs.map +0 -1
- package/dist/esm/transpiler/enumeration/index.mjs.map +0 -1
- package/dist/esm/transpiler/file/index.mjs.map +0 -1
- package/dist/esm/transpiler/gender/index.mjs.map +0 -1
- package/dist/esm/transpiler/index.mjs.map +0 -1
- package/dist/esm/transpiler/insertion/index.mjs.map +0 -1
- package/dist/esm/transpiler/markdown/index.mjs.map +0 -1
- package/dist/esm/transpiler/nesting/index.mjs.map +0 -1
- package/dist/esm/transpiler/translation/index.mjs.map +0 -1
- package/dist/esm/types/dictionary.mjs +0 -1
- package/dist/esm/types/dictionary.mjs.map +0 -1
- package/dist/esm/types/index.mjs +0 -5
- package/dist/esm/types/index.mjs.map +0 -1
- package/dist/esm/types/intlayer.mjs +0 -13
- package/dist/esm/types/intlayer.mjs.map +0 -1
- package/dist/esm/types/keyPath.mjs +0 -1
- package/dist/esm/types/keyPath.mjs.map +0 -1
- package/dist/esm/types/nodeType.mjs +0 -28
- package/dist/esm/types/nodeType.mjs.map +0 -1
- package/dist/esm/types/translation.mjs +0 -1
- package/dist/esm/types/translation.mjs.map +0 -1
- package/dist/types/deepTranformPlugins/getFilterTranslationsOnlyContent.d.ts +0 -13
- package/dist/types/deepTranformPlugins/getFilterTranslationsOnlyContent.d.ts.map +0 -1
- package/dist/types/deepTranformPlugins/getFilteredLocalesContent.d.ts +0 -5
- package/dist/types/deepTranformPlugins/getFilteredLocalesContent.d.ts.map +0 -1
- package/dist/types/deepTranformPlugins/getLocalisedContent.d.ts +0 -13
- package/dist/types/deepTranformPlugins/getLocalisedContent.d.ts.map +0 -1
- package/dist/types/deepTranformPlugins/getMaskContent.d.ts +0 -6
- package/dist/types/deepTranformPlugins/getMaskContent.d.ts.map +0 -1
- package/dist/types/deepTranformPlugins/getMissingLocalesContent.d.ts +0 -13
- package/dist/types/deepTranformPlugins/getMissingLocalesContent.d.ts.map +0 -1
- package/dist/types/deepTranformPlugins/getReplacedValuesContent.d.ts +0 -4
- package/dist/types/deepTranformPlugins/getReplacedValuesContent.d.ts.map +0 -1
- package/dist/types/deepTranformPlugins/index.d.ts +0 -7
- package/dist/types/deepTranformPlugins/index.d.ts.map +0 -1
- package/dist/types/dictionaryManipulator/index.d.ts.map +0 -1
- package/dist/types/formatters/index.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/interpreter/getContent/index.d.ts.map +0 -1
- package/dist/types/interpreter/getIntlayerAsync.d.ts +0 -13
- package/dist/types/interpreter/getIntlayerAsync.d.ts.map +0 -1
- package/dist/types/interpreter/index.d.ts.map +0 -1
- package/dist/types/localization/index.d.ts.map +0 -1
- package/dist/types/localization/localeList.d.ts +0 -3
- package/dist/types/localization/localeList.d.ts.map +0 -1
- package/dist/types/transpiler/condition/index.d.ts.map +0 -1
- package/dist/types/transpiler/enumeration/index.d.ts.map +0 -1
- package/dist/types/transpiler/file/index.d.ts.map +0 -1
- package/dist/types/transpiler/gender/index.d.ts.map +0 -1
- package/dist/types/transpiler/index.d.ts.map +0 -1
- package/dist/types/transpiler/insertion/index.d.ts.map +0 -1
- package/dist/types/transpiler/markdown/index.d.ts.map +0 -1
- package/dist/types/transpiler/nesting/index.d.ts.map +0 -1
- package/dist/types/transpiler/translation/index.d.ts.map +0 -1
- package/dist/types/types/dictionary.d.ts +0 -307
- package/dist/types/types/dictionary.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -5
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/types/intlayer.d.ts +0 -5
- package/dist/types/types/intlayer.d.ts.map +0 -1
- package/dist/types/types/keyPath.d.ts +0 -47
- package/dist/types/types/keyPath.d.ts.map +0 -1
- package/dist/types/types/nodeType.d.ts +0 -30
- package/dist/types/types/nodeType.d.ts.map +0 -1
- package/dist/types/types/translation.d.ts +0 -25
- package/dist/types/types/translation.d.ts.map +0 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -1,13 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { getStorageAttributes } from "./getStorageAttributes.mjs";
|
|
2
|
+
import { getCondition } from "./interpreter/getCondition.mjs";
|
|
3
|
+
import { deepTransformNode } from "./interpreter/getContent/deepTransform.mjs";
|
|
4
|
+
import { findMatchingCondition, getEnumeration } from "./interpreter/getEnumeration.mjs";
|
|
5
|
+
import { getDictionary } from "./interpreter/getDictionary.mjs";
|
|
6
|
+
import { getIntlayer } from "./interpreter/getIntlayer.mjs";
|
|
7
|
+
import { getNesting } from "./interpreter/getNesting.mjs";
|
|
8
|
+
import { getTranslation } from "./interpreter/getTranslation.mjs";
|
|
9
|
+
import { conditionPlugin, enumerationPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./interpreter/getContent/plugins.mjs";
|
|
10
|
+
import { getContent } from "./interpreter/getContent/getContent.mjs";
|
|
11
|
+
import { getFilteredLocalesContent, getFilteredLocalesDictionary } from "./deepTransformPlugins/getFilteredLocalesContent.mjs";
|
|
12
|
+
import { cond as condition } from "./transpiler/condition/condition.mjs";
|
|
13
|
+
import { enu as enumeration } from "./transpiler/enumeration/enumeration.mjs";
|
|
14
|
+
import { gender } from "./transpiler/gender/gender.mjs";
|
|
15
|
+
import { getInsertionValues } from "./transpiler/insertion/getInsertionValues.mjs";
|
|
16
|
+
import { insert as insertion } from "./transpiler/insertion/insertion.mjs";
|
|
17
|
+
import { parseYaml } from "./utils/parseYaml.mjs";
|
|
18
|
+
import { getMarkdownMetadata } from "./transpiler/markdown/getMarkdownMetadata.mjs";
|
|
19
|
+
import { md as markdown } from "./transpiler/markdown/markdown.mjs";
|
|
20
|
+
import { nest as nesting } from "./transpiler/nesting/nesting.mjs";
|
|
21
|
+
import { t as translation } from "./transpiler/translation/translation.mjs";
|
|
22
|
+
import { filterMissingTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary } from "./deepTransformPlugins/getFilterMissingTranslationsContent.mjs";
|
|
23
|
+
import { filterTranslationsOnlyPlugin, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary } from "./deepTransformPlugins/getFilterTranslationsOnlyContent.mjs";
|
|
24
|
+
import { getLocalizedContent, getPerLocaleDictionary } from "./deepTransformPlugins/getLocalizedContent.mjs";
|
|
25
|
+
import { buildMaskPlugin, getMaskContent } from "./deepTransformPlugins/getMaskContent.mjs";
|
|
26
|
+
import { checkMissingLocalesPlugin, getMissingLocalesContent } from "./deepTransformPlugins/getMissingLocalesContent.mjs";
|
|
27
|
+
import { getReplacedValuesContent } from "./deepTransformPlugins/getReplacedValuesContent.mjs";
|
|
28
|
+
import { insertContentInDictionary } from "./deepTransformPlugins/insertContentInDictionary.mjs";
|
|
29
|
+
import { editDictionaryByKeyPath } from "./dictionaryManipulator/editDictionaryByKeyPath.mjs";
|
|
30
|
+
import { getContentNodeByKeyPath } from "./dictionaryManipulator/getContentNodeByKeyPath.mjs";
|
|
31
|
+
import { getDefaultNode } from "./dictionaryManipulator/getDefaultNode.mjs";
|
|
32
|
+
import { getEmptyNode } from "./dictionaryManipulator/getEmptyNode.mjs";
|
|
33
|
+
import { getNodeChildren } from "./dictionaryManipulator/getNodeChildren.mjs";
|
|
34
|
+
import { isValidElement } from "./utils/isValidReactElement.mjs";
|
|
35
|
+
import { getNodeType } from "./dictionaryManipulator/getNodeType.mjs";
|
|
36
|
+
import { orderDictionaries } from "./dictionaryManipulator/orderDictionaries.mjs";
|
|
37
|
+
import { normalizeDictionaries, normalizeDictionary } from "./dictionaryManipulator/normalizeDictionary.mjs";
|
|
38
|
+
import { getUnmergedDictionaryByKeyPath } from "./dictionaryManipulator/getUnmergedDictionaryByKeyPath.mjs";
|
|
39
|
+
import { mergeDictionaries } from "./dictionaryManipulator/mergeDictionaries.mjs";
|
|
40
|
+
import { removeContentNodeByKeyPath } from "./dictionaryManipulator/removeContentNodeByKeyPath.mjs";
|
|
41
|
+
import { renameContentNodeByKeyPath } from "./dictionaryManipulator/renameContentNodeByKeyPath.mjs";
|
|
42
|
+
import { updateNodeChildren } from "./dictionaryManipulator/updateNodeChildren.mjs";
|
|
43
|
+
import { CachedIntl, createCachedIntl } from "./utils/intl.mjs";
|
|
44
|
+
import { compact } from "./formatters/compact.mjs";
|
|
45
|
+
import { currency } from "./formatters/currency.mjs";
|
|
46
|
+
import { date } from "./formatters/date.mjs";
|
|
47
|
+
import { list } from "./formatters/list.mjs";
|
|
48
|
+
import { number } from "./formatters/number.mjs";
|
|
49
|
+
import { percentage } from "./formatters/percentage.mjs";
|
|
50
|
+
import { relativeTime } from "./formatters/relativeTime.mjs";
|
|
51
|
+
import { units } from "./formatters/units.mjs";
|
|
52
|
+
import { LocaleStorage, getLocaleFromStorage, setLocaleInStorage } from "./utils/localeStorage.mjs";
|
|
53
|
+
import { localeResolver } from "./localization/localeResolver.mjs";
|
|
54
|
+
import { localeDetector } from "./localization/localeDetector.mjs";
|
|
55
|
+
import { getBrowserLocale, localeStorageOptions } from "./localization/getBrowserLocale.mjs";
|
|
56
|
+
import { getHTMLTextDir } from "./localization/getHTMLTextDir.mjs";
|
|
57
|
+
import { checkIsURLAbsolute } from "./utils/checkIsURLAbsolute.mjs";
|
|
58
|
+
import { getLocaleFromPath } from "./localization/getLocaleFromPath.mjs";
|
|
59
|
+
import { getLocaleLang } from "./localization/getLocaleLang.mjs";
|
|
60
|
+
import { getLocaleName } from "./localization/getLocaleName.mjs";
|
|
61
|
+
import { getPathWithoutLocale } from "./localization/getPathWithoutLocale.mjs";
|
|
62
|
+
import { getMultilingualUrls } from "./localization/getMultilingualUrls.mjs";
|
|
63
|
+
import { getLocalizedUrl } from "./localization/getLocalizedUrl.mjs";
|
|
64
|
+
import { localeFlatMap, localeMap, localeRecord } from "./localization/localeMapper.mjs";
|
|
65
|
+
import { isSameKeyPath } from "./utils/isSameKeyPath.mjs";
|
|
66
|
+
|
|
67
|
+
export { CachedIntl, CachedIntl as Intl, LocaleStorage, buildMaskPlugin, checkIsURLAbsolute, checkMissingLocalesPlugin, compact, condition as cond, conditionPlugin, createCachedIntl, currency, date, deepTransformNode, editDictionaryByKeyPath, enumeration as enu, enumerationPlugin, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, gender, genderPlugin, getBrowserLocale, getCondition, getContent, getContentNodeByKeyPath, getDefaultNode, getDictionary, getEmptyNode, getEnumeration, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getHTMLTextDir, getInsertionValues, getIntlayer, getLocaleFromPath, getLocaleFromStorage, getLocaleLang, getLocaleName, getLocalizedContent, getLocalizedUrl, getMarkdownMetadata, getMaskContent, getMissingLocalesContent, getMultilingualUrls, getNesting, getNodeChildren, getNodeType, getPathWithoutLocale, getPerLocaleDictionary, getReplacedValuesContent, getStorageAttributes, getTranslation, getUnmergedDictionaryByKeyPath, insertion as insert, insertContentInDictionary, insertionPlugin, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, nesting as nest, nestedPlugin, normalizeDictionaries, normalizeDictionary, number, orderDictionaries, parseYaml, percentage, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, setLocaleInStorage, translation as t, translationPlugin, units, updateNodeChildren };
|
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
//#region src/interpreter/getCondition.ts
|
|
2
|
+
/**
|
|
3
|
+
* Allow to pick a content based on a condition.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const content = getCondition({
|
|
9
|
+
* 'true': 'The condition is validated',
|
|
10
|
+
* 'false': 'The condition is not validated',
|
|
11
|
+
* }, true);
|
|
12
|
+
* // 'The condition is validated'
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* The last key provided will be used as the fallback value.
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* const content = getCondition({
|
|
19
|
+
* 'false': 'The condition is not validated',
|
|
20
|
+
* 'true': 'The condition is validated',
|
|
21
|
+
* }, undefined);
|
|
22
|
+
* // 'The condition is validated'
|
|
23
|
+
*/
|
|
1
24
|
const getCondition = (conditionContent, state) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
getCondition
|
|
25
|
+
const stateList = Object.keys(conditionContent);
|
|
26
|
+
const fallbackState = stateList[stateList.length - 1];
|
|
27
|
+
return conditionContent[`${state}`] ?? conditionContent.fallback ?? conditionContent[fallbackState];
|
|
8
28
|
};
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { getCondition };
|
|
9
32
|
//# sourceMappingURL=getCondition.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/interpreter/getCondition.ts"],"sourcesContent":["import type { ConditionContentStates } from '../transpiler
|
|
1
|
+
{"version":3,"file":"getCondition.mjs","names":[],"sources":["../../../src/interpreter/getCondition.ts"],"sourcesContent":["import type { ConditionContentStates } from '../transpiler';\n\n/**\n * Allow to pick a content based on a condition.\n *\n * Usage:\n *\n * ```ts\n * const content = getCondition({\n * 'true': 'The condition is validated',\n * 'false': 'The condition is not validated',\n * }, true);\n * // 'The condition is validated'\n * ```\n *\n * The last key provided will be used as the fallback value.\n *\n * ```ts\n * const content = getCondition({\n * 'false': 'The condition is not validated',\n * 'true': 'The condition is validated',\n * }, undefined);\n * // 'The condition is validated'\n */\nexport const getCondition = <Content>(\n conditionContent: ConditionContentStates<Content>,\n state?: boolean\n): Content => {\n const stateList = Object.keys(conditionContent);\n const fallbackState = stateList[\n stateList.length - 1\n ] as keyof typeof conditionContent;\n\n // Default or error handling if no keys match\n return (\n conditionContent[`${state}` as keyof typeof conditionContent] ??\n conditionContent.fallback ??\n (conditionContent[fallbackState] as Content)\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,gBACX,kBACA,UACY;CACZ,MAAM,YAAY,OAAO,KAAK,iBAAiB;CAC/C,MAAM,gBAAgB,UACpB,UAAU,SAAS;AAIrB,QACE,iBAAiB,GAAG,YACpB,iBAAiB,YAChB,iBAAiB"}
|
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
import { NodeType } from "
|
|
1
|
+
import { NodeType } from "@intlayer/types";
|
|
2
|
+
|
|
3
|
+
//#region src/interpreter/getContent/deepTransform.ts
|
|
4
|
+
/**
|
|
5
|
+
* Recursively traverses a node (object/array/primitive).
|
|
6
|
+
* Applies the *first* plugin that can transform a node, then stops descending further.
|
|
7
|
+
* If no plugin transforms it, it recurses into its children.
|
|
8
|
+
*/
|
|
2
9
|
const deepTransformNode = (node, props) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const result = {};
|
|
29
|
-
for (const key in node) {
|
|
30
|
-
const childProps = {
|
|
31
|
-
...props,
|
|
32
|
-
children: node[key],
|
|
33
|
-
keyPath: [...props.keyPath, { type: NodeType.Object, key }]
|
|
34
|
-
};
|
|
35
|
-
result[key] = deepTransformNode(node[key], childProps);
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
deepTransformNode
|
|
10
|
+
for (const plugin of props.plugins ?? []) if (plugin.canHandle(node)) return plugin.transform(node, props, (node$1, props$1) => deepTransformNode(node$1, props$1));
|
|
11
|
+
if (node === null || typeof node !== "object") return node;
|
|
12
|
+
if (Array.isArray(node)) return node.map((child, index) => {
|
|
13
|
+
return deepTransformNode(child, {
|
|
14
|
+
...props,
|
|
15
|
+
children: child,
|
|
16
|
+
keyPath: [...props.keyPath, {
|
|
17
|
+
type: NodeType.Array,
|
|
18
|
+
key: index
|
|
19
|
+
}]
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
const result = {};
|
|
23
|
+
for (const key in node) {
|
|
24
|
+
const childProps = {
|
|
25
|
+
...props,
|
|
26
|
+
children: node[key],
|
|
27
|
+
keyPath: [...props.keyPath, {
|
|
28
|
+
type: NodeType.Object,
|
|
29
|
+
key
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
|
+
result[key] = deepTransformNode(node[key], childProps);
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
41
35
|
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { deepTransformNode };
|
|
42
39
|
//# sourceMappingURL=deepTransform.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/interpreter/getContent/deepTransform.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '
|
|
1
|
+
{"version":3,"file":"deepTransform.mjs","names":["node","props","result: Record<string, any>"],"sources":["../../../../src/interpreter/getContent/deepTransform.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '@intlayer/types';\nimport type { NodeProps } from './plugins';\n\n/**\n * Recursively traverses a node (object/array/primitive).\n * Applies the *first* plugin that can transform a node, then stops descending further.\n * If no plugin transforms it, it recurses into its children.\n */\nexport const deepTransformNode = (node: any, props: NodeProps): any => {\n // Otherwise, if it's an object, check if any plugin can handle it:\n for (const plugin of props.plugins ?? []) {\n if (plugin.canHandle(node)) {\n // Return the transformed node => do NOT recurse further\n return plugin.transform(node, props, (node: any, props: any) =>\n deepTransformNode(node, props)\n );\n }\n }\n\n // If it's null/undefined or not an object, just return it directly:\n if (node === null || typeof node !== 'object') {\n return node;\n }\n\n // If it's an array, transform each element:\n if (Array.isArray(node)) {\n return node.map((child, index) => {\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Array, key: index } as KeyPath,\n ],\n };\n return deepTransformNode(child, childProps);\n });\n }\n\n // If no plugin transforms it, we keep traversing its properties.\n const result: Record<string, any> = {};\n for (const key in node) {\n const childProps = {\n ...props,\n children: node[key],\n keyPath: [...props.keyPath, { type: NodeType.Object, key } as KeyPath],\n };\n result[key] = deepTransformNode(node[key], childProps);\n }\n\n return result;\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,qBAAqB,MAAW,UAA0B;AAErE,MAAK,MAAM,UAAU,MAAM,WAAW,EAAE,CACtC,KAAI,OAAO,UAAU,KAAK,CAExB,QAAO,OAAO,UAAU,MAAM,QAAQ,QAAW,YAC/C,kBAAkBA,QAAMC,QAAM,CAC/B;AAKL,KAAI,SAAS,QAAQ,OAAO,SAAS,SACnC,QAAO;AAIT,KAAI,MAAM,QAAQ,KAAK,CACrB,QAAO,KAAK,KAAK,OAAO,UAAU;AAShC,SAAO,kBAAkB,OARN;GACjB,GAAG;GACH,UAAU;GACV,SAAS,CACP,GAAG,MAAM,SACT;IAAE,MAAM,SAAS;IAAO,KAAK;IAAO,CACrC;GACF,CAC0C;GAC3C;CAIJ,MAAMC,SAA8B,EAAE;AACtC,MAAK,MAAM,OAAO,MAAM;EACtB,MAAM,aAAa;GACjB,GAAG;GACH,UAAU,KAAK;GACf,SAAS,CAAC,GAAG,MAAM,SAAS;IAAE,MAAM,SAAS;IAAQ;IAAK,CAAY;GACvE;AACD,SAAO,OAAO,kBAAkB,KAAK,MAAM,WAAW;;AAGxD,QAAO"}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import configuration from "@intlayer/config/built";
|
|
2
1
|
import { deepTransformNode } from "./deepTransform.mjs";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
import { conditionPlugin, enumerationPlugin, filePlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./plugins.mjs";
|
|
3
|
+
import configuration from "@intlayer/config/built";
|
|
4
|
+
|
|
5
|
+
//#region src/interpreter/getContent/getContent.ts
|
|
6
|
+
/**
|
|
7
|
+
* Transforms a node in a single pass, applying each plugin as needed.
|
|
8
|
+
*
|
|
9
|
+
* @param node The node to transform.
|
|
10
|
+
* @param locale The locale to use if your transformers need it (e.g. for translations).
|
|
11
|
+
*/
|
|
12
|
+
const getContent = (node, nodeProps, locale) => {
|
|
13
|
+
const defaultLocale = configuration?.internationalization?.defaultLocale;
|
|
14
|
+
const plugins = [
|
|
15
|
+
insertionPlugin,
|
|
16
|
+
translationPlugin(locale ?? defaultLocale, defaultLocale),
|
|
17
|
+
enumerationPlugin,
|
|
18
|
+
conditionPlugin,
|
|
19
|
+
nestedPlugin,
|
|
20
|
+
filePlugin,
|
|
21
|
+
...nodeProps.plugins ?? []
|
|
22
|
+
];
|
|
23
|
+
return deepTransformNode(node, {
|
|
24
|
+
...nodeProps,
|
|
25
|
+
plugins
|
|
26
|
+
});
|
|
28
27
|
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { getContent };
|
|
29
31
|
//# sourceMappingURL=getContent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/interpreter/getContent/getContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type {
|
|
1
|
+
{"version":3,"file":"getContent.mjs","names":["plugins: Plugins[]"],"sources":["../../../../src/interpreter/getContent/getContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type {\n ContentNode,\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types';\nimport { deepTransformNode } from './deepTransform';\nimport {\n conditionPlugin,\n type DeepTransformContent,\n enumerationPlugin,\n filePlugin,\n type IInterpreterPluginState,\n insertionPlugin,\n type NodeProps,\n nestedPlugin,\n type Plugins,\n translationPlugin,\n} from './plugins';\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getContent = <\n T extends ContentNode,\n L extends LocalesValues = DeclaredLocales,\n>(\n node: T,\n nodeProps: NodeProps,\n locale?: L\n) => {\n const defaultLocale = configuration?.internationalization?.defaultLocale;\n\n const plugins: Plugins[] = [\n insertionPlugin,\n translationPlugin(locale ?? defaultLocale, defaultLocale),\n enumerationPlugin,\n conditionPlugin,\n nestedPlugin,\n filePlugin,\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T, IInterpreterPluginState, L>;\n};\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,cAIX,MACA,WACA,WACG;CACH,MAAM,gBAAgB,eAAe,sBAAsB;CAE3D,MAAMA,UAAqB;EACzB;EACA,kBAAkB,UAAU,eAAe,cAAc;EACzD;EACA;EACA;EACA;EACA,GAAI,UAAU,WAAW,EAAE;EAC5B;AAED,QAAO,kBAAkB,MAAM;EAC7B,GAAG;EACH;EACD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { deepTransformNode } from "./deepTransform.mjs";
|
|
2
|
+
import { conditionPlugin, enumerationPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./plugins.mjs";
|
|
3
|
+
import { getContent } from "./getContent.mjs";
|
|
4
|
+
|
|
5
|
+
export { conditionPlugin, deepTransformNode, enumerationPlugin, filePlugin, genderPlugin, getContent, insertionPlugin, nestedPlugin, translationPlugin };
|
|
@@ -1,160 +1,142 @@
|
|
|
1
|
-
import { NodeType } from "../../types/index.mjs";
|
|
2
1
|
import { getCondition } from "../getCondition.mjs";
|
|
3
2
|
import { getEnumeration } from "../getEnumeration.mjs";
|
|
4
3
|
import { getGender } from "../getGender.mjs";
|
|
5
4
|
import { getInsertion } from "../getInsertion.mjs";
|
|
6
5
|
import { getNesting } from "../getNesting.mjs";
|
|
7
6
|
import { getTranslation } from "../getTranslation.mjs";
|
|
7
|
+
import { NodeType } from "@intlayer/types";
|
|
8
|
+
|
|
9
|
+
//#region src/interpreter/getContent/plugins.ts
|
|
10
|
+
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
8
11
|
const translationPlugin = (locale, fallback) => ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
return getTranslation(result, locale, fallback);
|
|
28
|
-
}
|
|
12
|
+
id: "translation-plugin",
|
|
13
|
+
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Translation,
|
|
14
|
+
transform: (node, props, deepTransformNode) => {
|
|
15
|
+
const result = structuredClone(node[NodeType.Translation]);
|
|
16
|
+
for (const key in result) {
|
|
17
|
+
const childProps = {
|
|
18
|
+
...props,
|
|
19
|
+
children: result[key],
|
|
20
|
+
keyPath: [...props.keyPath, {
|
|
21
|
+
type: NodeType.Translation,
|
|
22
|
+
key
|
|
23
|
+
}]
|
|
24
|
+
};
|
|
25
|
+
result[key] = deepTransformNode(result[key], childProps);
|
|
26
|
+
}
|
|
27
|
+
return getTranslation(result, locale, fallback);
|
|
28
|
+
}
|
|
29
29
|
});
|
|
30
|
+
/** Enumeration plugin. Replaces node with a function that takes quantity => string. */
|
|
30
31
|
const enumerationPlugin = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
return (quantity) => getEnumeration(result, quantity);
|
|
51
|
-
}
|
|
32
|
+
id: "enumeration-plugin",
|
|
33
|
+
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Enumeration,
|
|
34
|
+
transform: (node, props, deepTransformNode) => {
|
|
35
|
+
const result = structuredClone(node[NodeType.Enumeration]);
|
|
36
|
+
for (const key in result) {
|
|
37
|
+
const child = result[key];
|
|
38
|
+
result[key] = deepTransformNode(child, {
|
|
39
|
+
...props,
|
|
40
|
+
children: child,
|
|
41
|
+
keyPath: [...props.keyPath, {
|
|
42
|
+
type: NodeType.Enumeration,
|
|
43
|
+
key
|
|
44
|
+
}]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return (quantity) => getEnumeration(result, quantity);
|
|
48
|
+
}
|
|
52
49
|
};
|
|
50
|
+
/** Condition plugin. Replaces node with a function that takes boolean => string. */
|
|
53
51
|
const conditionPlugin = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return (value) => getCondition(result, value);
|
|
74
|
-
}
|
|
52
|
+
id: "condition-plugin",
|
|
53
|
+
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Condition,
|
|
54
|
+
transform: (node, props, deepTransformNode) => {
|
|
55
|
+
const result = structuredClone(node[NodeType.Condition]);
|
|
56
|
+
for (const key in result) {
|
|
57
|
+
const child = result[key];
|
|
58
|
+
result[key] = deepTransformNode(child, {
|
|
59
|
+
...props,
|
|
60
|
+
children: child,
|
|
61
|
+
keyPath: [...props.keyPath, {
|
|
62
|
+
type: NodeType.Condition,
|
|
63
|
+
key
|
|
64
|
+
}]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return (value) => getCondition(result, value);
|
|
68
|
+
}
|
|
75
69
|
};
|
|
70
|
+
/** Gender plugin. Replaces node with a function that takes gender => string. */
|
|
76
71
|
const genderPlugin = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
72
|
+
id: "gender-plugin",
|
|
73
|
+
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Gender,
|
|
74
|
+
transform: (node, props, deepTransformNode) => {
|
|
75
|
+
const result = structuredClone(node[NodeType.Gender]);
|
|
76
|
+
for (const key in result) {
|
|
77
|
+
const child = result[key];
|
|
78
|
+
result[key] = deepTransformNode(child, {
|
|
79
|
+
...props,
|
|
80
|
+
children: child,
|
|
81
|
+
keyPath: [...props.keyPath, {
|
|
82
|
+
type: NodeType.Gender,
|
|
83
|
+
key
|
|
84
|
+
}]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return (value) => getGender(result, value);
|
|
88
|
+
}
|
|
95
89
|
};
|
|
96
90
|
const insertionPlugin = {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
};
|
|
130
|
-
return deepTransformNode(children, {
|
|
131
|
-
...props,
|
|
132
|
-
children,
|
|
133
|
-
keyPath: newKeyPath,
|
|
134
|
-
plugins: [insertionStringPlugin, ...props.plugins ?? []]
|
|
135
|
-
});
|
|
136
|
-
}
|
|
91
|
+
id: "insertion-plugin",
|
|
92
|
+
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Insertion,
|
|
93
|
+
transform: (node, props, deepTransformNode) => {
|
|
94
|
+
const newKeyPath = [...props.keyPath, { type: NodeType.Insertion }];
|
|
95
|
+
const children = node[NodeType.Insertion];
|
|
96
|
+
/** Insertion string plugin. Replaces string node with a component that render the insertion. */
|
|
97
|
+
const insertionStringPlugin = {
|
|
98
|
+
id: "insertion-string-plugin",
|
|
99
|
+
canHandle: (node$1) => typeof node$1 === "string",
|
|
100
|
+
transform: (node$1, subProps, deepTransformNode$1) => {
|
|
101
|
+
const transformedResult = deepTransformNode$1(node$1, {
|
|
102
|
+
...subProps,
|
|
103
|
+
children: node$1,
|
|
104
|
+
plugins: [...(props.plugins ?? []).filter((plugin) => plugin.id !== "intlayer-node-plugin")]
|
|
105
|
+
});
|
|
106
|
+
return (values) => {
|
|
107
|
+
const children$1 = getInsertion(transformedResult, values);
|
|
108
|
+
return deepTransformNode$1(children$1, {
|
|
109
|
+
...subProps,
|
|
110
|
+
plugins: props.plugins,
|
|
111
|
+
children: children$1
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
return deepTransformNode(children, {
|
|
117
|
+
...props,
|
|
118
|
+
children,
|
|
119
|
+
keyPath: newKeyPath,
|
|
120
|
+
plugins: [insertionStringPlugin, ...props.plugins ?? []]
|
|
121
|
+
});
|
|
122
|
+
}
|
|
137
123
|
};
|
|
124
|
+
/** Nested plugin. Replaces node with the result of `getNesting`. */
|
|
138
125
|
const nestedPlugin = {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
126
|
+
id: "nested-plugin",
|
|
127
|
+
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Nested,
|
|
128
|
+
transform: (node, props) => getNesting(node.nested.dictionaryKey, node.nested.path, props)
|
|
142
129
|
};
|
|
130
|
+
/** File plugin. Replaces node with the result of `getNesting`. */
|
|
143
131
|
const filePlugin = {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
};
|
|
151
|
-
export {
|
|
152
|
-
conditionPlugin,
|
|
153
|
-
enumerationPlugin,
|
|
154
|
-
filePlugin,
|
|
155
|
-
genderPlugin,
|
|
156
|
-
insertionPlugin,
|
|
157
|
-
nestedPlugin,
|
|
158
|
-
translationPlugin
|
|
132
|
+
id: "file-plugin",
|
|
133
|
+
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.File,
|
|
134
|
+
transform: (node, props, deepTransform) => deepTransform(node.content, {
|
|
135
|
+
...props,
|
|
136
|
+
children: node.content
|
|
137
|
+
})
|
|
159
138
|
};
|
|
139
|
+
|
|
140
|
+
//#endregion
|
|
141
|
+
export { conditionPlugin, enumerationPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin };
|
|
160
142
|
//# sourceMappingURL=plugins.mjs.map
|