@intlayer/core 8.4.4 → 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.
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs +213 -1
- package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs +95 -1
- package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs +46 -1
- package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs +33 -1
- package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getMaskContent.cjs +27 -1
- package/dist/cjs/deepTransformPlugins/getMaskContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs +151 -1
- package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs +87 -1
- package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs +60 -1
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs +123 -1
- package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/index.cjs +32 -1
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +107 -1
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +65 -1
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +19 -1
- package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +56 -1
- package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +27 -1
- package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +24 -1
- package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs +55 -1
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/index.cjs +27 -1
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +69 -1
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs +30 -1
- package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +48 -1
- package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +32 -1
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +40 -1
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs +39 -1
- package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
- package/dist/cjs/formatters/compact.cjs +25 -1
- package/dist/cjs/formatters/compact.cjs.map +1 -1
- package/dist/cjs/formatters/currency.cjs +29 -1
- package/dist/cjs/formatters/currency.cjs.map +1 -1
- package/dist/cjs/formatters/date.cjs +60 -1
- package/dist/cjs/formatters/date.cjs.map +1 -1
- package/dist/cjs/formatters/index.cjs +23 -1
- package/dist/cjs/formatters/list.cjs +30 -1
- package/dist/cjs/formatters/list.cjs.map +1 -1
- package/dist/cjs/formatters/number.cjs +20 -1
- package/dist/cjs/formatters/number.cjs.map +1 -1
- package/dist/cjs/formatters/percentage.cjs +27 -1
- package/dist/cjs/formatters/percentage.cjs.map +1 -1
- package/dist/cjs/formatters/relativeTime.cjs +43 -1
- package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
- package/dist/cjs/formatters/units.cjs +23 -1
- package/dist/cjs/formatters/units.cjs.map +1 -1
- package/dist/cjs/getStorageAttributes.cjs +134 -1
- package/dist/cjs/getStorageAttributes.cjs.map +1 -1
- package/dist/cjs/index.cjs +315 -1
- package/dist/cjs/interpreter/getCondition.cjs +27 -1
- package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/deepTransform.cjs +42 -1
- package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/getContent.cjs +32 -1
- package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -0
- package/dist/cjs/interpreter/getContent/index.cjs +15 -1
- package/dist/cjs/interpreter/getContent/plugins.cjs +163 -1
- package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -0
- package/dist/cjs/interpreter/getDictionary.cjs +25 -1
- package/dist/cjs/interpreter/getDictionary.cjs.map +1 -0
- package/dist/cjs/interpreter/getEnumeration.cjs +72 -1
- package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
- package/dist/cjs/interpreter/getGender.cjs +38 -1
- package/dist/cjs/interpreter/getGender.cjs.map +1 -1
- package/dist/cjs/interpreter/getHTML.cjs +124 -1
- package/dist/cjs/interpreter/getHTML.cjs.map +1 -1
- package/dist/cjs/interpreter/getInsertion.cjs +22 -1
- package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
- package/dist/cjs/interpreter/getIntlayer.cjs +41 -1
- package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -0
- package/dist/cjs/interpreter/getNesting.cjs +37 -1
- package/dist/cjs/interpreter/getNesting.cjs.map +1 -0
- package/dist/cjs/interpreter/getTranslation.cjs +112 -1
- package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
- package/dist/cjs/interpreter/index.cjs +32 -1
- package/dist/cjs/interpreter/splitAndJoinInsertion.cjs +55 -1
- package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
- package/dist/cjs/localization/getBrowserLocale.cjs +143 -1
- package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
- package/dist/cjs/localization/getHTMLTextDir.cjs +40 -1
- package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
- package/dist/cjs/localization/getLocale.cjs +27 -1
- package/dist/cjs/localization/getLocale.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleFromPath.cjs +36 -1
- package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleLang.cjs +20 -1
- package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleName.cjs +10 -1
- package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
- package/dist/cjs/localization/getLocalizedUrl.cjs +73 -1
- package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
- package/dist/cjs/localization/getMultilingualUrls.cjs +46 -1
- package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
- package/dist/cjs/localization/getPathWithoutLocale.cjs +55 -1
- package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
- package/dist/cjs/localization/getPrefix.cjs +73 -1
- package/dist/cjs/localization/getPrefix.cjs.map +1 -1
- package/dist/cjs/localization/index.cjs +41 -1
- package/dist/cjs/localization/localeDetector.cjs +133 -1
- package/dist/cjs/localization/localeDetector.cjs.map +1 -1
- package/dist/cjs/localization/localeMapper.cjs +124 -1
- package/dist/cjs/localization/localeMapper.cjs.map +1 -1
- package/dist/cjs/localization/localeResolver.cjs +28 -1
- package/dist/cjs/localization/localeResolver.cjs.map +1 -1
- package/dist/cjs/localization/rewriteUtils.cjs +110 -1
- package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
- package/dist/cjs/localization/validatePrefix.cjs +45 -1
- package/dist/cjs/localization/validatePrefix.cjs.map +1 -1
- package/dist/cjs/markdown/compiler.cjs +810 -10
- package/dist/cjs/markdown/compiler.cjs.map +1 -1
- package/dist/cjs/markdown/constants.cjs +328 -1
- package/dist/cjs/markdown/constants.cjs.map +1 -1
- package/dist/cjs/markdown/index.cjs +126 -1
- package/dist/cjs/markdown/parser.cjs +66 -1
- package/dist/cjs/markdown/parser.cjs.map +1 -1
- package/dist/cjs/markdown/renderer.cjs +61 -1
- package/dist/cjs/markdown/renderer.cjs.map +1 -1
- package/dist/cjs/markdown/utils.cjs +391 -6
- package/dist/cjs/markdown/utils.cjs.map +1 -1
- package/dist/cjs/messageFormat/ICU.cjs +334 -1
- package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
- package/dist/cjs/messageFormat/i18next.cjs +345 -1
- package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
- package/dist/cjs/messageFormat/index.cjs +11 -1
- package/dist/cjs/messageFormat/verify-icu-format.cjs +64 -2
- package/dist/cjs/messageFormat/verify-icu-format.cjs.map +1 -1
- package/dist/cjs/messageFormat/vue-i18n.cjs +181 -1
- package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
- package/dist/cjs/transpiler/condition/condition.cjs +26 -1
- package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
- package/dist/cjs/transpiler/condition/index.cjs +4 -1
- package/dist/cjs/transpiler/enumeration/enumeration.cjs +28 -1
- package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
- package/dist/cjs/transpiler/enumeration/index.cjs +4 -1
- package/dist/cjs/transpiler/file/file.cjs +51 -1
- package/dist/cjs/transpiler/file/file.cjs.map +1 -1
- package/dist/cjs/transpiler/file/fileBrowser.cjs +24 -1
- package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
- package/dist/cjs/transpiler/file/index.cjs +5 -1
- package/dist/cjs/transpiler/gender/gender.cjs +26 -1
- package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
- package/dist/cjs/transpiler/gender/index.cjs +4 -1
- package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +45 -1
- package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -0
- package/dist/cjs/transpiler/html/html.cjs +44 -1
- package/dist/cjs/transpiler/html/html.cjs.map +1 -0
- package/dist/cjs/transpiler/html/htmlTags.cjs +116 -1
- package/dist/cjs/transpiler/html/htmlTags.cjs.map +1 -1
- package/dist/cjs/transpiler/html/index.cjs +9 -1
- package/dist/cjs/transpiler/html/validateHTML.cjs +65 -1
- package/dist/cjs/transpiler/html/validateHTML.cjs.map +1 -1
- package/dist/cjs/transpiler/index.cjs +29 -1
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +11 -1
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
- package/dist/cjs/transpiler/insertion/index.cjs +6 -1
- package/dist/cjs/transpiler/insertion/insertion.cjs +36 -1
- package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +23 -2
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/index.cjs +8 -1
- package/dist/cjs/transpiler/markdown/markdown.cjs +62 -1
- package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/validateMarkdown.cjs +74 -4
- package/dist/cjs/transpiler/markdown/validateMarkdown.cjs.map +1 -1
- package/dist/cjs/transpiler/nesting/index.cjs +4 -1
- package/dist/cjs/transpiler/nesting/nesting.cjs +27 -1
- package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
- package/dist/cjs/transpiler/translation/index.cjs +4 -1
- package/dist/cjs/transpiler/translation/translation.cjs +29 -1
- package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
- package/dist/cjs/utils/checkIsURLAbsolute.cjs +7 -1
- package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
- package/dist/cjs/utils/getCookie.cjs +32 -1
- package/dist/cjs/utils/getCookie.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +21 -1
- package/dist/cjs/utils/intl.cjs +91 -1
- package/dist/cjs/utils/intl.cjs.map +1 -1
- package/dist/cjs/utils/isSameKeyPath.cjs +7 -1
- package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
- package/dist/cjs/utils/isValidReactElement.cjs +14 -1
- package/dist/cjs/utils/isValidReactElement.cjs.map +1 -1
- package/dist/cjs/utils/localeStorage.cjs +140 -1
- package/dist/cjs/utils/localeStorage.cjs.map +1 -1
- package/dist/cjs/utils/parseYaml.cjs +322 -16
- package/dist/cjs/utils/parseYaml.cjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs +207 -1
- package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs +89 -1
- package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs +42 -1
- package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs +31 -1
- package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getMaskContent.mjs +25 -1
- package/dist/esm/deepTransformPlugins/getMaskContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs +145 -1
- package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs +86 -1
- package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs +59 -1
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getSplittedContent.mjs +119 -1
- package/dist/esm/deepTransformPlugins/getSplittedContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/index.mjs +12 -1
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs +104 -1
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +62 -1
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs +16 -1
- package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getDefaultNode.mjs +53 -1
- package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getEmptyNode.mjs +24 -1
- package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +21 -1
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getNodeType.mjs +52 -1
- package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/index.mjs +14 -1
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +66 -1
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs +28 -1
- package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/orderDictionaries.mjs +45 -1
- package/dist/esm/dictionaryManipulator/orderDictionaries.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +29 -1
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +37 -1
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs +36 -1
- package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs.map +1 -1
- package/dist/esm/formatters/compact.mjs +22 -1
- package/dist/esm/formatters/compact.mjs.map +1 -1
- package/dist/esm/formatters/currency.mjs +26 -1
- package/dist/esm/formatters/currency.mjs.map +1 -1
- package/dist/esm/formatters/date.mjs +57 -1
- package/dist/esm/formatters/date.mjs.map +1 -1
- package/dist/esm/formatters/index.mjs +11 -1
- package/dist/esm/formatters/list.mjs +27 -1
- package/dist/esm/formatters/list.mjs.map +1 -1
- package/dist/esm/formatters/number.mjs +17 -1
- package/dist/esm/formatters/number.mjs.map +1 -1
- package/dist/esm/formatters/percentage.mjs +24 -1
- package/dist/esm/formatters/percentage.mjs.map +1 -1
- package/dist/esm/formatters/relativeTime.mjs +40 -1
- package/dist/esm/formatters/relativeTime.mjs.map +1 -1
- package/dist/esm/formatters/units.mjs +20 -1
- package/dist/esm/formatters/units.mjs.map +1 -1
- package/dist/esm/getStorageAttributes.mjs +132 -1
- package/dist/esm/getStorageAttributes.mjs.map +1 -1
- package/dist/esm/index.mjs +87 -1
- package/dist/esm/interpreter/getCondition.mjs +25 -1
- package/dist/esm/interpreter/getCondition.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/deepTransform.mjs +39 -1
- package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/getContent.mjs +28 -1
- package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -0
- package/dist/esm/interpreter/getContent/index.mjs +5 -1
- package/dist/esm/interpreter/getContent/plugins.mjs +154 -1
- package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -0
- package/dist/esm/interpreter/getDictionary.mjs +24 -1
- package/dist/esm/interpreter/getDictionary.mjs.map +1 -0
- package/dist/esm/interpreter/getEnumeration.mjs +69 -1
- package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
- package/dist/esm/interpreter/getGender.mjs +36 -1
- package/dist/esm/interpreter/getGender.mjs.map +1 -1
- package/dist/esm/interpreter/getHTML.mjs +122 -1
- package/dist/esm/interpreter/getHTML.mjs.map +1 -1
- package/dist/esm/interpreter/getInsertion.mjs +20 -1
- package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
- package/dist/esm/interpreter/getIntlayer.mjs +37 -1
- package/dist/esm/interpreter/getIntlayer.mjs.map +1 -0
- package/dist/esm/interpreter/getNesting.mjs +36 -1
- package/dist/esm/interpreter/getNesting.mjs.map +1 -0
- package/dist/esm/interpreter/getTranslation.mjs +110 -1
- package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
- package/dist/esm/interpreter/index.mjs +13 -1
- package/dist/esm/interpreter/splitAndJoinInsertion.mjs +53 -1
- package/dist/esm/interpreter/splitAndJoinInsertion.mjs.map +1 -1
- package/dist/esm/localization/getBrowserLocale.mjs +138 -1
- package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
- package/dist/esm/localization/getHTMLTextDir.mjs +38 -1
- package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
- package/dist/esm/localization/getLocale.mjs +24 -1
- package/dist/esm/localization/getLocale.mjs.map +1 -1
- package/dist/esm/localization/getLocaleFromPath.mjs +35 -1
- package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
- package/dist/esm/localization/getLocaleLang.mjs +18 -1
- package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
- package/dist/esm/localization/getLocaleName.mjs +9 -1
- package/dist/esm/localization/getLocaleName.mjs.map +1 -1
- package/dist/esm/localization/getLocalizedUrl.mjs +70 -1
- package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
- package/dist/esm/localization/getMultilingualUrls.mjs +45 -1
- package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
- package/dist/esm/localization/getPathWithoutLocale.mjs +52 -1
- package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
- package/dist/esm/localization/getPrefix.mjs +69 -1
- package/dist/esm/localization/getPrefix.mjs.map +1 -1
- package/dist/esm/localization/index.mjs +18 -1
- package/dist/esm/localization/localeDetector.mjs +131 -1
- package/dist/esm/localization/localeDetector.mjs.map +1 -1
- package/dist/esm/localization/localeMapper.mjs +119 -1
- package/dist/esm/localization/localeMapper.mjs.map +1 -1
- package/dist/esm/localization/localeResolver.mjs +25 -1
- package/dist/esm/localization/localeResolver.mjs.map +1 -1
- package/dist/esm/localization/rewriteUtils.mjs +104 -1
- package/dist/esm/localization/rewriteUtils.mjs.map +1 -1
- package/dist/esm/localization/validatePrefix.mjs +44 -1
- package/dist/esm/localization/validatePrefix.mjs.map +1 -1
- package/dist/esm/markdown/compiler.mjs +786 -10
- package/dist/esm/markdown/compiler.mjs.map +1 -1
- package/dist/esm/markdown/constants.mjs +247 -1
- package/dist/esm/markdown/constants.mjs.map +1 -1
- package/dist/esm/markdown/index.mjs +10 -1
- package/dist/esm/markdown/parser.mjs +65 -1
- package/dist/esm/markdown/parser.mjs.map +1 -1
- package/dist/esm/markdown/renderer.mjs +59 -1
- package/dist/esm/markdown/renderer.mjs.map +1 -1
- package/dist/esm/markdown/utils.mjs +361 -6
- package/dist/esm/markdown/utils.mjs.map +1 -1
- package/dist/esm/messageFormat/ICU.mjs +330 -1
- package/dist/esm/messageFormat/ICU.mjs.map +1 -1
- package/dist/esm/messageFormat/i18next.mjs +341 -1
- package/dist/esm/messageFormat/i18next.mjs.map +1 -1
- package/dist/esm/messageFormat/index.mjs +5 -1
- package/dist/esm/messageFormat/verify-icu-format.mjs +64 -2
- package/dist/esm/messageFormat/verify-icu-format.mjs.map +1 -1
- package/dist/esm/messageFormat/vue-i18n.mjs +177 -1
- package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
- package/dist/esm/transpiler/condition/condition.mjs +24 -1
- package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
- package/dist/esm/transpiler/condition/index.mjs +3 -1
- package/dist/esm/transpiler/enumeration/enumeration.mjs +26 -1
- package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
- package/dist/esm/transpiler/enumeration/index.mjs +3 -1
- package/dist/esm/transpiler/file/file.mjs +48 -1
- package/dist/esm/transpiler/file/file.mjs.map +1 -1
- package/dist/esm/transpiler/file/fileBrowser.mjs +22 -1
- package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
- package/dist/esm/transpiler/file/index.mjs +3 -1
- package/dist/esm/transpiler/gender/gender.mjs +24 -1
- package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
- package/dist/esm/transpiler/gender/index.mjs +3 -1
- package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs +44 -1
- package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -0
- package/dist/esm/transpiler/html/html.mjs +42 -1
- package/dist/esm/transpiler/html/html.mjs.map +1 -0
- package/dist/esm/transpiler/html/htmlTags.mjs +114 -1
- package/dist/esm/transpiler/html/htmlTags.mjs.map +1 -1
- package/dist/esm/transpiler/html/index.mjs +5 -1
- package/dist/esm/transpiler/html/validateHTML.mjs +62 -1
- package/dist/esm/transpiler/html/validateHTML.mjs.map +1 -1
- package/dist/esm/transpiler/index.mjs +15 -1
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs +9 -1
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
- package/dist/esm/transpiler/insertion/index.mjs +4 -1
- package/dist/esm/transpiler/insertion/insertion.mjs +34 -1
- package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +22 -2
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/index.mjs +5 -1
- package/dist/esm/transpiler/markdown/markdown.mjs +60 -1
- package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/validateMarkdown.mjs +73 -4
- package/dist/esm/transpiler/markdown/validateMarkdown.mjs.map +1 -1
- package/dist/esm/transpiler/nesting/index.mjs +3 -1
- package/dist/esm/transpiler/nesting/nesting.mjs +25 -1
- package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
- package/dist/esm/transpiler/translation/index.mjs +3 -1
- package/dist/esm/transpiler/translation/translation.mjs +27 -1
- package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
- package/dist/esm/utils/checkIsURLAbsolute.mjs +5 -1
- package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
- package/dist/esm/utils/getCookie.mjs +30 -1
- package/dist/esm/utils/getCookie.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +9 -1
- package/dist/esm/utils/intl.mjs +86 -1
- package/dist/esm/utils/intl.mjs.map +1 -1
- package/dist/esm/utils/isSameKeyPath.mjs +5 -1
- package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
- package/dist/esm/utils/isValidReactElement.mjs +12 -1
- package/dist/esm/utils/isValidReactElement.mjs.map +1 -1
- package/dist/esm/utils/localeStorage.mjs +135 -1
- package/dist/esm/utils/localeStorage.mjs.map +1 -1
- package/dist/esm/utils/parseYaml.mjs +320 -16
- package/dist/esm/utils/parseYaml.mjs.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +50 -2
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +42 -2
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +34 -2
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +18 -2
- package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getMaskContent.d.ts +10 -2
- package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +19 -2
- package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts +32 -2
- package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +8 -2
- package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getSplittedContent.d.ts +43 -2
- package/dist/types/deepTransformPlugins/getSplittedContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/index.d.ts +10 -10
- package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +25 -2
- package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +8 -2
- package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +9 -2
- package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +9 -2
- package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +7 -2
- package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +7 -2
- package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/getNodeType.d.ts +8 -2
- package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/index.d.ts +12 -12
- package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +7 -2
- package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +9 -2
- package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +15 -2
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +8 -2
- package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +8 -2
- package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +7 -2
- package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +1 -0
- package/dist/types/formatters/compact.d.ts +20 -2
- package/dist/types/formatters/compact.d.ts.map +1 -0
- package/dist/types/formatters/currency.d.ts +20 -2
- package/dist/types/formatters/currency.d.ts.map +1 -0
- package/dist/types/formatters/date.d.ts +20 -2
- package/dist/types/formatters/date.d.ts.map +1 -0
- package/dist/types/formatters/index.d.ts +9 -9
- package/dist/types/formatters/list.d.ts +30 -2
- package/dist/types/formatters/list.d.ts.map +1 -0
- package/dist/types/formatters/number.d.ts +18 -2
- package/dist/types/formatters/number.d.ts.map +1 -0
- package/dist/types/formatters/percentage.d.ts +18 -2
- package/dist/types/formatters/percentage.d.ts.map +1 -0
- package/dist/types/formatters/relativeTime.d.ts +21 -2
- package/dist/types/formatters/relativeTime.d.ts.map +1 -0
- package/dist/types/formatters/units.d.ts +16 -2
- package/dist/types/formatters/units.d.ts.map +1 -0
- package/dist/types/getStorageAttributes.d.ts +29 -2
- package/dist/types/getStorageAttributes.d.ts.map +1 -0
- package/dist/types/index.d.ts +88 -80
- package/dist/types/interpreter/getCondition.d.ts +22 -2
- package/dist/types/interpreter/getCondition.d.ts.map +1 -0
- package/dist/types/interpreter/getContent/deepTransform.d.ts +12 -2
- package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -0
- package/dist/types/interpreter/getContent/getContent.d.ts +16 -2
- package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -0
- package/dist/types/interpreter/getContent/index.d.ts +3 -1
- package/dist/types/interpreter/getContent/plugins.d.ts +152 -2
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -0
- package/dist/types/interpreter/getDictionary.d.ts +17 -2
- package/dist/types/interpreter/getDictionary.d.ts.map +1 -0
- package/dist/types/interpreter/getEnumeration.d.ts +58 -2
- package/dist/types/interpreter/getEnumeration.d.ts.map +1 -0
- package/dist/types/interpreter/getGender.d.ts +1 -1
- package/dist/types/interpreter/getGender.d.ts.map +1 -1
- package/dist/types/interpreter/getHTML.d.ts +32 -2
- package/dist/types/interpreter/getHTML.d.ts.map +1 -0
- package/dist/types/interpreter/getInsertion.d.ts +1 -1
- package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
- package/dist/types/interpreter/getIntlayer.d.ts +8 -2
- package/dist/types/interpreter/getIntlayer.d.ts.map +1 -0
- package/dist/types/interpreter/getNesting.d.ts +27 -2
- package/dist/types/interpreter/getNesting.d.ts.map +1 -0
- package/dist/types/interpreter/getTranslation.d.ts +30 -2
- package/dist/types/interpreter/getTranslation.d.ts.map +1 -0
- package/dist/types/interpreter/index.d.ts +11 -4
- package/dist/types/interpreter/splitAndJoinInsertion.d.ts +25 -2
- package/dist/types/interpreter/splitAndJoinInsertion.d.ts.map +1 -0
- package/dist/types/localization/getBrowserLocale.d.ts +35 -2
- package/dist/types/localization/getBrowserLocale.d.ts.map +1 -0
- package/dist/types/localization/getHTMLTextDir.d.ts +21 -2
- package/dist/types/localization/getHTMLTextDir.d.ts.map +1 -0
- package/dist/types/localization/getLocale.d.ts +11 -2
- package/dist/types/localization/getLocale.d.ts.map +1 -0
- package/dist/types/localization/getLocaleFromPath.d.ts +20 -2
- package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -0
- package/dist/types/localization/getLocaleLang.d.ts +20 -2
- package/dist/types/localization/getLocaleLang.d.ts.map +1 -0
- package/dist/types/localization/getLocaleName.d.ts +7 -2
- package/dist/types/localization/getLocaleName.d.ts.map +1 -0
- package/dist/types/localization/getLocalizedUrl.d.ts +44 -2
- package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -0
- package/dist/types/localization/getMultilingualUrls.d.ts +42 -2
- package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -0
- package/dist/types/localization/getPathWithoutLocale.d.ts +31 -2
- package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -0
- package/dist/types/localization/getPrefix.d.ts +83 -2
- package/dist/types/localization/getPrefix.d.ts.map +1 -0
- package/dist/types/localization/index.d.ts +16 -16
- package/dist/types/localization/localeDetector.d.ts +18 -2
- package/dist/types/localization/localeDetector.d.ts.map +1 -0
- package/dist/types/localization/localeMapper.d.ts +92 -2
- package/dist/types/localization/localeMapper.d.ts.map +1 -0
- package/dist/types/localization/localeResolver.d.ts +12 -2
- package/dist/types/localization/localeResolver.d.ts.map +1 -0
- package/dist/types/localization/rewriteUtils.d.ts +34 -2
- package/dist/types/localization/rewriteUtils.d.ts.map +1 -0
- package/dist/types/localization/validatePrefix.d.ts +34 -2
- package/dist/types/localization/validatePrefix.d.ts.map +1 -0
- package/dist/types/markdown/compiler.d.ts +9 -2
- package/dist/types/markdown/compiler.d.ts.map +1 -0
- package/dist/types/markdown/constants.d.ts +177 -2
- package/dist/types/markdown/constants.d.ts.map +1 -0
- package/dist/types/markdown/index.d.ts +10 -10
- package/dist/types/markdown/parser.d.ts +16 -2
- package/dist/types/markdown/parser.d.ts.map +1 -0
- package/dist/types/markdown/renderer.d.ts +22 -2
- package/dist/types/markdown/renderer.d.ts.map +1 -0
- package/dist/types/markdown/types.d.ts +333 -2
- package/dist/types/markdown/types.d.ts.map +1 -0
- package/dist/types/markdown/utils.d.ts +140 -2
- package/dist/types/markdown/utils.d.ts.map +1 -0
- package/dist/types/messageFormat/ICU.d.ts +11 -2
- package/dist/types/messageFormat/ICU.d.ts.map +1 -0
- package/dist/types/messageFormat/i18next.d.ts +9 -2
- package/dist/types/messageFormat/i18next.d.ts.map +1 -0
- package/dist/types/messageFormat/index.d.ts +3 -3
- package/dist/types/messageFormat/vue-i18n.d.ts +9 -2
- package/dist/types/messageFormat/vue-i18n.d.ts.map +1 -0
- package/dist/types/transpiler/condition/condition.d.ts +28 -2
- package/dist/types/transpiler/condition/condition.d.ts.map +1 -0
- package/dist/types/transpiler/condition/index.d.ts +1 -1
- package/dist/types/transpiler/enumeration/enumeration.d.ts +40 -2
- package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -0
- package/dist/types/transpiler/enumeration/index.d.ts +1 -1
- package/dist/types/transpiler/file/file.d.ts +28 -2
- package/dist/types/transpiler/file/file.d.ts.map +1 -0
- package/dist/types/transpiler/file/fileBrowser.d.ts +1 -1
- package/dist/types/transpiler/file/index.d.ts +1 -1
- package/dist/types/transpiler/gender/gender.d.ts +29 -2
- package/dist/types/transpiler/gender/gender.d.ts.map +1 -0
- package/dist/types/transpiler/gender/index.d.ts +1 -1
- package/dist/types/transpiler/html/html.d.ts +25 -2
- package/dist/types/transpiler/html/html.d.ts.map +1 -0
- package/dist/types/transpiler/html/htmlTags.d.ts +115 -2
- package/dist/types/transpiler/html/htmlTags.d.ts.map +1 -0
- package/dist/types/transpiler/html/index.d.ts +3 -3
- package/dist/types/transpiler/html/validateHTML.d.ts +21 -2
- package/dist/types/transpiler/html/validateHTML.d.ts.map +1 -0
- package/dist/types/transpiler/index.d.ts +15 -15
- package/dist/types/transpiler/insertion/getInsertionValues.d.ts +5 -2
- package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -0
- package/dist/types/transpiler/insertion/index.d.ts +2 -2
- package/dist/types/transpiler/insertion/insertion.d.ts +23 -2
- package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -0
- package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts +5 -2
- package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -0
- package/dist/types/transpiler/markdown/index.d.ts +4 -4
- package/dist/types/transpiler/markdown/markdown.d.ts +26 -2
- package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -0
- package/dist/types/transpiler/markdown/validateMarkdown.d.ts +18 -3
- package/dist/types/transpiler/markdown/validateMarkdown.d.ts.map +1 -0
- package/dist/types/transpiler/nesting/index.d.ts +1 -1
- package/dist/types/transpiler/nesting/nesting.d.ts +49 -2
- package/dist/types/transpiler/nesting/nesting.d.ts.map +1 -0
- package/dist/types/transpiler/translation/index.d.ts +1 -1
- package/dist/types/transpiler/translation/translation.d.ts +33 -2
- package/dist/types/transpiler/translation/translation.d.ts.map +1 -0
- package/dist/types/utils/checkIsURLAbsolute.d.ts +5 -2
- package/dist/types/utils/checkIsURLAbsolute.d.ts.map +1 -0
- package/dist/types/utils/getCookie.d.ts +11 -2
- package/dist/types/utils/getCookie.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +7 -7
- package/dist/types/utils/intl.d.ts +33 -2
- package/dist/types/utils/intl.d.ts.map +1 -0
- package/dist/types/utils/isSameKeyPath.d.ts +7 -2
- package/dist/types/utils/isSameKeyPath.d.ts.map +1 -0
- package/dist/types/utils/isValidReactElement.d.ts +12 -2
- package/dist/types/utils/isValidReactElement.d.ts.map +1 -0
- package/dist/types/utils/localeStorage.d.ts +108 -2
- package/dist/types/utils/localeStorage.d.ts.map +1 -0
- package/dist/types/utils/parseYaml.d.ts +5 -2
- package/dist/types/utils/parseYaml.d.ts.map +1 -0
- package/package.json +6 -6
- package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
- package/dist/cjs/getContent-DrqM8pqO.cjs +0 -2
- package/dist/cjs/getContent-DrqM8pqO.cjs.map +0 -1
- package/dist/cjs/html-CZ1N-VL0.cjs +0 -2
- package/dist/cjs/html-CZ1N-VL0.cjs.map +0 -1
- package/dist/esm/getContent-DKqtIZGL.mjs +0 -2
- package/dist/esm/getContent-DKqtIZGL.mjs.map +0 -1
- package/dist/esm/html-3bo80xzx.mjs +0 -2
- package/dist/esm/html-3bo80xzx.mjs.map +0 -1
- package/dist/types/ICU-tA3ZHN5U.d.ts +0 -11
- package/dist/types/ICU-tA3ZHN5U.d.ts.map +0 -1
- package/dist/types/checkIsURLAbsolute-CTf3JFU6.d.ts +0 -5
- package/dist/types/checkIsURLAbsolute-CTf3JFU6.d.ts.map +0 -1
- package/dist/types/compact-IHXcM4pT.d.ts +0 -20
- package/dist/types/compact-IHXcM4pT.d.ts.map +0 -1
- package/dist/types/compiler-DFiAsUdH.d.ts +0 -9
- package/dist/types/compiler-DFiAsUdH.d.ts.map +0 -1
- package/dist/types/condition-BDUtoh_1.d.ts +0 -28
- package/dist/types/condition-BDUtoh_1.d.ts.map +0 -1
- package/dist/types/constants-CI_D82B1.d.ts +0 -177
- package/dist/types/constants-CI_D82B1.d.ts.map +0 -1
- package/dist/types/currency-PbMCnHep.d.ts +0 -20
- package/dist/types/currency-PbMCnHep.d.ts.map +0 -1
- package/dist/types/date-C-PI8KqU.d.ts +0 -20
- package/dist/types/date-C-PI8KqU.d.ts.map +0 -1
- package/dist/types/editDictionaryByKeyPath-BYIHcsyf.d.ts +0 -8
- package/dist/types/editDictionaryByKeyPath-BYIHcsyf.d.ts.map +0 -1
- package/dist/types/enumeration-CtuvB5Zz.d.ts +0 -40
- package/dist/types/enumeration-CtuvB5Zz.d.ts.map +0 -1
- package/dist/types/file-C3q8xvQb.d.ts +0 -28
- package/dist/types/file-C3q8xvQb.d.ts.map +0 -1
- package/dist/types/gender-Dd39Ijmf.d.ts +0 -29
- package/dist/types/gender-Dd39Ijmf.d.ts.map +0 -1
- package/dist/types/getBrowserLocale-RD_Mwv1t.d.ts +0 -35
- package/dist/types/getBrowserLocale-RD_Mwv1t.d.ts.map +0 -1
- package/dist/types/getContentNodeByKeyPath-B0Tdi5mj.d.ts +0 -9
- package/dist/types/getContentNodeByKeyPath-B0Tdi5mj.d.ts.map +0 -1
- package/dist/types/getCookie-DPOvVv_h.d.ts +0 -11
- package/dist/types/getCookie-DPOvVv_h.d.ts.map +0 -1
- package/dist/types/getDefaultNode-DQNsje2D.d.ts +0 -9
- package/dist/types/getDefaultNode-DQNsje2D.d.ts.map +0 -1
- package/dist/types/getEmptyNode-DW27TTBj.d.ts +0 -7
- package/dist/types/getEmptyNode-DW27TTBj.d.ts.map +0 -1
- package/dist/types/getFilterMissingTranslationsContent-CDNQqoy1.d.ts +0 -50
- package/dist/types/getFilterMissingTranslationsContent-CDNQqoy1.d.ts.map +0 -1
- package/dist/types/getFilterTranslationsOnlyContent-D2YgBkHn.d.ts +0 -42
- package/dist/types/getFilterTranslationsOnlyContent-D2YgBkHn.d.ts.map +0 -1
- package/dist/types/getFilteredLocalesContent-D0GP-uEg.d.ts +0 -34
- package/dist/types/getFilteredLocalesContent-D0GP-uEg.d.ts.map +0 -1
- package/dist/types/getHTML-CP6OXtdo.d.ts +0 -32
- package/dist/types/getHTML-CP6OXtdo.d.ts.map +0 -1
- package/dist/types/getHTMLTextDir-4Zh8J3x7.d.ts +0 -21
- package/dist/types/getHTMLTextDir-4Zh8J3x7.d.ts.map +0 -1
- package/dist/types/getInsertionValues-Cu9IdbuE.d.ts +0 -5
- package/dist/types/getInsertionValues-Cu9IdbuE.d.ts.map +0 -1
- package/dist/types/getLocale-B9dECUM_.d.ts +0 -11
- package/dist/types/getLocale-B9dECUM_.d.ts.map +0 -1
- package/dist/types/getLocaleFromPath-621W32QA.d.ts +0 -26
- package/dist/types/getLocaleFromPath-621W32QA.d.ts.map +0 -1
- package/dist/types/getLocaleLang-Bcan1gS4.d.ts +0 -20
- package/dist/types/getLocaleLang-Bcan1gS4.d.ts.map +0 -1
- package/dist/types/getLocaleName-CfRAD9Hc.d.ts +0 -7
- package/dist/types/getLocaleName-CfRAD9Hc.d.ts.map +0 -1
- package/dist/types/getLocalizedContent-DOncZd-0.d.ts +0 -18
- package/dist/types/getLocalizedContent-DOncZd-0.d.ts.map +0 -1
- package/dist/types/getLocalizedUrl-BbqeA3-W.d.ts +0 -49
- package/dist/types/getLocalizedUrl-BbqeA3-W.d.ts.map +0 -1
- package/dist/types/getMarkdownMetadata-Bf1S1NQ0.d.ts +0 -5
- package/dist/types/getMarkdownMetadata-Bf1S1NQ0.d.ts.map +0 -1
- package/dist/types/getMaskContent-BwLFqp7v.d.ts +0 -10
- package/dist/types/getMaskContent-BwLFqp7v.d.ts.map +0 -1
- package/dist/types/getMissingLocalesContent-BYffYcdx.d.ts +0 -19
- package/dist/types/getMissingLocalesContent-BYffYcdx.d.ts.map +0 -1
- package/dist/types/getMultilingualDictionary-DO3i1MFs.d.ts +0 -32
- package/dist/types/getMultilingualDictionary-DO3i1MFs.d.ts.map +0 -1
- package/dist/types/getMultilingualUrls-CUxYYfA4.d.ts +0 -47
- package/dist/types/getMultilingualUrls-CUxYYfA4.d.ts.map +0 -1
- package/dist/types/getNodeChildren-OT7Liqke.d.ts +0 -7
- package/dist/types/getNodeChildren-OT7Liqke.d.ts.map +0 -1
- package/dist/types/getNodeType-Cp765I26.d.ts +0 -8
- package/dist/types/getNodeType-Cp765I26.d.ts.map +0 -1
- package/dist/types/getPathWithoutLocale-B_aIR7O0.d.ts +0 -31
- package/dist/types/getPathWithoutLocale-B_aIR7O0.d.ts.map +0 -1
- package/dist/types/getPrefix-X9XKkrZD.d.ts +0 -68
- package/dist/types/getPrefix-X9XKkrZD.d.ts.map +0 -1
- package/dist/types/getReplacedValuesContent-BvL25pdt.d.ts +0 -8
- package/dist/types/getReplacedValuesContent-BvL25pdt.d.ts.map +0 -1
- package/dist/types/getSplittedContent-YD4JDMfB.d.ts +0 -43
- package/dist/types/getSplittedContent-YD4JDMfB.d.ts.map +0 -1
- package/dist/types/getStorageAttributes-CIO2xWqQ.d.ts +0 -29
- package/dist/types/getStorageAttributes-CIO2xWqQ.d.ts.map +0 -1
- package/dist/types/getTranslation-BG2Wg-af.d.ts +0 -30
- package/dist/types/getTranslation-BG2Wg-af.d.ts.map +0 -1
- package/dist/types/html-Dn6KrpJ3.d.ts +0 -25
- package/dist/types/html-Dn6KrpJ3.d.ts.map +0 -1
- package/dist/types/htmlTags-YxTtVUx6.d.ts +0 -115
- package/dist/types/htmlTags-YxTtVUx6.d.ts.map +0 -1
- package/dist/types/i18next-qY0AixrB.d.ts +0 -9
- package/dist/types/i18next-qY0AixrB.d.ts.map +0 -1
- package/dist/types/index-1CTsSKEn.d.ts +0 -1
- package/dist/types/index-B8xF2zGo.d.ts +0 -1
- package/dist/types/index-BcsOTSQF.d.ts +0 -1
- package/dist/types/index-BnEeKNKW.d.ts +0 -322
- package/dist/types/index-BnEeKNKW.d.ts.map +0 -1
- package/dist/types/index-Cf8zm5QQ.d.ts +0 -1
- package/dist/types/index-CfvILin8.d.ts +0 -1
- package/dist/types/index-DK_kKFOF.d.ts +0 -1
- package/dist/types/index-DeJa0xZp.d.ts +0 -1
- package/dist/types/index-Vlqtiwjx.d.ts +0 -1
- package/dist/types/insertContentInDictionary-DZ3UzG4K.d.ts +0 -25
- package/dist/types/insertContentInDictionary-DZ3UzG4K.d.ts.map +0 -1
- package/dist/types/insertion-M5fwK-29.d.ts +0 -23
- package/dist/types/insertion-M5fwK-29.d.ts.map +0 -1
- package/dist/types/intl-B2Ap8I5x.d.ts +0 -33
- package/dist/types/intl-B2Ap8I5x.d.ts.map +0 -1
- package/dist/types/isSameKeyPath-CkH8NdJh.d.ts +0 -7
- package/dist/types/isSameKeyPath-CkH8NdJh.d.ts.map +0 -1
- package/dist/types/isValidReactElement-BsoJ01oP.d.ts +0 -12
- package/dist/types/isValidReactElement-BsoJ01oP.d.ts.map +0 -1
- package/dist/types/list-BdjJM2Gx.d.ts +0 -30
- package/dist/types/list-BdjJM2Gx.d.ts.map +0 -1
- package/dist/types/localeDetector-BWNCQRiZ.d.ts +0 -18
- package/dist/types/localeDetector-BWNCQRiZ.d.ts.map +0 -1
- package/dist/types/localeMapper-DoAnasqf.d.ts +0 -92
- package/dist/types/localeMapper-DoAnasqf.d.ts.map +0 -1
- package/dist/types/localeResolver-bb7AWQNX.d.ts +0 -12
- package/dist/types/localeResolver-bb7AWQNX.d.ts.map +0 -1
- package/dist/types/localeStorage-CZHwY0u3.d.ts +0 -108
- package/dist/types/localeStorage-CZHwY0u3.d.ts.map +0 -1
- package/dist/types/markdown-MzfikrI1.d.ts +0 -26
- package/dist/types/markdown-MzfikrI1.d.ts.map +0 -1
- package/dist/types/mergeDictionaries-D6WUMQN5.d.ts +0 -7
- package/dist/types/mergeDictionaries-D6WUMQN5.d.ts.map +0 -1
- package/dist/types/normalizeDictionary-coviIGTW.d.ts +0 -9
- package/dist/types/normalizeDictionary-coviIGTW.d.ts.map +0 -1
- package/dist/types/number-C8izkCmU.d.ts +0 -16
- package/dist/types/number-C8izkCmU.d.ts.map +0 -1
- package/dist/types/orderDictionaries-SSCMY6qG.d.ts +0 -15
- package/dist/types/orderDictionaries-SSCMY6qG.d.ts.map +0 -1
- package/dist/types/parseYaml-D5gxutvA.d.ts +0 -5
- package/dist/types/parseYaml-D5gxutvA.d.ts.map +0 -1
- package/dist/types/parser-BVwR6Tjw.d.ts +0 -16
- package/dist/types/parser-BVwR6Tjw.d.ts.map +0 -1
- package/dist/types/percentage-BqsvW0Zw.d.ts +0 -16
- package/dist/types/percentage-BqsvW0Zw.d.ts.map +0 -1
- package/dist/types/relativeTime-mJaYEq7H.d.ts +0 -11
- package/dist/types/relativeTime-mJaYEq7H.d.ts.map +0 -1
- package/dist/types/removeContentNodeByKeyPath-CotCOOsD.d.ts +0 -8
- package/dist/types/removeContentNodeByKeyPath-CotCOOsD.d.ts.map +0 -1
- package/dist/types/renameContentNodeByKeyPath-BuyH5gOr.d.ts +0 -8
- package/dist/types/renameContentNodeByKeyPath-BuyH5gOr.d.ts.map +0 -1
- package/dist/types/renderer-C06x2Orf.d.ts +0 -22
- package/dist/types/renderer-C06x2Orf.d.ts.map +0 -1
- package/dist/types/rewriteUtils-Bd82NiGR.d.ts +0 -34
- package/dist/types/rewriteUtils-Bd82NiGR.d.ts.map +0 -1
- package/dist/types/splitAndJoinInsertion-bkuLa7o2.d.ts +0 -25
- package/dist/types/splitAndJoinInsertion-bkuLa7o2.d.ts.map +0 -1
- package/dist/types/translation-CiC-Avxc.d.ts +0 -33
- package/dist/types/translation-CiC-Avxc.d.ts.map +0 -1
- package/dist/types/types-C2Om0aEM.d.ts +0 -333
- package/dist/types/types-C2Om0aEM.d.ts.map +0 -1
- package/dist/types/units-CouGqa8j.d.ts +0 -16
- package/dist/types/units-CouGqa8j.d.ts.map +0 -1
- package/dist/types/updateNodeChildren-B5Tu1UBZ.d.ts +0 -7
- package/dist/types/updateNodeChildren-B5Tu1UBZ.d.ts.map +0 -1
- package/dist/types/utils-Dcmgh_80.d.ts +0 -140
- package/dist/types/utils-Dcmgh_80.d.ts.map +0 -1
- package/dist/types/validateHTML-U7UKTtFd.d.ts +0 -21
- package/dist/types/validateHTML-U7UKTtFd.d.ts.map +0 -1
- package/dist/types/validateMarkdown-BUaTDDIu.d.ts +0 -18
- package/dist/types/validateMarkdown-BUaTDDIu.d.ts.map +0 -1
- package/dist/types/validatePrefix-Dtmg7QLq.d.ts +0 -38
- package/dist/types/validatePrefix-Dtmg7QLq.d.ts.map +0 -1
- package/dist/types/vue-i18n-JtUB7N_m.d.ts +0 -9
- package/dist/types/vue-i18n-JtUB7N_m.d.ts.map +0 -1
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
import{CachedIntl
|
|
1
|
+
import { CachedIntl } from "../utils/intl.mjs";
|
|
2
|
+
import configuration from "@intlayer/config/built";
|
|
3
|
+
|
|
4
|
+
//#region src/formatters/list.ts
|
|
5
|
+
/**
|
|
6
|
+
* Formats an array of values into a localized list string using the Intl API.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* list(['apple', 'banana', 'orange']);
|
|
10
|
+
* // "apple, banana, and orange"
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* list(['red', 'green', 'blue'], { locale: Locales.FRENCH, type: 'disjunction' });
|
|
14
|
+
* // "rouge, vert ou bleu"
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* list([1, 2, 3], { type: 'unit' });
|
|
18
|
+
* // "1, 2, 3"
|
|
19
|
+
*/
|
|
20
|
+
const list = (values, options) => new CachedIntl.ListFormat(options?.locale ?? configuration?.internationalization?.defaultLocale, {
|
|
21
|
+
type: options?.type ?? "conjunction",
|
|
22
|
+
style: options?.style ?? "long",
|
|
23
|
+
...options
|
|
24
|
+
}).format(values.map(String));
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { list };
|
|
2
28
|
//# sourceMappingURL=list.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.mjs","names":[],"sources":["../../../src/formatters/list.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/** Locally defined subset of Intl.ListFormatOptions so consumers don't need ES2021.Intl in their lib. */\ntype ListFormatOptions = {\n localeMatcher?: 'lookup' | 'best fit';\n type?: 'conjunction' | 'disjunction' | 'unit';\n style?: 'long' | 'short' | 'narrow';\n};\n\n/**\n * Formats an array of values into a localized list string using the Intl API.\n *\n * @example\n * list(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * @example\n * list(['red', 'green', 'blue'], { locale: Locales.FRENCH, type: 'disjunction' });\n * // \"rouge, vert ou bleu\"\n *\n * @example\n * list([1, 2, 3], { type: 'unit' });\n * // \"1, 2, 3\"\n */\nexport const list = (\n values: (string | number)[],\n options?: ListFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.ListFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n type: options?.type ?? 'conjunction',\n style: options?.style ?? 'long',\n ...options,\n }\n ).format(values.map(String));\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.mjs","names":[],"sources":["../../../src/formatters/list.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/** Locally defined subset of Intl.ListFormatOptions so consumers don't need ES2021.Intl in their lib. */\ntype ListFormatOptions = {\n localeMatcher?: 'lookup' | 'best fit';\n type?: 'conjunction' | 'disjunction' | 'unit';\n style?: 'long' | 'short' | 'narrow';\n};\n\n/**\n * Formats an array of values into a localized list string using the Intl API.\n *\n * @example\n * list(['apple', 'banana', 'orange']);\n * // \"apple, banana, and orange\"\n *\n * @example\n * list(['red', 'green', 'blue'], { locale: Locales.FRENCH, type: 'disjunction' });\n * // \"rouge, vert ou bleu\"\n *\n * @example\n * list([1, 2, 3], { type: 'unit' });\n * // \"1, 2, 3\"\n */\nexport const list = (\n values: (string | number)[],\n options?: ListFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.ListFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n type: options?.type ?? 'conjunction',\n style: options?.style ?? 'long',\n ...options,\n }\n ).format(values.map(String));\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0BA,MAAa,QACX,QACA,YAEA,IAAI,WAAW,WACb,SAAS,UAAU,eAAe,sBAAsB,eACxD;CACE,MAAM,SAAS,QAAQ;CACvB,OAAO,SAAS,SAAS;CACzB,GAAG;CACJ,CACF,CAAC,OAAO,OAAO,IAAI,OAAO,CAAC"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
import{CachedIntl
|
|
1
|
+
import { CachedIntl } from "../utils/intl.mjs";
|
|
2
|
+
import configuration from "@intlayer/config/built";
|
|
3
|
+
|
|
4
|
+
//#region src/formatters/number.ts
|
|
5
|
+
/**
|
|
6
|
+
* Formats a numeric value using locale-aware formatting.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* number(123456.789); // "123,456.789"
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* number("1000000", { locale: Locales.FRENCH }); // "1 000 000"
|
|
13
|
+
*/
|
|
14
|
+
const number = (value, options) => new CachedIntl.NumberFormat(options?.locale ?? configuration?.internationalization?.defaultLocale, options).format(Number(value));
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { number };
|
|
2
18
|
//# sourceMappingURL=number.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.mjs","names":[],"sources":["../../../src/formatters/number.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using locale-aware formatting.\n *\n * @example\n * number(
|
|
1
|
+
{"version":3,"file":"number.mjs","names":[],"sources":["../../../src/formatters/number.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using locale-aware formatting.\n *\n * @example\n * number(123456.789); // \"123,456.789\"\n *\n * @example\n * number(\"1000000\", { locale: Locales.FRENCH }); // \"1 000 000\"\n */\nexport const number = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n options\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,UACX,OACA,YAEA,IAAI,WAAW,aACb,SAAS,UAAU,eAAe,sBAAsB,eACxD,QACD,CAAC,OAAO,OAAO,MAAM,CAAC"}
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
import{CachedIntl
|
|
1
|
+
import { CachedIntl } from "../utils/intl.mjs";
|
|
2
|
+
import configuration from "@intlayer/config/built";
|
|
3
|
+
|
|
4
|
+
//#region src/formatters/percentage.ts
|
|
5
|
+
/**
|
|
6
|
+
* Formats a number as a percentage string (e.g., 0.25 → "25%").
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* percentage(0.25); // "25%"
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* percentage(0.25, { minimumFractionDigits: 2 }); // "25.00%"
|
|
13
|
+
*/
|
|
14
|
+
const percentage = (value, options) => {
|
|
15
|
+
let numericValue = Number(value);
|
|
16
|
+
if (numericValue > 1) numericValue /= 100;
|
|
17
|
+
return new CachedIntl.NumberFormat(options?.locale ?? configuration?.internationalization?.defaultLocale, {
|
|
18
|
+
style: "percent",
|
|
19
|
+
...options
|
|
20
|
+
}).format(Number(numericValue));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { percentage };
|
|
2
25
|
//# sourceMappingURL=percentage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentage.mjs","names":[],"sources":["../../../src/formatters/percentage.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a number as a percentage string (e.g., 0.25 → \"25%\").\n *\n * @example\n * percentage(
|
|
1
|
+
{"version":3,"file":"percentage.mjs","names":[],"sources":["../../../src/formatters/percentage.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a number as a percentage string (e.g., 0.25 → \"25%\").\n *\n * @example\n * percentage(0.25); // \"25%\"\n *\n * @example\n * percentage(0.25, { minimumFractionDigits: 2 }); // \"25.00%\"\n */\nexport const percentage = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string => {\n let numericValue = Number(value);\n\n // Normalize: if user passes 10, treat it as 10% instead of 1000%\n if (numericValue > 1) {\n numericValue /= 100;\n }\n\n const formatter = new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n style: 'percent',\n ...options,\n }\n );\n\n return formatter.format(Number(numericValue));\n};\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,cACX,OACA,YACW;CACX,IAAI,eAAe,OAAO,MAAM;AAGhC,KAAI,eAAe,EACjB,iBAAgB;AAWlB,QARkB,IAAI,WAAW,aAC/B,SAAS,UAAU,eAAe,sBAAsB,eACxD;EACE,OAAO;EACP,GAAG;EACJ,CACF,CAEgB,OAAO,OAAO,aAAa,CAAC"}
|
|
@@ -1,2 +1,41 @@
|
|
|
1
|
-
import{CachedIntl
|
|
1
|
+
import { CachedIntl } from "../utils/intl.mjs";
|
|
2
|
+
import configuration from "@intlayer/config/built";
|
|
3
|
+
|
|
4
|
+
//#region src/formatters/relativeTime.ts
|
|
5
|
+
/**
|
|
6
|
+
* Calculate the difference between 2 dates in the given unit.
|
|
7
|
+
*/
|
|
8
|
+
const diffInUnit = (from, to, unit) => {
|
|
9
|
+
const sec = (to.getTime() - from.getTime()) / 1e3;
|
|
10
|
+
switch (unit) {
|
|
11
|
+
case "second": return sec;
|
|
12
|
+
case "minute": return sec / 60;
|
|
13
|
+
case "hour": return sec / 3600;
|
|
14
|
+
case "day": return sec / 86400;
|
|
15
|
+
case "month": return sec / (30 * 86400);
|
|
16
|
+
case "quarter": return sec / (90 * 86400);
|
|
17
|
+
case "year": return sec / (365 * 86400);
|
|
18
|
+
default: return sec;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Formats the difference between two dates as a localized relative time string.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* relativeTime(new Date(Date.now() - 30000)); // "30 seconds ago"
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* relativeTime("2025-01-01", new Date(), { locale: Locales.FRENCH, unit: "day" });
|
|
29
|
+
* // "il y a 443 jours"
|
|
30
|
+
*/
|
|
31
|
+
const relativeTime = (from, to = /* @__PURE__ */ new Date(), options) => {
|
|
32
|
+
const fromDate = new Date(from);
|
|
33
|
+
const toDate = new Date(to);
|
|
34
|
+
const unit = options?.unit ?? "second";
|
|
35
|
+
const value = diffInUnit(fromDate, toDate, unit);
|
|
36
|
+
return new CachedIntl.RelativeTimeFormat(options?.locale ?? configuration?.internationalization?.defaultLocale, options).format(Math.round(value), unit);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { relativeTime };
|
|
2
41
|
//# sourceMappingURL=relativeTime.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relativeTime.mjs","names":[],"sources":["../../../src/formatters/relativeTime.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\ntype RelativeTimeUnit = Intl.RelativeTimeFormatUnit;\n\n/**\n * Calculate the difference between 2 dates in the given unit.\n */\nconst diffInUnit = (from: Date, to: Date, unit: RelativeTimeUnit): number => {\n const msDiff = to.getTime() - from.getTime();\n const sec = msDiff / 1000;\n\n switch (unit) {\n case 'second':\n return sec;\n case 'minute':\n return sec / 60;\n case 'hour':\n return sec / 3600;\n case 'day':\n return sec / 86400;\n case 'month':\n return sec / (30 * 86400); // approx\n case 'quarter':\n return sec / (3 * 30 * 86400); // 3 months approx\n case 'year':\n return sec / (365 * 86400); // approx\n default:\n return sec;\n }\n};\n\nexport const relativeTime = (\n from: Date | string | number,\n to: Date | string | number = new Date(),\n options?: Intl.RelativeTimeFormatOptions & {\n locale?: LocalesValues;\n unit?: RelativeTimeUnit;\n }\n): string => {\n const fromDate = new Date(from);\n const toDate = new Date(to);\n const unit = options?.unit ?? 'second';\n\n const value = diffInUnit(fromDate, toDate, unit);\n\n return new CachedIntl.RelativeTimeFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n options\n ).format(Math.round(value), unit);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"relativeTime.mjs","names":[],"sources":["../../../src/formatters/relativeTime.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\ntype RelativeTimeUnit = Intl.RelativeTimeFormatUnit;\n\n/**\n * Calculate the difference between 2 dates in the given unit.\n */\nconst diffInUnit = (from: Date, to: Date, unit: RelativeTimeUnit): number => {\n const msDiff = to.getTime() - from.getTime();\n const sec = msDiff / 1000;\n\n switch (unit) {\n case 'second':\n return sec;\n case 'minute':\n return sec / 60;\n case 'hour':\n return sec / 3600;\n case 'day':\n return sec / 86400;\n case 'month':\n return sec / (30 * 86400); // approx\n case 'quarter':\n return sec / (3 * 30 * 86400); // 3 months approx\n case 'year':\n return sec / (365 * 86400); // approx\n default:\n return sec;\n }\n};\n\n/**\n * Formats the difference between two dates as a localized relative time string.\n *\n * @example\n * relativeTime(new Date(Date.now() - 30000)); // \"30 seconds ago\"\n *\n * @example\n * relativeTime(\"2025-01-01\", new Date(), { locale: Locales.FRENCH, unit: \"day\" });\n * // \"il y a 443 jours\"\n */\nexport const relativeTime = (\n from: Date | string | number,\n to: Date | string | number = new Date(),\n options?: Intl.RelativeTimeFormatOptions & {\n locale?: LocalesValues;\n unit?: RelativeTimeUnit;\n }\n): string => {\n const fromDate = new Date(from);\n const toDate = new Date(to);\n const unit = options?.unit ?? 'second';\n\n const value = diffInUnit(fromDate, toDate, unit);\n\n return new CachedIntl.RelativeTimeFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n options\n ).format(Math.round(value), unit);\n};\n"],"mappings":";;;;;;;AASA,MAAM,cAAc,MAAY,IAAU,SAAmC;CAE3E,MAAM,OADS,GAAG,SAAS,GAAG,KAAK,SAAS,IACvB;AAErB,SAAQ,MAAR;EACE,KAAK,SACH,QAAO;EACT,KAAK,SACH,QAAO,MAAM;EACf,KAAK,OACH,QAAO,MAAM;EACf,KAAK,MACH,QAAO,MAAM;EACf,KAAK,QACH,QAAO,OAAO,KAAK;EACrB,KAAK,UACH,QAAO,OAAO,KAAS;EACzB,KAAK,OACH,QAAO,OAAO,MAAM;EACtB,QACE,QAAO;;;;;;;;;;;;;AAcb,MAAa,gBACX,MACA,qBAA6B,IAAI,MAAM,EACvC,YAIW;CACX,MAAM,WAAW,IAAI,KAAK,KAAK;CAC/B,MAAM,SAAS,IAAI,KAAK,GAAG;CAC3B,MAAM,OAAO,SAAS,QAAQ;CAE9B,MAAM,QAAQ,WAAW,UAAU,QAAQ,KAAK;AAEhD,QAAO,IAAI,WAAW,mBACpB,SAAS,UAAU,eAAe,sBAAsB,eACxD,QACD,CAAC,OAAO,KAAK,MAAM,MAAM,EAAE,KAAK"}
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import{CachedIntl
|
|
1
|
+
import { CachedIntl } from "../utils/intl.mjs";
|
|
2
|
+
import configuration from "@intlayer/config/built";
|
|
3
|
+
|
|
4
|
+
//#region src/formatters/units.ts
|
|
5
|
+
/**
|
|
6
|
+
* Formats a numeric value as a localized unit string.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* units(5, { unit: "kilometer", unitDisplay: "long", locale: "en-GB" });
|
|
10
|
+
* // "5 kilometers"
|
|
11
|
+
*/
|
|
12
|
+
const units = (value, options) => new CachedIntl.NumberFormat(options?.locale ?? configuration?.internationalization?.defaultLocale, {
|
|
13
|
+
style: "unit",
|
|
14
|
+
unit: options?.unit ?? "day",
|
|
15
|
+
unitDisplay: options?.unitDisplay ?? "short",
|
|
16
|
+
useGrouping: options?.useGrouping ?? false
|
|
17
|
+
}).format(Number(value));
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { units };
|
|
2
21
|
//# sourceMappingURL=units.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"units.mjs","names":[],"sources":["../../../src/formatters/units.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value as a localized unit string.\n *\n * @example\n * units(
|
|
1
|
+
{"version":3,"file":"units.mjs","names":[],"sources":["../../../src/formatters/units.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value as a localized unit string.\n *\n * @example\n * units(5, { unit: \"kilometer\", unitDisplay: \"long\", locale: \"en-GB\" });\n * // \"5 kilometers\"\n */\nexport const units = (\n value: number | string,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n style: 'unit',\n unit: options?.unit ?? 'day',\n unitDisplay: options?.unitDisplay ?? 'short',\n useGrouping: options?.useGrouping ?? false,\n }\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,SACX,OACA,YAEA,IAAI,WAAW,aACb,SAAS,UAAU,eAAe,sBAAsB,eACxD;CACE,OAAO;CACP,MAAM,SAAS,QAAQ;CACvB,aAAa,SAAS,eAAe;CACrC,aAAa,SAAS,eAAe;CACtC,CACF,CAAC,OAAO,OAAO,MAAM,CAAC"}
|
|
@@ -1,2 +1,133 @@
|
|
|
1
|
-
import{COOKIE_NAME
|
|
1
|
+
import { COOKIE_NAME, HEADER_NAME, LOCALE_STORAGE_NAME } from "@intlayer/config/defaultValues";
|
|
2
|
+
|
|
3
|
+
//#region src/getStorageAttributes.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a cookie entry with default values for missing attributes
|
|
6
|
+
*/
|
|
7
|
+
const createCookieEntry = (options) => {
|
|
8
|
+
const { name, path, expires, domain, secure, sameSite, httpOnly } = options ?? {};
|
|
9
|
+
return {
|
|
10
|
+
name: name ?? COOKIE_NAME,
|
|
11
|
+
attributes: {
|
|
12
|
+
path,
|
|
13
|
+
expires,
|
|
14
|
+
domain,
|
|
15
|
+
secure,
|
|
16
|
+
sameSite,
|
|
17
|
+
httpOnly
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Creates a web storage entry (localStorage or sessionStorage) with default name
|
|
23
|
+
*/
|
|
24
|
+
const createWebStorageEntry = (options) => {
|
|
25
|
+
const { name } = options ?? {};
|
|
26
|
+
return { name: name ?? LOCALE_STORAGE_NAME };
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Creates a header entry with default name
|
|
30
|
+
*/
|
|
31
|
+
const createHeaderEntry = (options) => {
|
|
32
|
+
const { name } = options ?? {};
|
|
33
|
+
return { name: name ?? HEADER_NAME };
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Determines if a storage entry is a cookie based on its properties
|
|
37
|
+
*/
|
|
38
|
+
const isCookieEntry = (entry) => {
|
|
39
|
+
return entry.type === "cookie" || "sameSite" in entry || "httpOnly" in entry || "secure" in entry;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Determines the storage type from a string literal
|
|
43
|
+
*/
|
|
44
|
+
const isStorageType = (value) => {
|
|
45
|
+
return value === "cookie" || value === "localStorage" || value === "sessionStorage" || value === "header";
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Processes a single storage entry and returns the appropriate storage attributes
|
|
49
|
+
*/
|
|
50
|
+
const processStorageEntry = (entry) => {
|
|
51
|
+
if (typeof entry === "string") {
|
|
52
|
+
if (!isStorageType(entry)) return {
|
|
53
|
+
cookies: [],
|
|
54
|
+
localStorage: [],
|
|
55
|
+
sessionStorage: [],
|
|
56
|
+
headers: []
|
|
57
|
+
};
|
|
58
|
+
if (entry === "cookie") return { cookies: [createCookieEntry()] };
|
|
59
|
+
if (entry === "localStorage") return { localStorage: [createWebStorageEntry()] };
|
|
60
|
+
if (entry === "sessionStorage") return { sessionStorage: [createWebStorageEntry()] };
|
|
61
|
+
if (entry === "header") return { headers: [createHeaderEntry()] };
|
|
62
|
+
}
|
|
63
|
+
if (typeof entry === "object" && entry !== null) {
|
|
64
|
+
const typedEntry = entry;
|
|
65
|
+
if (isCookieEntry(typedEntry)) return { cookies: [createCookieEntry(typedEntry)] };
|
|
66
|
+
if ("type" in typedEntry && typedEntry.type === "localStorage") {
|
|
67
|
+
const { name, ...rest } = typedEntry;
|
|
68
|
+
return { localStorage: [createWebStorageEntry({
|
|
69
|
+
name,
|
|
70
|
+
...rest
|
|
71
|
+
})] };
|
|
72
|
+
}
|
|
73
|
+
if ("type" in typedEntry && typedEntry.type === "sessionStorage") {
|
|
74
|
+
const { name, ...rest } = typedEntry;
|
|
75
|
+
return { sessionStorage: [createWebStorageEntry({
|
|
76
|
+
name,
|
|
77
|
+
...rest
|
|
78
|
+
})] };
|
|
79
|
+
}
|
|
80
|
+
if ("type" in typedEntry && typedEntry.type === "header") {
|
|
81
|
+
const { name, ...rest } = typedEntry;
|
|
82
|
+
return { headers: [createHeaderEntry({
|
|
83
|
+
name,
|
|
84
|
+
...rest
|
|
85
|
+
})] };
|
|
86
|
+
}
|
|
87
|
+
const { name, ...rest } = typedEntry;
|
|
88
|
+
return { localStorage: [createWebStorageEntry({
|
|
89
|
+
name,
|
|
90
|
+
...rest
|
|
91
|
+
})] };
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
cookies: [],
|
|
95
|
+
localStorage: [],
|
|
96
|
+
sessionStorage: [],
|
|
97
|
+
headers: []
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Merges multiple partial storage attributes into a single result
|
|
102
|
+
*/
|
|
103
|
+
const mergeStorageAttributes = (accumulated, partial) => {
|
|
104
|
+
return {
|
|
105
|
+
cookies: [...accumulated.cookies, ...partial.cookies ?? []],
|
|
106
|
+
localStorage: [...accumulated.localStorage, ...partial.localStorage ?? []],
|
|
107
|
+
sessionStorage: [...accumulated.sessionStorage, ...partial.sessionStorage ?? []],
|
|
108
|
+
headers: [...accumulated.headers, ...partial.headers ?? []]
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Extracts and normalizes storage configuration into separate arrays for each storage type
|
|
113
|
+
*
|
|
114
|
+
* @param options - The storage configuration from IntlayerConfig
|
|
115
|
+
* @returns An object containing arrays for cookies, localStorage, and sessionStorage
|
|
116
|
+
*/
|
|
117
|
+
const getStorageAttributes = (options) => {
|
|
118
|
+
const emptyResult = {
|
|
119
|
+
cookies: [],
|
|
120
|
+
localStorage: [],
|
|
121
|
+
sessionStorage: [],
|
|
122
|
+
headers: []
|
|
123
|
+
};
|
|
124
|
+
if (options === false || options === void 0) return emptyResult;
|
|
125
|
+
if (Array.isArray(options)) return options.reduce((acc, entry) => {
|
|
126
|
+
return mergeStorageAttributes(acc, processStorageEntry(entry));
|
|
127
|
+
}, emptyResult);
|
|
128
|
+
return mergeStorageAttributes(emptyResult, processStorageEntry(options));
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
export { getStorageAttributes };
|
|
2
133
|
//# sourceMappingURL=getStorageAttributes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStorageAttributes.mjs","names":[],"sources":["../../src/getStorageAttributes.ts"],"sourcesContent":["import {\n COOKIE_NAME,\n HEADER_NAME,\n LOCALE_STORAGE_NAME,\n} from '@intlayer/config/defaultValues';\nimport type {\n CookiesAttributes,\n IntlayerConfig,\n StorageAttributes,\n} from '@intlayer/types/config';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ntype CookieEntry = {\n name: string;\n attributes: Omit<CookiesAttributes, 'type' | 'name'>;\n};\n\ntype WebStorageEntry = {\n name: string;\n};\n\ntype HeaderEntry = {\n name: string;\n};\n\nexport type ProcessedStorageAttributes = {\n cookies: CookieEntry[];\n localStorage: WebStorageEntry[];\n sessionStorage: WebStorageEntry[];\n headers: HeaderEntry[];\n};\n\ntype StorageEntry =\n | 'cookie'\n | 'localStorage'\n | 'sessionStorage'\n | 'header'\n | CookiesAttributes\n | StorageAttributes;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Creates a cookie entry with default values for missing attributes\n */\nconst createCookieEntry = (\n options?: Partial<CookiesAttributes>\n): CookieEntry => {\n const { name, path, expires, domain, secure, sameSite, httpOnly } =\n options ?? {};\n\n return {\n name: name ?? COOKIE_NAME,\n attributes: {\n path,\n expires,\n domain,\n secure,\n sameSite,\n httpOnly,\n },\n };\n};\n\n/**\n * Creates a web storage entry (localStorage or sessionStorage) with default name\n */\nconst createWebStorageEntry = (\n options?: Partial<StorageAttributes>\n): WebStorageEntry => {\n const { name } = options ?? {};\n\n return {\n name: name ?? LOCALE_STORAGE_NAME,\n };\n};\n\n/**\n * Creates a header entry with default name\n */\nconst createHeaderEntry = (\n options?: Partial<StorageAttributes>\n): HeaderEntry => {\n const { name } = options ?? {};\n\n return {\n name: name ?? HEADER_NAME,\n };\n};\n\n/**\n * Determines if a storage entry is a cookie based on its properties\n */\nconst isCookieEntry = (entry: any): boolean => {\n return (\n entry.type === 'cookie' ||\n 'sameSite' in entry ||\n 'httpOnly' in entry ||\n 'secure' in entry\n );\n};\n\n/**\n * Determines the storage type from a string literal\n */\nconst isStorageType = (\n value: string\n): value is 'cookie' | 'localStorage' | 'sessionStorage' | 'header' => {\n return (\n value === 'cookie' ||\n value === 'localStorage' ||\n value === 'sessionStorage' ||\n value === 'header'\n );\n};\n\n// ============================================================================\n// Main Function\n// ============================================================================\n\n/**\n * Processes a single storage entry and returns the appropriate storage attributes\n */\nconst processStorageEntry = (\n entry: StorageEntry\n): Partial<ProcessedStorageAttributes> => {\n // Handle string literals\n if (typeof entry === 'string') {\n if (!isStorageType(entry)) {\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n }\n\n if (entry === 'cookie') {\n return { cookies: [createCookieEntry()] };\n }\n\n if (entry === 'localStorage') {\n return { localStorage: [createWebStorageEntry()] };\n }\n\n if (entry === 'sessionStorage') {\n return { sessionStorage: [createWebStorageEntry()] };\n }\n\n if (entry === 'header') {\n return { headers: [createHeaderEntry()] };\n }\n }\n\n // Handle object entries\n if (typeof entry === 'object' && entry !== null) {\n const typedEntry = entry as CookiesAttributes | StorageAttributes;\n\n if (isCookieEntry(typedEntry)) {\n return { cookies: [createCookieEntry(typedEntry as CookiesAttributes)] };\n }\n\n // Handle localStorage\n if ('type' in typedEntry && typedEntry.type === 'localStorage') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { localStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n // Handle sessionStorage\n if ('type' in typedEntry && typedEntry.type === 'sessionStorage') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { sessionStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n // Handle header\n if ('type' in typedEntry && typedEntry.type === 'header') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { headers: [createHeaderEntry({ name, ...rest })] };\n }\n\n // Default to localStorage for ambiguous objects\n const { name, ...rest } = typedEntry as Omit<StorageAttributes, 'type'>;\n return { localStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n};\n\n/**\n * Merges multiple partial storage attributes into a single result\n */\nconst mergeStorageAttributes = (\n accumulated: ProcessedStorageAttributes,\n partial: Partial<ProcessedStorageAttributes>\n): ProcessedStorageAttributes => {\n return {\n cookies: [...accumulated.cookies, ...(partial.cookies ?? [])],\n localStorage: [\n ...accumulated.localStorage,\n ...(partial.localStorage ?? []),\n ],\n sessionStorage: [\n ...accumulated.sessionStorage,\n ...(partial.sessionStorage ?? []),\n ],\n headers: [...accumulated.headers, ...(partial.headers ?? [])],\n };\n};\n\n/**\n * Extracts and normalizes storage configuration into separate arrays for each storage type\n *\n * @param options - The storage configuration from IntlayerConfig\n * @returns An object containing arrays for cookies, localStorage, and sessionStorage\n */\nexport const getStorageAttributes = (\n options: IntlayerConfig['routing']['storage']\n): ProcessedStorageAttributes => {\n const emptyResult: ProcessedStorageAttributes = {\n cookies: [],\n localStorage: [],\n sessionStorage: [],\n headers: [],\n };\n\n // Storage is disabled\n if (options === false || options === undefined) {\n return emptyResult;\n }\n\n // Handle array of storage entries\n if (Array.isArray(options)) {\n return options.reduce<ProcessedStorageAttributes>((acc, entry) => {\n const partial = processStorageEntry(entry);\n return mergeStorageAttributes(acc, partial);\n }, emptyResult);\n }\n\n // Handle single storage entry\n const partial = processStorageEntry(options);\n\n return mergeStorageAttributes(emptyResult, partial);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getStorageAttributes.mjs","names":[],"sources":["../../src/getStorageAttributes.ts"],"sourcesContent":["import {\n COOKIE_NAME,\n HEADER_NAME,\n LOCALE_STORAGE_NAME,\n} from '@intlayer/config/defaultValues';\nimport type {\n CookiesAttributes,\n IntlayerConfig,\n StorageAttributes,\n} from '@intlayer/types/config';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ntype CookieEntry = {\n name: string;\n attributes: Omit<CookiesAttributes, 'type' | 'name'>;\n};\n\ntype WebStorageEntry = {\n name: string;\n};\n\ntype HeaderEntry = {\n name: string;\n};\n\nexport type ProcessedStorageAttributes = {\n cookies: CookieEntry[];\n localStorage: WebStorageEntry[];\n sessionStorage: WebStorageEntry[];\n headers: HeaderEntry[];\n};\n\ntype StorageEntry =\n | 'cookie'\n | 'localStorage'\n | 'sessionStorage'\n | 'header'\n | CookiesAttributes\n | StorageAttributes;\n\n// ============================================================================\n// Helper Functions\n// ============================================================================\n\n/**\n * Creates a cookie entry with default values for missing attributes\n */\nconst createCookieEntry = (\n options?: Partial<CookiesAttributes>\n): CookieEntry => {\n const { name, path, expires, domain, secure, sameSite, httpOnly } =\n options ?? {};\n\n return {\n name: name ?? COOKIE_NAME,\n attributes: {\n path,\n expires,\n domain,\n secure,\n sameSite,\n httpOnly,\n },\n };\n};\n\n/**\n * Creates a web storage entry (localStorage or sessionStorage) with default name\n */\nconst createWebStorageEntry = (\n options?: Partial<StorageAttributes>\n): WebStorageEntry => {\n const { name } = options ?? {};\n\n return {\n name: name ?? LOCALE_STORAGE_NAME,\n };\n};\n\n/**\n * Creates a header entry with default name\n */\nconst createHeaderEntry = (\n options?: Partial<StorageAttributes>\n): HeaderEntry => {\n const { name } = options ?? {};\n\n return {\n name: name ?? HEADER_NAME,\n };\n};\n\n/**\n * Determines if a storage entry is a cookie based on its properties\n */\nconst isCookieEntry = (entry: any): boolean => {\n return (\n entry.type === 'cookie' ||\n 'sameSite' in entry ||\n 'httpOnly' in entry ||\n 'secure' in entry\n );\n};\n\n/**\n * Determines the storage type from a string literal\n */\nconst isStorageType = (\n value: string\n): value is 'cookie' | 'localStorage' | 'sessionStorage' | 'header' => {\n return (\n value === 'cookie' ||\n value === 'localStorage' ||\n value === 'sessionStorage' ||\n value === 'header'\n );\n};\n\n// ============================================================================\n// Main Function\n// ============================================================================\n\n/**\n * Processes a single storage entry and returns the appropriate storage attributes\n */\nconst processStorageEntry = (\n entry: StorageEntry\n): Partial<ProcessedStorageAttributes> => {\n // Handle string literals\n if (typeof entry === 'string') {\n if (!isStorageType(entry)) {\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n }\n\n if (entry === 'cookie') {\n return { cookies: [createCookieEntry()] };\n }\n\n if (entry === 'localStorage') {\n return { localStorage: [createWebStorageEntry()] };\n }\n\n if (entry === 'sessionStorage') {\n return { sessionStorage: [createWebStorageEntry()] };\n }\n\n if (entry === 'header') {\n return { headers: [createHeaderEntry()] };\n }\n }\n\n // Handle object entries\n if (typeof entry === 'object' && entry !== null) {\n const typedEntry = entry as CookiesAttributes | StorageAttributes;\n\n if (isCookieEntry(typedEntry)) {\n return { cookies: [createCookieEntry(typedEntry as CookiesAttributes)] };\n }\n\n // Handle localStorage\n if ('type' in typedEntry && typedEntry.type === 'localStorage') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { localStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n // Handle sessionStorage\n if ('type' in typedEntry && typedEntry.type === 'sessionStorage') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { sessionStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n // Handle header\n if ('type' in typedEntry && typedEntry.type === 'header') {\n const { name, ...rest } = typedEntry as StorageAttributes;\n return { headers: [createHeaderEntry({ name, ...rest })] };\n }\n\n // Default to localStorage for ambiguous objects\n const { name, ...rest } = typedEntry as Omit<StorageAttributes, 'type'>;\n return { localStorage: [createWebStorageEntry({ name, ...rest })] };\n }\n\n return { cookies: [], localStorage: [], sessionStorage: [], headers: [] };\n};\n\n/**\n * Merges multiple partial storage attributes into a single result\n */\nconst mergeStorageAttributes = (\n accumulated: ProcessedStorageAttributes,\n partial: Partial<ProcessedStorageAttributes>\n): ProcessedStorageAttributes => {\n return {\n cookies: [...accumulated.cookies, ...(partial.cookies ?? [])],\n localStorage: [\n ...accumulated.localStorage,\n ...(partial.localStorage ?? []),\n ],\n sessionStorage: [\n ...accumulated.sessionStorage,\n ...(partial.sessionStorage ?? []),\n ],\n headers: [...accumulated.headers, ...(partial.headers ?? [])],\n };\n};\n\n/**\n * Extracts and normalizes storage configuration into separate arrays for each storage type\n *\n * @param options - The storage configuration from IntlayerConfig\n * @returns An object containing arrays for cookies, localStorage, and sessionStorage\n */\nexport const getStorageAttributes = (\n options: IntlayerConfig['routing']['storage']\n): ProcessedStorageAttributes => {\n const emptyResult: ProcessedStorageAttributes = {\n cookies: [],\n localStorage: [],\n sessionStorage: [],\n headers: [],\n };\n\n // Storage is disabled\n if (options === false || options === undefined) {\n return emptyResult;\n }\n\n // Handle array of storage entries\n if (Array.isArray(options)) {\n return options.reduce<ProcessedStorageAttributes>((acc, entry) => {\n const partial = processStorageEntry(entry);\n return mergeStorageAttributes(acc, partial);\n }, emptyResult);\n }\n\n // Handle single storage entry\n const partial = processStorageEntry(options);\n\n return mergeStorageAttributes(emptyResult, partial);\n};\n"],"mappings":";;;;;;AAkDA,MAAM,qBACJ,YACgB;CAChB,MAAM,EAAE,MAAM,MAAM,SAAS,QAAQ,QAAQ,UAAU,aACrD,WAAW,EAAE;AAEf,QAAO;EACL,MAAM,QAAQ;EACd,YAAY;GACV;GACA;GACA;GACA;GACA;GACA;GACD;EACF;;;;;AAMH,MAAM,yBACJ,YACoB;CACpB,MAAM,EAAE,SAAS,WAAW,EAAE;AAE9B,QAAO,EACL,MAAM,QAAQ,qBACf;;;;;AAMH,MAAM,qBACJ,YACgB;CAChB,MAAM,EAAE,SAAS,WAAW,EAAE;AAE9B,QAAO,EACL,MAAM,QAAQ,aACf;;;;;AAMH,MAAM,iBAAiB,UAAwB;AAC7C,QACE,MAAM,SAAS,YACf,cAAc,SACd,cAAc,SACd,YAAY;;;;;AAOhB,MAAM,iBACJ,UACqE;AACrE,QACE,UAAU,YACV,UAAU,kBACV,UAAU,oBACV,UAAU;;;;;AAWd,MAAM,uBACJ,UACwC;AAExC,KAAI,OAAO,UAAU,UAAU;AAC7B,MAAI,CAAC,cAAc,MAAM,CACvB,QAAO;GAAE,SAAS,EAAE;GAAE,cAAc,EAAE;GAAE,gBAAgB,EAAE;GAAE,SAAS,EAAE;GAAE;AAG3E,MAAI,UAAU,SACZ,QAAO,EAAE,SAAS,CAAC,mBAAmB,CAAC,EAAE;AAG3C,MAAI,UAAU,eACZ,QAAO,EAAE,cAAc,CAAC,uBAAuB,CAAC,EAAE;AAGpD,MAAI,UAAU,iBACZ,QAAO,EAAE,gBAAgB,CAAC,uBAAuB,CAAC,EAAE;AAGtD,MAAI,UAAU,SACZ,QAAO,EAAE,SAAS,CAAC,mBAAmB,CAAC,EAAE;;AAK7C,KAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EAC/C,MAAM,aAAa;AAEnB,MAAI,cAAc,WAAW,CAC3B,QAAO,EAAE,SAAS,CAAC,kBAAkB,WAAgC,CAAC,EAAE;AAI1E,MAAI,UAAU,cAAc,WAAW,SAAS,gBAAgB;GAC9D,MAAM,EAAE,MAAM,GAAG,SAAS;AAC1B,UAAO,EAAE,cAAc,CAAC,sBAAsB;IAAE;IAAM,GAAG;IAAM,CAAC,CAAC,EAAE;;AAIrE,MAAI,UAAU,cAAc,WAAW,SAAS,kBAAkB;GAChE,MAAM,EAAE,MAAM,GAAG,SAAS;AAC1B,UAAO,EAAE,gBAAgB,CAAC,sBAAsB;IAAE;IAAM,GAAG;IAAM,CAAC,CAAC,EAAE;;AAIvE,MAAI,UAAU,cAAc,WAAW,SAAS,UAAU;GACxD,MAAM,EAAE,MAAM,GAAG,SAAS;AAC1B,UAAO,EAAE,SAAS,CAAC,kBAAkB;IAAE;IAAM,GAAG;IAAM,CAAC,CAAC,EAAE;;EAI5D,MAAM,EAAE,MAAM,GAAG,SAAS;AAC1B,SAAO,EAAE,cAAc,CAAC,sBAAsB;GAAE;GAAM,GAAG;GAAM,CAAC,CAAC,EAAE;;AAGrE,QAAO;EAAE,SAAS,EAAE;EAAE,cAAc,EAAE;EAAE,gBAAgB,EAAE;EAAE,SAAS,EAAE;EAAE;;;;;AAM3E,MAAM,0BACJ,aACA,YAC+B;AAC/B,QAAO;EACL,SAAS,CAAC,GAAG,YAAY,SAAS,GAAI,QAAQ,WAAW,EAAE,CAAE;EAC7D,cAAc,CACZ,GAAG,YAAY,cACf,GAAI,QAAQ,gBAAgB,EAAE,CAC/B;EACD,gBAAgB,CACd,GAAG,YAAY,gBACf,GAAI,QAAQ,kBAAkB,EAAE,CACjC;EACD,SAAS,CAAC,GAAG,YAAY,SAAS,GAAI,QAAQ,WAAW,EAAE,CAAE;EAC9D;;;;;;;;AASH,MAAa,wBACX,YAC+B;CAC/B,MAAM,cAA0C;EAC9C,SAAS,EAAE;EACX,cAAc,EAAE;EAChB,gBAAgB,EAAE;EAClB,SAAS,EAAE;EACZ;AAGD,KAAI,YAAY,SAAS,YAAY,OACnC,QAAO;AAIT,KAAI,MAAM,QAAQ,QAAQ,CACxB,QAAO,QAAQ,QAAoC,KAAK,UAAU;AAEhE,SAAO,uBAAuB,KADd,oBAAoB,MAAM,CACC;IAC1C,YAAY;AAMjB,QAAO,uBAAuB,aAFd,oBAAoB,QAAQ,CAEO"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1 +1,87 @@
|
|
|
1
|
-
import{getStorageAttributes as ee}from"./getStorageAttributes.mjs";import{getCondition as te}from"./interpreter/getCondition.mjs";import{deepTransformNode as ne}from"./interpreter/getContent/deepTransform.mjs";import{findMatchingCondition as e,getEnumeration as t}from"./interpreter/getEnumeration.mjs";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,r as u,s as d,t as f,u as p}from"./getContent-DKqtIZGL.mjs";import{getTranslation as m}from"./interpreter/getTranslation.mjs";import{getHTML as h}from"./interpreter/getHTML.mjs";import{splitInsertionTemplate as g}from"./interpreter/splitAndJoinInsertion.mjs";import{getFilteredLocalesContent as _,getFilteredLocalesDictionary as v}from"./deepTransformPlugins/getFilteredLocalesContent.mjs";import{cond as y}from"./transpiler/condition/condition.mjs";import{enu as b}from"./transpiler/enumeration/enumeration.mjs";import{gender as x}from"./transpiler/gender/gender.mjs";import{t as S}from"./html-3bo80xzx.mjs";import{VOID_ELEMENTS as C,validateHTML as w}from"./transpiler/html/validateHTML.mjs";import{HTML_TAGS as T}from"./transpiler/html/htmlTags.mjs";import{getInsertionValues as E}from"./transpiler/insertion/getInsertionValues.mjs";import{insert as D}from"./transpiler/insertion/insertion.mjs";import{parseYaml as O}from"./utils/parseYaml.mjs";import{getMarkdownMetadata as k}from"./transpiler/markdown/getMarkdownMetadata.mjs";import{validateMarkdown as A}from"./transpiler/markdown/validateMarkdown.mjs";import{md as j}from"./transpiler/markdown/markdown.mjs";import{nest as M}from"./transpiler/nesting/nesting.mjs";import{t as N}from"./transpiler/translation/translation.mjs";import{filterMissingTranslationsOnlyPlugin as P,getFilterMissingTranslationsContent as F,getFilterMissingTranslationsDictionary as I}from"./deepTransformPlugins/getFilterMissingTranslationsContent.mjs";import{filterTranslationsOnlyPlugin as L,getFilterTranslationsOnlyContent as R,getFilterTranslationsOnlyDictionary as z}from"./deepTransformPlugins/getFilterTranslationsOnlyContent.mjs";import{getLocalizedContent as B,getPerLocaleDictionary as V}from"./deepTransformPlugins/getLocalizedContent.mjs";import{buildMaskPlugin as H,getMaskContent as U}from"./deepTransformPlugins/getMaskContent.mjs";import{checkMissingLocalesPlugin as W,getMissingLocalesContent as G,getMissingLocalesContentFromDictionary as K}from"./deepTransformPlugins/getMissingLocalesContent.mjs";import{getMultilingualDictionary as q}from"./deepTransformPlugins/getMultilingualDictionary.mjs";import{getReplacedValuesContent as J}from"./deepTransformPlugins/getReplacedValuesContent.mjs";import{getSplittedContent as Y,getSplittedDictionaryContent as X}from"./deepTransformPlugins/getSplittedContent.mjs";import{insertContentInDictionary as Z}from"./deepTransformPlugins/insertContentInDictionary.mjs";import{editDictionaryByKeyPath as re}from"./dictionaryManipulator/editDictionaryByKeyPath.mjs";import{getContentNodeByKeyPath as ie}from"./dictionaryManipulator/getContentNodeByKeyPath.mjs";import{getDefaultNode as ae}from"./dictionaryManipulator/getDefaultNode.mjs";import{getEmptyNode as oe}from"./dictionaryManipulator/getEmptyNode.mjs";import{getNodeChildren as se}from"./dictionaryManipulator/getNodeChildren.mjs";import{isValidElement as ce}from"./utils/isValidReactElement.mjs";import{getNodeType as le}from"./dictionaryManipulator/getNodeType.mjs";import{mergeDictionaries as ue}from"./dictionaryManipulator/mergeDictionaries.mjs";import{orderDictionaries as de}from"./dictionaryManipulator/orderDictionaries.mjs";import{normalizeDictionaries as fe,normalizeDictionary as pe}from"./dictionaryManipulator/normalizeDictionary.mjs";import{removeContentNodeByKeyPath as me}from"./dictionaryManipulator/removeContentNodeByKeyPath.mjs";import{renameContentNodeByKeyPath as he}from"./dictionaryManipulator/renameContentNodeByKeyPath.mjs";import{updateNodeChildren as ge}from"./dictionaryManipulator/updateNodeChildren.mjs";import"./dictionaryManipulator/index.mjs";import{CachedIntl as Q,bindIntl as _e,createCachedIntl as ve}from"./utils/intl.mjs";import{compact as ye}from"./formatters/compact.mjs";import{currency as be}from"./formatters/currency.mjs";import{date as xe}from"./formatters/date.mjs";import{list as Se}from"./formatters/list.mjs";import{number as Ce}from"./formatters/number.mjs";import{percentage as we}from"./formatters/percentage.mjs";import{relativeTime as Te}from"./formatters/relativeTime.mjs";import{units as Ee}from"./formatters/units.mjs";import"./formatters/index.mjs";import{getCookie as De}from"./utils/getCookie.mjs";import{LocaleStorage as Oe,getLocaleFromStorage as ke,setLocaleInStorage as Ae}from"./utils/localeStorage.mjs";import{localeResolver as je}from"./localization/localeResolver.mjs";import{localeDetector as Me}from"./localization/localeDetector.mjs";import{getBrowserLocale as Ne,localeStorageOptions as Pe}from"./localization/getBrowserLocale.mjs";import{getHTMLTextDir as Fe}from"./localization/getHTMLTextDir.mjs";import{getLocale as Ie}from"./localization/getLocale.mjs";import{checkIsURLAbsolute as Le}from"./utils/checkIsURLAbsolute.mjs";import{getLocaleFromPath as Re}from"./localization/getLocaleFromPath.mjs";import{getLocaleLang as ze}from"./localization/getLocaleLang.mjs";import{getLocaleName as Be}from"./localization/getLocaleName.mjs";import{getPathWithoutLocale as Ve}from"./localization/getPathWithoutLocale.mjs";import{getPrefix as He}from"./localization/getPrefix.mjs";import{getCanonicalPath as Ue,getInternalPath as We,getLocalizedPath as Ge,getRewritePath as Ke,getRewriteRules as qe}from"./localization/rewriteUtils.mjs";import{getLocalizedUrl as Je}from"./localization/getLocalizedUrl.mjs";import{getMultilingualUrls as Ye}from"./localization/getMultilingualUrls.mjs";import{localeFlatMap as Xe,localeMap as Ze,localeRecord as Qe}from"./localization/localeMapper.mjs";import{validatePrefix as $e}from"./localization/validatePrefix.mjs";import"./localization/index.mjs";import{ATTRIBUTES_TO_SANITIZE as et,ATTRIBUTE_TO_NODE_PROP_MAP as tt,ATTR_EXTRACTOR_R as nt,BLOCKQUOTE_ALERT_R as rt,BLOCKQUOTE_R as it,BLOCKQUOTE_TRIM_LEFT_MULTILINE_R as at,BLOCK_END_R as ot,BREAK_LINE_R as st,BREAK_THEMATIC_R as ct,CAPTURE_LETTER_AFTER_HYPHEN as lt,CODE_BLOCK_FENCED_R as ut,CODE_BLOCK_R as dt,CODE_INLINE_R as ft,CONSECUTIVE_NEWLINE_R as pt,CR_NEWLINE_R as mt,CUSTOM_COMPONENT_R as ht,DO_NOT_PROCESS_HTML_ELEMENTS as gt,DURATION_DELAY_TRIGGER as $,FOOTNOTE_R as _t,FOOTNOTE_REFERENCE_R as vt,FORMFEED_R as yt,FRONT_MATTER_R as bt,GFM_TASK_R as xt,HEADING_ATX_COMPLIANT_R as St,HEADING_R as Ct,HEADING_SETEXT_R as wt,HTML_BLOCK_ELEMENT_R as Tt,HTML_CHAR_CODE_R as Et,HTML_COMMENT_R as Dt,HTML_CUSTOM_ATTR_R as Ot,HTML_LEFT_TRIM_AMOUNT_R as kt,HTML_SELF_CLOSING_ELEMENT_R as At,INLINE_SKIP_R as jt,INTERPOLATION_R as Mt,LINK_AUTOLINK_BARE_URL_R as Nt,LINK_AUTOLINK_R as Pt,LIST_LOOKBEHIND_R as Ft,LOOKAHEAD as It,NAMED_CODES_TO_UNICODE as Lt,NP_TABLE_R as Rt,ORDERED as zt,ORDERED_LIST_BULLET as Bt,ORDERED_LIST_ITEM_PREFIX as Vt,ORDERED_LIST_ITEM_PREFIX_R as Ht,ORDERED_LIST_ITEM_R as Ut,ORDERED_LIST_R as Wt,PARAGRAPH_R as Gt,Priority as Kt,REFERENCE_IMAGE_OR_LINK as qt,REFERENCE_IMAGE_R as Jt,REFERENCE_LINK_R as Yt,RuleType as Xt,SHORTCODE_R as Zt,SHOULD_RENDER_AS_BLOCK_R as Qt,TABLE_CENTER_ALIGN as $t,TABLE_LEFT_ALIGN as en,TABLE_RIGHT_ALIGN as tn,TABLE_TRIM_PIPES as nn,TAB_R as rn,TEXT_BOLD_R as an,TEXT_EMPHASIZED_R as on,TEXT_ESCAPED_R as sn,TEXT_MARKED_R as cn,TEXT_PLAIN_R as ln,TEXT_STRIKETHROUGHED_R as un,TRIM_STARTING_NEWLINES as dn,UNESCAPE_R as fn,UNORDERED as pn,UNORDERED_LIST_BULLET as mn,UNORDERED_LIST_ITEM_PREFIX as hn,UNORDERED_LIST_ITEM_PREFIX_R as gn,UNORDERED_LIST_ITEM_R as _n,UNORDERED_LIST_R as vn,generateListItemPrefix as yn,generateListItemPrefixRegex as bn,generateListItemRegex as xn,generateListRegex as Sn}from"./markdown/constants.mjs";import{allowInline as Cn,anyScopeRegex as wn,attributeValueToNodePropValue as Tn,blockRegex as En,captureNothing as Dn,cx as On,get as kn,inlineRegex as An,normalizeAttributeKey as jn,normalizeWhitespace as Mn,parseBlock as Nn,parseCaptureInline as Pn,parseInline as Fn,parseSimpleInline as In,parseStyleAttribute as Ln,parseTableAlign as Rn,parseTableAlignCapture as zn,parseTableCells as Bn,parseTableRow as Vn,qualifies as Hn,renderNothing as Un,sanitizer as Wn,simpleInlineRegex as Gn,slugify as Kn,some as qn,startsWith as Jn,trimEnd as Yn,trimLeadingWhitespaceOutsideFences as Xn,unescapeString as Zn,unquote as Qn}from"./markdown/utils.mjs";import{parserFor as $n}from"./markdown/parser.mjs";import{createRenderer as er,renderFor as tr}from"./markdown/renderer.mjs";import{compile as nr,compileWithOptions as rr,createCompiler as ir}from"./markdown/compiler.mjs";import"./markdown/index.mjs";import{icuToIntlayerFormatter as ar,intlayerToICUFormatter as or}from"./messageFormat/ICU.mjs";import{i18nextToIntlayerFormatter as sr,intlayerToI18nextFormatter as cr}from"./messageFormat/i18next.mjs";import{intlayerToVueI18nFormatter as lr,vueI18nToIntlayerFormatter as ur}from"./messageFormat/vue-i18n.mjs";import"./messageFormat/index.mjs";import{isSameKeyPath as dr}from"./utils/isSameKeyPath.mjs";import"./utils/index.mjs";export{et as ATTRIBUTES_TO_SANITIZE,tt as ATTRIBUTE_TO_NODE_PROP_MAP,nt as ATTR_EXTRACTOR_R,rt as BLOCKQUOTE_ALERT_R,it as BLOCKQUOTE_R,at as BLOCKQUOTE_TRIM_LEFT_MULTILINE_R,ot as BLOCK_END_R,st as BREAK_LINE_R,ct as BREAK_THEMATIC_R,lt as CAPTURE_LETTER_AFTER_HYPHEN,ut as CODE_BLOCK_FENCED_R,dt as CODE_BLOCK_R,ft as CODE_INLINE_R,pt as CONSECUTIVE_NEWLINE_R,mt as CR_NEWLINE_R,ht as CUSTOM_COMPONENT_R,Q as CachedIntl,Q as Intl,gt as DO_NOT_PROCESS_HTML_ELEMENTS,$ as DURATION_DELAY_TRIGGER,_t as FOOTNOTE_R,vt as FOOTNOTE_REFERENCE_R,yt as FORMFEED_R,bt as FRONT_MATTER_R,xt as GFM_TASK_R,St as HEADING_ATX_COMPLIANT_R,Ct as HEADING_R,wt as HEADING_SETEXT_R,Tt as HTML_BLOCK_ELEMENT_R,Et as HTML_CHAR_CODE_R,Dt as HTML_COMMENT_R,Ot as HTML_CUSTOM_ATTR_R,kt as HTML_LEFT_TRIM_AMOUNT_R,At as HTML_SELF_CLOSING_ELEMENT_R,T as HTML_TAGS,jt as INLINE_SKIP_R,Mt as INTERPOLATION_R,Nt as LINK_AUTOLINK_BARE_URL_R,Pt as LINK_AUTOLINK_R,Ft as LIST_LOOKBEHIND_R,It as LOOKAHEAD,Oe as LocaleStorage,Lt as NAMED_CODES_TO_UNICODE,Rt as NP_TABLE_R,zt as ORDERED,Bt as ORDERED_LIST_BULLET,Vt as ORDERED_LIST_ITEM_PREFIX,Ht as ORDERED_LIST_ITEM_PREFIX_R,Ut as ORDERED_LIST_ITEM_R,Wt as ORDERED_LIST_R,Gt as PARAGRAPH_R,Kt as Priority,qt as REFERENCE_IMAGE_OR_LINK,Jt as REFERENCE_IMAGE_R,Yt as REFERENCE_LINK_R,Xt as RuleType,Zt as SHORTCODE_R,Qt as SHOULD_RENDER_AS_BLOCK_R,$t as TABLE_CENTER_ALIGN,en as TABLE_LEFT_ALIGN,tn as TABLE_RIGHT_ALIGN,nn as TABLE_TRIM_PIPES,rn as TAB_R,an as TEXT_BOLD_R,on as TEXT_EMPHASIZED_R,sn as TEXT_ESCAPED_R,cn as TEXT_MARKED_R,ln as TEXT_PLAIN_R,un as TEXT_STRIKETHROUGHED_R,dn as TRIM_STARTING_NEWLINES,fn as UNESCAPE_R,pn as UNORDERED,mn as UNORDERED_LIST_BULLET,hn as UNORDERED_LIST_ITEM_PREFIX,gn as UNORDERED_LIST_ITEM_PREFIX_R,_n as UNORDERED_LIST_ITEM_R,vn as UNORDERED_LIST_R,C as VOID_ELEMENTS,Cn as allowInline,wn as anyScopeRegex,Tn as attributeValueToNodePropValue,_e as bindIntl,En as blockRegex,H as buildMaskPlugin,Dn as captureNothing,Le as checkIsURLAbsolute,W as checkMissingLocalesPlugin,ye as compact,nr as compile,rr as compileWithOptions,y as cond,u as conditionPlugin,ve as createCachedIntl,ir as createCompiler,er as createRenderer,be as currency,On as cx,xe as date,ne as deepTransformNode,re as editDictionaryByKeyPath,b as enu,o as enumerationPlugin,n as filePlugin,P as filterMissingTranslationsOnlyPlugin,L as filterTranslationsOnlyPlugin,e as findMatchingCondition,x as gender,l as genderPlugin,yn as generateListItemPrefix,bn as generateListItemPrefixRegex,xn as generateListItemRegex,Sn as generateListRegex,kn as get,f as getBasePlugins,Ne as getBrowserLocale,Ue as getCanonicalPath,te as getCondition,c as getContent,ie as getContentNodeByKeyPath,De as getCookie,ae as getDefaultNode,a as getDictionary,oe as getEmptyNode,t as getEnumeration,F as getFilterMissingTranslationsContent,I as getFilterMissingTranslationsDictionary,R as getFilterTranslationsOnlyContent,z as getFilterTranslationsOnlyDictionary,_ as getFilteredLocalesContent,v as getFilteredLocalesDictionary,h as getHTML,Fe as getHTMLTextDir,E as getInsertionValues,We as getInternalPath,i as getIntlayer,Ie as getLocale,Re as getLocaleFromPath,ke as getLocaleFromStorage,ze as getLocaleLang,Be as getLocaleName,B as getLocalizedContent,Ge as getLocalizedPath,Je as getLocalizedUrl,k as getMarkdownMetadata,U as getMaskContent,G as getMissingLocalesContent,K as getMissingLocalesContentFromDictionary,q as getMultilingualDictionary,Ye as getMultilingualUrls,p as getNesting,se as getNodeChildren,le as getNodeType,Ve as getPathWithoutLocale,V as getPerLocaleDictionary,He as getPrefix,J as getReplacedValuesContent,Ke as getRewritePath,qe as getRewriteRules,Y as getSplittedContent,X as getSplittedDictionaryContent,ee as getStorageAttributes,m as getTranslation,S as html,sr as i18nextToIntlayerFormatter,ar as icuToIntlayerFormatter,An as inlineRegex,D as insert,Z as insertContentInDictionary,d as insertionPlugin,cr as intlayerToI18nextFormatter,or as intlayerToICUFormatter,lr as intlayerToVueI18nFormatter,dr as isSameKeyPath,ce as isValidElement,Se as list,Me as localeDetector,Xe as localeFlatMap,Ze as localeMap,Qe as localeRecord,je as localeResolver,Pe as localeStorageOptions,j as md,ue as mergeDictionaries,M as nest,r as nestedPlugin,jn as normalizeAttributeKey,fe as normalizeDictionaries,pe as normalizeDictionary,Mn as normalizeWhitespace,Ce as number,de as orderDictionaries,Nn as parseBlock,Pn as parseCaptureInline,Fn as parseInline,In as parseSimpleInline,Ln as parseStyleAttribute,Rn as parseTableAlign,zn as parseTableAlignCapture,Bn as parseTableCells,Vn as parseTableRow,O as parseYaml,$n as parserFor,we as percentage,Hn as qualifies,Te as relativeTime,me as removeContentNodeByKeyPath,he as renameContentNodeByKeyPath,tr as renderFor,Un as renderNothing,Wn as sanitizer,Ae as setLocaleInStorage,Gn as simpleInlineRegex,Kn as slugify,qn as some,g as splitInsertionTemplate,Jn as startsWith,N as t,s as translationPlugin,Yn as trimEnd,Xn as trimLeadingWhitespaceOutsideFences,Zn as unescapeString,Ee as units,Qn as unquote,ge as updateNodeChildren,w as validateHTML,A as validateMarkdown,$e as validatePrefix,ur as vueI18nToIntlayerFormatter};
|
|
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 { getBasePlugins, getContent } from "./interpreter/getContent/getContent.mjs";
|
|
11
|
+
import { getHTML } from "./interpreter/getHTML.mjs";
|
|
12
|
+
import { splitInsertionTemplate } from "./interpreter/splitAndJoinInsertion.mjs";
|
|
13
|
+
import { getFilteredLocalesContent, getFilteredLocalesDictionary } from "./deepTransformPlugins/getFilteredLocalesContent.mjs";
|
|
14
|
+
import { cond as condition } from "./transpiler/condition/condition.mjs";
|
|
15
|
+
import { enu as enumeration } from "./transpiler/enumeration/enumeration.mjs";
|
|
16
|
+
import { gender } from "./transpiler/gender/gender.mjs";
|
|
17
|
+
import { VOID_ELEMENTS, validateHTML } from "./transpiler/html/validateHTML.mjs";
|
|
18
|
+
import { html } from "./transpiler/html/html.mjs";
|
|
19
|
+
import { HTML_TAGS } from "./transpiler/html/htmlTags.mjs";
|
|
20
|
+
import { getInsertionValues } from "./transpiler/insertion/getInsertionValues.mjs";
|
|
21
|
+
import { insert as insertion } from "./transpiler/insertion/insertion.mjs";
|
|
22
|
+
import { parseYaml } from "./utils/parseYaml.mjs";
|
|
23
|
+
import { getMarkdownMetadata } from "./transpiler/markdown/getMarkdownMetadata.mjs";
|
|
24
|
+
import { validateMarkdown } from "./transpiler/markdown/validateMarkdown.mjs";
|
|
25
|
+
import { md as markdown } from "./transpiler/markdown/markdown.mjs";
|
|
26
|
+
import { nest as nesting } from "./transpiler/nesting/nesting.mjs";
|
|
27
|
+
import { t as translation } from "./transpiler/translation/translation.mjs";
|
|
28
|
+
import { filterMissingTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary } from "./deepTransformPlugins/getFilterMissingTranslationsContent.mjs";
|
|
29
|
+
import { filterTranslationsOnlyPlugin, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary } from "./deepTransformPlugins/getFilterTranslationsOnlyContent.mjs";
|
|
30
|
+
import { getLocalizedContent, getPerLocaleDictionary } from "./deepTransformPlugins/getLocalizedContent.mjs";
|
|
31
|
+
import { buildMaskPlugin, getMaskContent } from "./deepTransformPlugins/getMaskContent.mjs";
|
|
32
|
+
import { checkMissingLocalesPlugin, getMissingLocalesContent, getMissingLocalesContentFromDictionary } from "./deepTransformPlugins/getMissingLocalesContent.mjs";
|
|
33
|
+
import { getMultilingualDictionary } from "./deepTransformPlugins/getMultilingualDictionary.mjs";
|
|
34
|
+
import { getReplacedValuesContent } from "./deepTransformPlugins/getReplacedValuesContent.mjs";
|
|
35
|
+
import { getSplittedContent, getSplittedDictionaryContent } from "./deepTransformPlugins/getSplittedContent.mjs";
|
|
36
|
+
import { insertContentInDictionary } from "./deepTransformPlugins/insertContentInDictionary.mjs";
|
|
37
|
+
import { editDictionaryByKeyPath } from "./dictionaryManipulator/editDictionaryByKeyPath.mjs";
|
|
38
|
+
import { getContentNodeByKeyPath } from "./dictionaryManipulator/getContentNodeByKeyPath.mjs";
|
|
39
|
+
import { getDefaultNode } from "./dictionaryManipulator/getDefaultNode.mjs";
|
|
40
|
+
import { getEmptyNode } from "./dictionaryManipulator/getEmptyNode.mjs";
|
|
41
|
+
import { getNodeChildren } from "./dictionaryManipulator/getNodeChildren.mjs";
|
|
42
|
+
import { isValidElement } from "./utils/isValidReactElement.mjs";
|
|
43
|
+
import { getNodeType } from "./dictionaryManipulator/getNodeType.mjs";
|
|
44
|
+
import { mergeDictionaries } from "./dictionaryManipulator/mergeDictionaries.mjs";
|
|
45
|
+
import { orderDictionaries } from "./dictionaryManipulator/orderDictionaries.mjs";
|
|
46
|
+
import { normalizeDictionaries, normalizeDictionary } from "./dictionaryManipulator/normalizeDictionary.mjs";
|
|
47
|
+
import { removeContentNodeByKeyPath } from "./dictionaryManipulator/removeContentNodeByKeyPath.mjs";
|
|
48
|
+
import { renameContentNodeByKeyPath } from "./dictionaryManipulator/renameContentNodeByKeyPath.mjs";
|
|
49
|
+
import { updateNodeChildren } from "./dictionaryManipulator/updateNodeChildren.mjs";
|
|
50
|
+
import { CachedIntl, bindIntl, createCachedIntl } from "./utils/intl.mjs";
|
|
51
|
+
import { compact } from "./formatters/compact.mjs";
|
|
52
|
+
import { currency } from "./formatters/currency.mjs";
|
|
53
|
+
import { date } from "./formatters/date.mjs";
|
|
54
|
+
import { list } from "./formatters/list.mjs";
|
|
55
|
+
import { number } from "./formatters/number.mjs";
|
|
56
|
+
import { percentage } from "./formatters/percentage.mjs";
|
|
57
|
+
import { relativeTime } from "./formatters/relativeTime.mjs";
|
|
58
|
+
import { units } from "./formatters/units.mjs";
|
|
59
|
+
import { getCookie } from "./utils/getCookie.mjs";
|
|
60
|
+
import { LocaleStorage, getLocaleFromStorage, setLocaleInStorage } from "./utils/localeStorage.mjs";
|
|
61
|
+
import { localeResolver } from "./localization/localeResolver.mjs";
|
|
62
|
+
import { localeDetector } from "./localization/localeDetector.mjs";
|
|
63
|
+
import { getBrowserLocale, localeStorageOptions } from "./localization/getBrowserLocale.mjs";
|
|
64
|
+
import { getHTMLTextDir } from "./localization/getHTMLTextDir.mjs";
|
|
65
|
+
import { getLocale } from "./localization/getLocale.mjs";
|
|
66
|
+
import { checkIsURLAbsolute } from "./utils/checkIsURLAbsolute.mjs";
|
|
67
|
+
import { getPrefix } from "./localization/getPrefix.mjs";
|
|
68
|
+
import { getLocaleFromPath } from "./localization/getLocaleFromPath.mjs";
|
|
69
|
+
import { getLocaleLang } from "./localization/getLocaleLang.mjs";
|
|
70
|
+
import { getLocaleName } from "./localization/getLocaleName.mjs";
|
|
71
|
+
import { getPathWithoutLocale } from "./localization/getPathWithoutLocale.mjs";
|
|
72
|
+
import { getCanonicalPath, getInternalPath, getLocalizedPath, getRewritePath, getRewriteRules } from "./localization/rewriteUtils.mjs";
|
|
73
|
+
import { getLocalizedUrl } from "./localization/getLocalizedUrl.mjs";
|
|
74
|
+
import { getMultilingualUrls } from "./localization/getMultilingualUrls.mjs";
|
|
75
|
+
import { localeFlatMap, localeMap, localeRecord } from "./localization/localeMapper.mjs";
|
|
76
|
+
import { validatePrefix } from "./localization/validatePrefix.mjs";
|
|
77
|
+
import { ATTRIBUTES_TO_SANITIZE, ATTRIBUTE_TO_NODE_PROP_MAP, ATTR_EXTRACTOR_R, BLOCKQUOTE_ALERT_R, BLOCKQUOTE_R, BLOCKQUOTE_TRIM_LEFT_MULTILINE_R, BLOCK_END_R, BREAK_LINE_R, BREAK_THEMATIC_R, CAPTURE_LETTER_AFTER_HYPHEN, CODE_BLOCK_FENCED_R, CODE_BLOCK_R, CODE_INLINE_R, CONSECUTIVE_NEWLINE_R, CR_NEWLINE_R, CUSTOM_COMPONENT_R, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, GFM_TASK_R, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, HTML_BLOCK_ELEMENT_R, HTML_CHAR_CODE_R, HTML_COMMENT_R, HTML_CUSTOM_ATTR_R, HTML_LEFT_TRIM_AMOUNT_R, HTML_SELF_CLOSING_ELEMENT_R, INLINE_SKIP_R, INTERPOLATION_R, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, NAMED_CODES_TO_UNICODE, NP_TABLE_R, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, PARAGRAPH_R, Priority, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, RuleType, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, TABLE_CENTER_ALIGN, TABLE_LEFT_ALIGN, TABLE_RIGHT_ALIGN, TABLE_TRIM_PIPES, TAB_R, TEXT_BOLD_R, TEXT_EMPHASIZED_R, TEXT_ESCAPED_R, TEXT_MARKED_R, TEXT_PLAIN_R, TEXT_STRIKETHROUGHED_R, TRIM_STARTING_NEWLINES, UNESCAPE_R, UNORDERED, UNORDERED_LIST_BULLET, UNORDERED_LIST_ITEM_PREFIX, UNORDERED_LIST_ITEM_PREFIX_R, UNORDERED_LIST_ITEM_R, UNORDERED_LIST_R, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex } from "./markdown/constants.mjs";
|
|
78
|
+
import { allowInline, anyScopeRegex, attributeValueToNodePropValue, blockRegex, captureNothing, cx, get, inlineRegex, normalizeAttributeKey, normalizeWhitespace, parseBlock, parseCaptureInline, parseInline, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, qualifies, renderNothing, sanitizer, simpleInlineRegex, slugify, some, startsWith, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, unquote } from "./markdown/utils.mjs";
|
|
79
|
+
import { parserFor } from "./markdown/parser.mjs";
|
|
80
|
+
import { createRenderer, renderFor } from "./markdown/renderer.mjs";
|
|
81
|
+
import { compile, compileWithOptions, createCompiler } from "./markdown/compiler.mjs";
|
|
82
|
+
import { icuToIntlayerFormatter, intlayerToICUFormatter } from "./messageFormat/ICU.mjs";
|
|
83
|
+
import { i18nextToIntlayerFormatter, intlayerToI18nextFormatter } from "./messageFormat/i18next.mjs";
|
|
84
|
+
import { intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter } from "./messageFormat/vue-i18n.mjs";
|
|
85
|
+
import { isSameKeyPath } from "./utils/isSameKeyPath.mjs";
|
|
86
|
+
|
|
87
|
+
export { ATTRIBUTES_TO_SANITIZE, ATTRIBUTE_TO_NODE_PROP_MAP, ATTR_EXTRACTOR_R, BLOCKQUOTE_ALERT_R, BLOCKQUOTE_R, BLOCKQUOTE_TRIM_LEFT_MULTILINE_R, BLOCK_END_R, BREAK_LINE_R, BREAK_THEMATIC_R, CAPTURE_LETTER_AFTER_HYPHEN, CODE_BLOCK_FENCED_R, CODE_BLOCK_R, CODE_INLINE_R, CONSECUTIVE_NEWLINE_R, CR_NEWLINE_R, CUSTOM_COMPONENT_R, CachedIntl, CachedIntl as Intl, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, GFM_TASK_R, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, HTML_BLOCK_ELEMENT_R, HTML_CHAR_CODE_R, HTML_COMMENT_R, HTML_CUSTOM_ATTR_R, HTML_LEFT_TRIM_AMOUNT_R, HTML_SELF_CLOSING_ELEMENT_R, HTML_TAGS, INLINE_SKIP_R, INTERPOLATION_R, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, LocaleStorage, NAMED_CODES_TO_UNICODE, NP_TABLE_R, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, PARAGRAPH_R, Priority, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, RuleType, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, TABLE_CENTER_ALIGN, TABLE_LEFT_ALIGN, TABLE_RIGHT_ALIGN, TABLE_TRIM_PIPES, TAB_R, TEXT_BOLD_R, TEXT_EMPHASIZED_R, TEXT_ESCAPED_R, TEXT_MARKED_R, TEXT_PLAIN_R, TEXT_STRIKETHROUGHED_R, TRIM_STARTING_NEWLINES, UNESCAPE_R, UNORDERED, UNORDERED_LIST_BULLET, UNORDERED_LIST_ITEM_PREFIX, UNORDERED_LIST_ITEM_PREFIX_R, UNORDERED_LIST_ITEM_R, UNORDERED_LIST_R, VOID_ELEMENTS, allowInline, anyScopeRegex, attributeValueToNodePropValue, bindIntl, blockRegex, buildMaskPlugin, captureNothing, checkIsURLAbsolute, checkMissingLocalesPlugin, compact, compile, compileWithOptions, condition as cond, conditionPlugin, createCachedIntl, createCompiler, createRenderer, currency, cx, date, deepTransformNode, editDictionaryByKeyPath, enumeration as enu, enumerationPlugin, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, get, getBasePlugins, getBrowserLocale, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary, getEmptyNode, getEnumeration, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getHTML, getHTMLTextDir, getInsertionValues, getInternalPath, getIntlayer, getLocale, getLocaleFromPath, getLocaleFromStorage, getLocaleLang, getLocaleName, getLocalizedContent, getLocalizedPath, getLocalizedUrl, getMarkdownMetadata, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getMultilingualUrls, getNesting, getNodeChildren, getNodeType, getPathWithoutLocale, getPerLocaleDictionary, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSplittedContent, getSplittedDictionaryContent, getStorageAttributes, getTranslation, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToVueI18nFormatter, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, nesting as nest, nestedPlugin, normalizeAttributeKey, normalizeDictionaries, normalizeDictionary, normalizeWhitespace, number, orderDictionaries, parseBlock, parseCaptureInline, parseInline, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseYaml, parserFor, percentage, qualifies, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderNothing, sanitizer, setLocaleInStorage, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, translation as t, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/interpreter/getCondition.ts
|
|
2
|
+
/**
|
|
3
|
+
* Picks content based on a boolean condition.
|
|
4
|
+
*
|
|
5
|
+
* @param conditionContent - A map with 'true', 'false', and optionally 'fallback' keys.
|
|
6
|
+
* @param state - The boolean state to match.
|
|
7
|
+
* @returns The matching content.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const content = getCondition({
|
|
12
|
+
* 'true': 'The condition is validated',
|
|
13
|
+
* 'false': 'The condition is not validated',
|
|
14
|
+
* }, true);
|
|
15
|
+
* // 'The condition is validated'
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
const getCondition = (conditionContent, state) => {
|
|
19
|
+
const stateList = Object.keys(conditionContent);
|
|
20
|
+
const fallbackState = stateList[stateList.length - 1];
|
|
21
|
+
return conditionContent[`${state}`] ?? conditionContent.fallback ?? conditionContent[fallbackState];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { getCondition };
|
|
2
26
|
//# sourceMappingURL=getCondition.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCondition.mjs","names":[],"sources":["../../../src/interpreter/getCondition.ts"],"sourcesContent":["import type { ConditionContentStates } from '../transpiler';\n\n/**\n * Picks content based on a boolean condition.\n *\n * @param conditionContent - A map with 'true', 'false', and optionally 'fallback' keys.\n * @param state - The boolean state to match.\n * @returns The matching content.\n *\n * @example\n * ```ts\n * const content = getCondition({\n * 'true': 'The condition is validated',\n * 'false': 'The condition is not validated',\n * }, true);\n * // 'The condition is validated'\n * ```\n */\nexport const getCondition = <Content>(\n conditionContent: ConditionContentStates<Content>,\n state?: boolean\n): Content => {\n const stateList = Object.keys(conditionContent);\n const fallbackState = stateList[\n stateList.length - 1\n ] as keyof typeof conditionContent;\n\n // Default or error handling if no keys match\n return (\n conditionContent[`${state}` as keyof typeof conditionContent] ??\n conditionContent.fallback ??\n (conditionContent[fallbackState] as Content)\n );\n};\n"],"mappings":"AAkBA,MAAa,
|
|
1
|
+
{"version":3,"file":"getCondition.mjs","names":[],"sources":["../../../src/interpreter/getCondition.ts"],"sourcesContent":["import type { ConditionContentStates } from '../transpiler';\n\n/**\n * Picks content based on a boolean condition.\n *\n * @param conditionContent - A map with 'true', 'false', and optionally 'fallback' keys.\n * @param state - The boolean state to match.\n * @returns The matching content.\n *\n * @example\n * ```ts\n * const content = getCondition({\n * 'true': 'The condition is validated',\n * 'false': 'The condition is not validated',\n * }, true);\n * // 'The condition is validated'\n * ```\n */\nexport const getCondition = <Content>(\n conditionContent: ConditionContentStates<Content>,\n state?: boolean\n): Content => {\n const stateList = Object.keys(conditionContent);\n const fallbackState = stateList[\n stateList.length - 1\n ] as keyof typeof conditionContent;\n\n // Default or error handling if no keys match\n return (\n conditionContent[`${state}` as keyof typeof conditionContent] ??\n conditionContent.fallback ??\n (conditionContent[fallbackState] as Content)\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAa,gBACX,kBACA,UACY;CACZ,MAAM,YAAY,OAAO,KAAK,iBAAiB;CAC/C,MAAM,gBAAgB,UACpB,UAAU,SAAS;AAIrB,QACE,iBAAiB,GAAG,YACpB,iBAAiB,YAChB,iBAAiB"}
|
|
@@ -1,2 +1,40 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
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
|
+
*/
|
|
9
|
+
const deepTransformNode = (node, props) => {
|
|
10
|
+
for (const plugin of props.plugins ?? []) if (plugin.canHandle(node)) return plugin.transform(node, props, (node, props) => deepTransformNode(node, props));
|
|
11
|
+
if (node === null || typeof node !== "object") return node;
|
|
12
|
+
if (node.$$typeof !== void 0 || node.__v_isVNode !== void 0 || node._isVNode !== void 0 || node.isJSX !== void 0 || typeof node === "function") return node;
|
|
13
|
+
if (Array.isArray(node)) return node.map((child, index) => {
|
|
14
|
+
return deepTransformNode(child, {
|
|
15
|
+
...props,
|
|
16
|
+
children: child,
|
|
17
|
+
keyPath: [...props.keyPath, {
|
|
18
|
+
type: NodeTypes.ARRAY,
|
|
19
|
+
key: index
|
|
20
|
+
}]
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
const result = {};
|
|
24
|
+
for (const key in node) {
|
|
25
|
+
const childProps = {
|
|
26
|
+
...props,
|
|
27
|
+
children: node[key],
|
|
28
|
+
keyPath: [...props.keyPath, {
|
|
29
|
+
type: NodeTypes.OBJECT,
|
|
30
|
+
key
|
|
31
|
+
}]
|
|
32
|
+
};
|
|
33
|
+
result[key] = deepTransformNode(node[key], childProps);
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { deepTransformNode };
|
|
2
40
|
//# sourceMappingURL=deepTransform.mjs.map
|