@intlayer/core 8.4.3 → 8.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateMarkdown.cjs","names":["validateHTML"],"sources":["../../../../src/transpiler/markdown/validateMarkdown.ts"],"sourcesContent":["import { type HTMLValidationIssue, validateHTML } from '../html/validateHTML';\n\nexport type { HTMLValidationIssue as MarkdownValidationIssue } from '../html/validateHTML';\n\nexport type MarkdownValidationResult = {\n valid: boolean;\n issues: HTMLValidationIssue[];\n};\n\n/**\n * Strips fenced code blocks and inline code from markdown content so that\n * HTML-like syntax inside code is not mistakenly validated.\n */\nconst stripCode = (content: string): string => {\n const lines = content.split('\\n');\n const result: string[] = [];\n let inCodeBlock = false;\n let openFence: string | null = null;\n\n for (const line of lines) {\n // Allow leading whitespace and blockquote markers before the fence characters\n const fence = line.match(/^[\\s>]*(`{3,}|~{3,})/);\n if (!inCodeBlock) {\n if (fence) {\n inCodeBlock = true;\n openFence = fence[1];\n result.push('');\n } else {\n // Also strip inline code spans on this line\n result.push(line.replace(/`[^`\\n]+`/g, (m) => ' '.repeat(m.length)));\n }\n } else {\n if (\n fence &&\n fence[1][0] === openFence![0] &&\n fence[1].length >= openFence!.length\n ) {\n inCodeBlock = false;\n openFence = null;\n }\n result.push('');\n }\n }\n\n return result.join('\\n');\n};\n\nconst validateCodeBlocks = (content: string): HTMLValidationIssue[] => {\n const issues: HTMLValidationIssue[] = [];\n const lines = content.split('\\n');\n let inCodeBlock = false;\n let openFence: string | null = null;\n let openLineNumber = -1;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n // Allow leading whitespace and blockquote markers before the fence characters\n const fence = line.match(/^[\\s>]*(`{3,}|~{3,})/);\n\n if (!inCodeBlock) {\n if (fence) {\n inCodeBlock = true;\n openFence = fence[1];\n openLineNumber = i + 1;\n }\n } else {\n if (\n fence &&\n fence[1][0] === openFence![0] &&\n fence[1].length >= openFence!.length\n ) {\n inCodeBlock = false;\n openFence = null;\n }\n }\n }\n\n if (inCodeBlock) {\n issues.push({\n type: 'error',\n message: `Unclosed code block (opened at line ${openLineNumber})`,\n });\n }\n\n return issues;\n};\n\n/**\n * Validates markdown content for structural correctness:\n * - All fenced code blocks are properly closed\n * - HTML tags are properly nested and closed\n *\n * HTML inside code blocks is excluded from HTML validation.\n */\nexport const validateMarkdown = (content: string): MarkdownValidationResult => {\n const codeIssues = validateCodeBlocks(content);\n const htmlIssues = validateHTML(stripCode(content)).issues;\n const issues = [...codeIssues, ...htmlIssues];\n\n return {\n valid: issues.filter((i) => i.type === 'error').length === 0,\n issues,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"validateMarkdown.cjs","names":["validateHTML"],"sources":["../../../../src/transpiler/markdown/validateMarkdown.ts"],"sourcesContent":["import { type HTMLValidationIssue, validateHTML } from '../html/validateHTML';\n\nexport type { HTMLValidationIssue as MarkdownValidationIssue } from '../html/validateHTML';\n\nexport type MarkdownValidationResult = {\n valid: boolean;\n issues: HTMLValidationIssue[];\n};\n\n/**\n * Strips fenced code blocks and inline code from markdown content so that\n * HTML-like syntax inside code is not mistakenly validated.\n */\nconst stripCode = (content: string): string => {\n const lines = content.split('\\n');\n const result: string[] = [];\n let inCodeBlock = false;\n let openFence: string | null = null;\n\n for (const line of lines) {\n // Allow leading whitespace and blockquote markers before the fence characters\n const fence = line.match(/^[\\s>]*(`{3,}|~{3,})/);\n if (!inCodeBlock) {\n if (fence) {\n inCodeBlock = true;\n openFence = fence[1];\n result.push('');\n } else {\n // Also strip inline code spans on this line\n result.push(line.replace(/`[^`\\n]+`/g, (m) => ' '.repeat(m.length)));\n }\n } else {\n if (\n fence &&\n fence[1][0] === openFence![0] &&\n fence[1].length >= openFence!.length\n ) {\n inCodeBlock = false;\n openFence = null;\n }\n result.push('');\n }\n }\n\n return result.join('\\n');\n};\n\nconst validateCodeBlocks = (content: string): HTMLValidationIssue[] => {\n const issues: HTMLValidationIssue[] = [];\n const lines = content.split('\\n');\n let inCodeBlock = false;\n let openFence: string | null = null;\n let openLineNumber = -1;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n // Allow leading whitespace and blockquote markers before the fence characters\n const fence = line.match(/^[\\s>]*(`{3,}|~{3,})/);\n\n if (!inCodeBlock) {\n if (fence) {\n inCodeBlock = true;\n openFence = fence[1];\n openLineNumber = i + 1;\n }\n } else {\n if (\n fence &&\n fence[1][0] === openFence![0] &&\n fence[1].length >= openFence!.length\n ) {\n inCodeBlock = false;\n openFence = null;\n }\n }\n }\n\n if (inCodeBlock) {\n issues.push({\n type: 'error',\n message: `Unclosed code block (opened at line ${openLineNumber})`,\n });\n }\n\n return issues;\n};\n\n/**\n * Validates markdown content for structural correctness:\n * - All fenced code blocks are properly closed\n * - HTML tags are properly nested and closed\n *\n * HTML inside code blocks is excluded from HTML validation.\n */\nexport const validateMarkdown = (content: string): MarkdownValidationResult => {\n const codeIssues = validateCodeBlocks(content);\n const htmlIssues = validateHTML(stripCode(content)).issues;\n const issues = [...codeIssues, ...htmlIssues];\n\n return {\n valid: issues.filter((i) => i.type === 'error').length === 0,\n issues,\n };\n};\n"],"mappings":";;;;;;;;AAaA,MAAM,aAAa,YAA4B;CAC7C,MAAM,QAAQ,QAAQ,MAAM,KAAK;CACjC,MAAM,SAAmB,EAAE;CAC3B,IAAI,cAAc;CAClB,IAAI,YAA2B;AAE/B,MAAK,MAAM,QAAQ,OAAO;EAExB,MAAM,QAAQ,KAAK,MAAM,uBAAuB;AAChD,MAAI,CAAC,YACH,KAAI,OAAO;AACT,iBAAc;AACd,eAAY,MAAM;AAClB,UAAO,KAAK,GAAG;QAGf,QAAO,KAAK,KAAK,QAAQ,eAAe,MAAM,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;OAEjE;AACL,OACE,SACA,MAAM,GAAG,OAAO,UAAW,MAC3B,MAAM,GAAG,UAAU,UAAW,QAC9B;AACA,kBAAc;AACd,gBAAY;;AAEd,UAAO,KAAK,GAAG;;;AAInB,QAAO,OAAO,KAAK,KAAK;;AAG1B,MAAM,sBAAsB,YAA2C;CACrE,MAAM,SAAgC,EAAE;CACxC,MAAM,QAAQ,QAAQ,MAAM,KAAK;CACjC,IAAI,cAAc;CAClB,IAAI,YAA2B;CAC/B,IAAI,iBAAiB;AAErB,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EAGrC,MAAM,QAFO,MAAM,GAEA,MAAM,uBAAuB;AAEhD,MAAI,CAAC,aACH;OAAI,OAAO;AACT,kBAAc;AACd,gBAAY,MAAM;AAClB,qBAAiB,IAAI;;aAIrB,SACA,MAAM,GAAG,OAAO,UAAW,MAC3B,MAAM,GAAG,UAAU,UAAW,QAC9B;AACA,iBAAc;AACd,eAAY;;;AAKlB,KAAI,YACF,QAAO,KAAK;EACV,MAAM;EACN,SAAS,uCAAuC,eAAe;EAChE,CAAC;AAGJ,QAAO;;;;;;;;;AAUT,MAAa,oBAAoB,YAA8C;CAC7E,MAAM,aAAa,mBAAmB,QAAQ;CAC9C,MAAM,aAAaA,kDAAa,UAAU,QAAQ,CAAC,CAAC;CACpD,MAAM,SAAS,CAAC,GAAG,YAAY,GAAG,WAAW;AAE7C,QAAO;EACL,OAAO,OAAO,QAAQ,MAAM,EAAE,SAAS,QAAQ,CAAC,WAAW;EAC3D;EACD"}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_transpiler_nesting_nesting = require('./nesting.cjs');
|
|
3
|
+
|
|
4
|
+
exports.nest = require_transpiler_nesting_nesting.nest;
|
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
|
|
4
|
+
|
|
5
|
+
//#region src/transpiler/nesting/nesting.ts
|
|
6
|
+
/**
|
|
7
|
+
* Function intended to be used to build intlayer dictionaries.
|
|
8
|
+
*
|
|
9
|
+
* Allow to extract the content of another dictionary and nest it in the current dictionary.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* nest("dictionaryKey");
|
|
15
|
+
* nest("dictionaryKey", "path.to.content");
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* The order of the keys will define the priority of the content.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
const nesting = (dictionaryKey, path) => (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.NESTED, {
|
|
22
|
+
dictionaryKey,
|
|
23
|
+
path
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.nest = nesting;
|
|
2
28
|
//# sourceMappingURL=nesting.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nesting.cjs","names":["
|
|
1
|
+
{"version":3,"file":"nesting.cjs","names":["NESTED"],"sources":["../../../../src/transpiler/nesting/nesting.ts"],"sourcesContent":["import type {\n DictionaryKeys,\n DictionaryRegistryContent,\n} from '@intlayer/types/module_augmentation';\nimport type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { formatNodeType, NESTED } from '@intlayer/types/nodeType';\n\nimport type { DeepTransformContent } from '../../interpreter';\n\n/**\n * Recursively builds dot-notation strings for all valid paths in T.\n * Example:\n * type X = { a: { b: { c: string }}, d: number };\n * DotPath<X> = \"a\" | \"a.b\" | \"a.b.c\" | \"d\"\n */\nexport type DotPath<T> = T extends object\n ? {\n [K in keyof T & (string | number)]: T[K] extends object\n ? // Either just K, or K + '.' + deeper path\n `${K}` | `${K}.${DotPath<T[K]>}`\n : `${K}`;\n }[keyof T & (string | number)]\n : never;\n\ntype DeepReplace<T, From, To> = T extends From\n ? To\n : T extends object\n ? { [K in keyof T]: DeepReplace<T[K], From, To> }\n : T;\n\n/** Build all valid dot-notation strings for a dictionary entry. */\nexport type ValidDotPathsFor<K extends DictionaryKeys> = DotPath<\n DeepReplace<\n DeepTransformContent<DictionaryRegistryContent<K>>,\n // Replace ReactElement type with string\n {\n type: any;\n props: any;\n key: any;\n },\n string\n >\n>;\n\nexport type NestedContentState<K extends DictionaryKeys> = {\n dictionaryKey: K;\n\n /**\n * Path must match existing keys in DictionaryRegistryContent<K>.\n * Can be either:\n * - \"dot.dot.dot\" format\n */\n path?: ValidDotPathsFor<K>;\n};\n\nexport type NestedContent<K extends DictionaryKeys = never> = TypedNodeModel<\n typeof NESTED,\n NestedContentState<K>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to extract the content of another dictionary and nest it in the current dictionary.\n *\n * Usage:\n *\n * ```ts\n * nest(\"dictionaryKey\");\n * nest(\"dictionaryKey\", \"path.to.content\");\n * ```\n *\n * The order of the keys will define the priority of the content.\n *\n */\nconst nesting = <K extends DictionaryKeys>(\n dictionaryKey: K,\n path?: ValidDotPathsFor<K>\n): NestedContent<K> =>\n formatNodeType(NESTED, {\n dictionaryKey,\n path,\n });\n\nexport { nesting as nest };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2EA,MAAM,WACJ,eACA,sDAEeA,iCAAQ;CACrB;CACA;CACD,CAAC"}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_transpiler_translation_translation = require('./translation.cjs');
|
|
3
|
+
|
|
4
|
+
exports.t = require_transpiler_translation_translation.t;
|
|
@@ -1,2 +1,30 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
|
|
4
|
+
|
|
5
|
+
//#region src/transpiler/translation/translation.ts
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* Function intended to be used to build intlayer dictionaries.
|
|
9
|
+
*
|
|
10
|
+
* Get the content of a translation based on the locale.
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* translation<string>({
|
|
16
|
+
* "en": "Hello",
|
|
17
|
+
* "fr": "Bonjour",
|
|
18
|
+
* // ... any other available locale
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Using TypeScript:
|
|
23
|
+
* - this function require each locale to be defined if defined in the project configuration.
|
|
24
|
+
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
25
|
+
*/
|
|
26
|
+
const translation = (content) => (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.TRANSLATION, content);
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.t = translation;
|
|
2
30
|
//# sourceMappingURL=translation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.cjs","names":["
|
|
1
|
+
{"version":3,"file":"translation.cjs","names":["TRANSLATION"],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":["import type { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';\nimport type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { formatNodeType, TRANSLATION } from '@intlayer/types/nodeType';\n\nexport type TranslationContent<\n Content = unknown,\n RecordContent extends\n StrictModeLocaleMap<Content> = StrictModeLocaleMap<Content>,\n> = TypedNodeModel<typeof TRANSLATION, RecordContent>;\n\n/**\n *\n * Function intended to be used to build intlayer dictionaries.\n *\n * Get the content of a translation based on the locale.\n *\n * Usage:\n *\n * ```ts\n * translation<string>({\n * \"en\": \"Hello\",\n * \"fr\": \"Bonjour\",\n * // ... any other available locale\n * })\n * ```\n *\n * Using TypeScript:\n * - this function require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nconst translation = <\n Content = unknown,\n ContentRecord extends\n StrictModeLocaleMap<Content> = StrictModeLocaleMap<Content>,\n>(\n content: ContentRecord\n) =>\n formatNodeType(TRANSLATION, content) satisfies TranslationContent<\n Content,\n ContentRecord\n >;\n\nexport { translation as t };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,eAKJ,yDAEeA,sCAAa,QAAQ"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
//#region src/utils/checkIsURLAbsolute.ts
|
|
4
|
+
const checkIsURLAbsolute = (url) => /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url);
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.checkIsURLAbsolute = checkIsURLAbsolute;
|
|
2
8
|
//# sourceMappingURL=checkIsURLAbsolute.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkIsURLAbsolute.cjs","names":[],"sources":["../../../src/utils/checkIsURLAbsolute.ts"],"sourcesContent":["export const checkIsURLAbsolute = (url: string): boolean =>\n /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(url);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkIsURLAbsolute.cjs","names":[],"sources":["../../../src/utils/checkIsURLAbsolute.ts"],"sourcesContent":["export const checkIsURLAbsolute = (url: string): boolean =>\n /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(url);\n"],"mappings":";;;AAAA,MAAa,sBAAsB,QACjC,4BAA4B,KAAK,IAAI"}
|
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
//#region src/utils/getCookie.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves a cookie by name from a cookie string or document.cookie
|
|
6
|
+
* @param name - The name of the cookie to retrieve
|
|
7
|
+
* @param cookieString - Optional cookie string to parse (defaults to document.cookie in browser)
|
|
8
|
+
* @returns The cookie value or undefined if not found
|
|
9
|
+
*/
|
|
10
|
+
const getCookie = (name, cookieString) => {
|
|
11
|
+
try {
|
|
12
|
+
const str = cookieString ?? (typeof document !== "undefined" ? document.cookie : "");
|
|
13
|
+
if (!str) return void 0;
|
|
14
|
+
const pairs = str.split(";");
|
|
15
|
+
for (let i = 0; i < pairs.length; i++) {
|
|
16
|
+
const part = pairs[i].trim();
|
|
17
|
+
if (!part) continue;
|
|
18
|
+
const equalIndex = part.indexOf("=");
|
|
19
|
+
if ((equalIndex >= 0 ? part.substring(0, equalIndex) : part) === name) {
|
|
20
|
+
const rawValue = equalIndex >= 0 ? part.substring(equalIndex + 1) : "";
|
|
21
|
+
try {
|
|
22
|
+
return decodeURIComponent(rawValue);
|
|
23
|
+
} catch {
|
|
24
|
+
return rawValue;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
} catch {}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.getCookie = getCookie;
|
|
2
33
|
//# sourceMappingURL=getCookie.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCookie.cjs","names":[],"sources":["../../../src/utils/getCookie.ts"],"sourcesContent":["/**\n * Retrieves a cookie by name from a cookie string or document.cookie\n * @param name - The name of the cookie to retrieve\n * @param cookieString - Optional cookie string to parse (defaults to document.cookie in browser)\n * @returns The cookie value or undefined if not found\n */\nexport const getCookie = (\n name: string,\n cookieString?: string\n): string | undefined => {\n try {\n const str =\n cookieString ?? (typeof document !== 'undefined' ? document.cookie : '');\n\n if (!str) return undefined;\n\n const pairs = str.split(';');\n\n for (let i = 0; i < pairs.length; i++) {\n const part = pairs[i].trim();\n\n if (!part) continue;\n\n const equalIndex = part.indexOf('=');\n const key = equalIndex >= 0 ? part.substring(0, equalIndex) : part;\n\n if (key === name) {\n const rawValue = equalIndex >= 0 ? part.substring(equalIndex + 1) : '';\n\n try {\n return decodeURIComponent(rawValue);\n } catch {\n return rawValue;\n }\n }\n }\n } catch {}\n return undefined;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getCookie.cjs","names":[],"sources":["../../../src/utils/getCookie.ts"],"sourcesContent":["/**\n * Retrieves a cookie by name from a cookie string or document.cookie\n * @param name - The name of the cookie to retrieve\n * @param cookieString - Optional cookie string to parse (defaults to document.cookie in browser)\n * @returns The cookie value or undefined if not found\n */\nexport const getCookie = (\n name: string,\n cookieString?: string\n): string | undefined => {\n try {\n const str =\n cookieString ?? (typeof document !== 'undefined' ? document.cookie : '');\n\n if (!str) return undefined;\n\n const pairs = str.split(';');\n\n for (let i = 0; i < pairs.length; i++) {\n const part = pairs[i].trim();\n\n if (!part) continue;\n\n const equalIndex = part.indexOf('=');\n const key = equalIndex >= 0 ? part.substring(0, equalIndex) : part;\n\n if (key === name) {\n const rawValue = equalIndex >= 0 ? part.substring(equalIndex + 1) : '';\n\n try {\n return decodeURIComponent(rawValue);\n } catch {\n return rawValue;\n }\n }\n }\n } catch {}\n return undefined;\n};\n"],"mappings":";;;;;;;;;AAMA,MAAa,aACX,MACA,iBACuB;AACvB,KAAI;EACF,MAAM,MACJ,iBAAiB,OAAO,aAAa,cAAc,SAAS,SAAS;AAEvE,MAAI,CAAC,IAAK,QAAO;EAEjB,MAAM,QAAQ,IAAI,MAAM,IAAI;AAE5B,OAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;GACrC,MAAM,OAAO,MAAM,GAAG,MAAM;AAE5B,OAAI,CAAC,KAAM;GAEX,MAAM,aAAa,KAAK,QAAQ,IAAI;AAGpC,QAFY,cAAc,IAAI,KAAK,UAAU,GAAG,WAAW,GAAG,UAElD,MAAM;IAChB,MAAM,WAAW,cAAc,IAAI,KAAK,UAAU,aAAa,EAAE,GAAG;AAEpE,QAAI;AACF,YAAO,mBAAmB,SAAS;YAC7B;AACN,YAAO;;;;SAIP"}
|
package/dist/cjs/utils/index.cjs
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_utils_parseYaml = require('./parseYaml.cjs');
|
|
3
|
+
const require_utils_isValidReactElement = require('./isValidReactElement.cjs');
|
|
4
|
+
const require_utils_intl = require('./intl.cjs');
|
|
5
|
+
const require_utils_getCookie = require('./getCookie.cjs');
|
|
6
|
+
const require_utils_localeStorage = require('./localeStorage.cjs');
|
|
7
|
+
const require_utils_checkIsURLAbsolute = require('./checkIsURLAbsolute.cjs');
|
|
8
|
+
const require_utils_isSameKeyPath = require('./isSameKeyPath.cjs');
|
|
9
|
+
|
|
10
|
+
exports.CachedIntl = require_utils_intl.CachedIntl;
|
|
11
|
+
exports.Intl = require_utils_intl.CachedIntl;
|
|
12
|
+
exports.LocaleStorage = require_utils_localeStorage.LocaleStorage;
|
|
13
|
+
exports.bindIntl = require_utils_intl.bindIntl;
|
|
14
|
+
exports.checkIsURLAbsolute = require_utils_checkIsURLAbsolute.checkIsURLAbsolute;
|
|
15
|
+
exports.createCachedIntl = require_utils_intl.createCachedIntl;
|
|
16
|
+
exports.getCookie = require_utils_getCookie.getCookie;
|
|
17
|
+
exports.getLocaleFromStorage = require_utils_localeStorage.getLocaleFromStorage;
|
|
18
|
+
exports.isSameKeyPath = require_utils_isSameKeyPath.isSameKeyPath;
|
|
19
|
+
exports.isValidElement = require_utils_isValidReactElement.isValidElement;
|
|
20
|
+
exports.parseYaml = require_utils_parseYaml.parseYaml;
|
|
21
|
+
exports.setLocaleInStorage = require_utils_localeStorage.setLocaleInStorage;
|
package/dist/cjs/utils/intl.cjs
CHANGED
|
@@ -1,2 +1,92 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _intlayer_types_locales = require("@intlayer/types/locales");
|
|
4
|
+
|
|
5
|
+
//#region src/utils/intl.ts
|
|
6
|
+
/**
|
|
7
|
+
* Optimized Cache Key Generator
|
|
8
|
+
* 1. Fast path: If no options, just use the locale string.
|
|
9
|
+
* 2. Normal path: JSON.stringify for deterministic object comparison.
|
|
10
|
+
*/
|
|
11
|
+
const getCacheKey = (locales, options) => {
|
|
12
|
+
const localeKey = locales ? String(locales) : _intlayer_types_locales.ENGLISH;
|
|
13
|
+
if (!options) return localeKey;
|
|
14
|
+
return `${localeKey}|${JSON.stringify(options)}`;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Generic wrapper for any `new Intl.*()` constructor.
|
|
18
|
+
*/
|
|
19
|
+
const createCachedConstructor = (Ctor) => {
|
|
20
|
+
const cache = /* @__PURE__ */ new Map();
|
|
21
|
+
const MAX_CACHE_SIZE = 50;
|
|
22
|
+
function Wrapped(locales, options) {
|
|
23
|
+
let resolvedLocales = locales;
|
|
24
|
+
let resolvedOptions = options;
|
|
25
|
+
if (typeof locales === "object" && !Array.isArray(locales) && locales !== null) {
|
|
26
|
+
resolvedOptions = locales;
|
|
27
|
+
resolvedLocales = locales.locale;
|
|
28
|
+
}
|
|
29
|
+
if (Ctor.name === "DisplayNames" && typeof Intl?.DisplayNames !== "function") {}
|
|
30
|
+
const key = getCacheKey(resolvedLocales, resolvedOptions);
|
|
31
|
+
let instance = cache.get(key);
|
|
32
|
+
if (instance) return instance;
|
|
33
|
+
instance = new Ctor(resolvedLocales, resolvedOptions);
|
|
34
|
+
if (cache.size >= MAX_CACHE_SIZE) {
|
|
35
|
+
const oldestKey = cache.keys().next().value;
|
|
36
|
+
if (oldestKey) cache.delete(oldestKey);
|
|
37
|
+
}
|
|
38
|
+
cache.set(key, instance);
|
|
39
|
+
return instance;
|
|
40
|
+
}
|
|
41
|
+
Wrapped.prototype = Ctor.prototype;
|
|
42
|
+
return Wrapped;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Factory that turns the global `Intl` into a cached clone.
|
|
46
|
+
*/
|
|
47
|
+
const createCachedIntl = () => {
|
|
48
|
+
const constructorCache = /* @__PURE__ */ new Map();
|
|
49
|
+
return new Proxy(Intl, { get: (target, prop, receiver) => {
|
|
50
|
+
if (constructorCache.has(prop)) return constructorCache.get(prop);
|
|
51
|
+
const value = Reflect.get(target, prop, receiver);
|
|
52
|
+
if (typeof value === "function" && typeof prop === "string" && /^[A-Z]/.test(prop)) {
|
|
53
|
+
const wrapped = createCachedConstructor(value);
|
|
54
|
+
constructorCache.set(prop, wrapped);
|
|
55
|
+
return wrapped;
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
} });
|
|
59
|
+
};
|
|
60
|
+
const CachedIntl = createCachedIntl();
|
|
61
|
+
/**
|
|
62
|
+
* Creates a proxied Intl object with a preset locale.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* const intl = bindIntl(Locales.FRENCH);
|
|
66
|
+
* new intl.NumberFormat(undefined, { style: 'currency', currency: 'EUR' }).format(10);
|
|
67
|
+
* // Uses 'fr' automatically
|
|
68
|
+
*/
|
|
69
|
+
const bindIntl = (locale) => {
|
|
70
|
+
return new Proxy(CachedIntl, { get: (target, prop) => {
|
|
71
|
+
const value = Reflect.get(target, prop);
|
|
72
|
+
if (typeof value === "function" && typeof prop === "string" && /^[A-Z]/.test(prop)) return new Proxy(value, {
|
|
73
|
+
construct: (Ctor, args) => {
|
|
74
|
+
let [locales, options] = args;
|
|
75
|
+
if (typeof locales === "object" && !Array.isArray(locales) && locales !== null) {
|
|
76
|
+
options = locales;
|
|
77
|
+
locales = options.locale ?? locale;
|
|
78
|
+
} else if (locales === void 0) locales = locale;
|
|
79
|
+
return new Ctor(locales, options);
|
|
80
|
+
},
|
|
81
|
+
get: (Ctor, key) => Reflect.get(Ctor, key)
|
|
82
|
+
});
|
|
83
|
+
return value;
|
|
84
|
+
} });
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
exports.CachedIntl = CachedIntl;
|
|
89
|
+
exports.Intl = CachedIntl;
|
|
90
|
+
exports.bindIntl = bindIntl;
|
|
91
|
+
exports.createCachedIntl = createCachedIntl;
|
|
2
92
|
//# sourceMappingURL=intl.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intl.cjs","names":["ENGLISH"],"sources":["../../../src/utils/intl.ts"],"sourcesContent":["// Cached Intl helper – drop‑in replacement for the global `Intl` object.\n// ‑‑‑\n// • Uses a `Proxy` to lazily wrap every *constructor* hanging off `Intl` (NumberFormat, DateTimeFormat, …).\n// • Each wrapped constructor keeps an in‑memory cache keyed by `[locales, options]` so that identical requests\n// reuse the same heavy instance instead of reparsing CLDR data every time.\n// • A polyfill warning for `Intl.DisplayNames` is emitted only once and only in dev.\n// • The public API is fully type‑safe and mirrors the native `Intl` surface exactly –\n// you can treat `CachedIntl` just like the built‑in `Intl`.\n//\n// Usage examples:\n// ---------------\n// import { CachedIntl } from \"./cached-intl\";\n//\n// const nf = CachedIntl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n// console.log(nf.format(1234));\n//\n// const dn = CachedIntl.DisplayNames([\"fr\"], { type: \"language\" });\n// console.log(dn.of(\"en\")); // → \"anglais\"\n//\n// You can also spin up an isolated instance with its own caches (handy in test suites):\n// const TestIntl = createCachedIntl();\n//\n// ---------------------------------------------------------------------\n\nimport { ENGLISH } from '@intlayer/types/locales';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\n// Helper type that picks just the constructor members off `typeof Intl`.\n// The \"capital‑letter\" heuristic is 100 % accurate today and keeps the\n// mapping short‑lived, so we don't have to manually list every constructor.\ntype IntlConstructors = {\n [K in keyof typeof Intl as (typeof Intl)[K] extends new (\n ...args: any\n ) => any\n ? K\n : never]: (typeof Intl)[K];\n};\n\n// Type wrapper to replace locale arguments with LocalesValues\ntype ReplaceLocaleWithLocalesValues<T> = T extends new (\n locales: any,\n options?: infer Options\n) => infer Instance\n ? {\n new (locales?: LocalesValues, options?: Options): Instance;\n new (options?: Options & { locale?: LocalesValues }): Instance;\n }\n : T extends new (\n locales: any\n ) => infer Instance\n ? {\n new (locales?: LocalesValues): Instance;\n new (options?: { locale?: LocalesValues }): Instance;\n }\n : T;\n\n// Wrapped Intl type with LocalesValues\nexport type WrappedIntl = {\n [K in keyof typeof Intl]: K extends keyof IntlConstructors\n ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]>\n : (typeof Intl)[K];\n};\n\n// ... (Keep your Type Helper definitions here: IntlConstructors, ReplaceLocaleWithLocalesValues, WrappedIntl) ...\n\n/**\n * Optimized Cache Key Generator\n * 1. Fast path: If no options, just use the locale string.\n * 2. Normal path: JSON.stringify for deterministic object comparison.\n */\nconst getCacheKey = (\n locales: LocalesValues | undefined,\n options: unknown\n): string => {\n const localeKey = locales ? String(locales) : ENGLISH;\n\n if (!options) return localeKey;\n\n // JSON.stringify is the most robust way to handle nested options objects\n // without a heavy custom hashing function.\n return `${localeKey}|${JSON.stringify(options)}`;\n};\n\n/**\n * Generic wrapper for any `new Intl.*()` constructor.\n */\nconst createCachedConstructor = <T extends new (...args: any[]) => any>(\n Ctor: T\n) => {\n // The cache lives here, inside the closure of the wrapped constructor.\n const cache = new Map<string, InstanceType<T>>();\n const MAX_CACHE_SIZE = 50;\n\n function Wrapped(locales?: LocalesValues | any, options?: any) {\n let resolvedLocales = locales;\n let resolvedOptions = options;\n\n // Handle case where first argument is an options object instead of locales\n if (\n typeof locales === 'object' &&\n !Array.isArray(locales) &&\n locales !== null\n ) {\n resolvedOptions = locales;\n resolvedLocales = locales.locale;\n }\n\n // Handle DisplayNames Polyfill warning\n if (\n Ctor.name === 'DisplayNames' &&\n typeof (Intl as any)?.DisplayNames !== 'function'\n ) {\n // ... (Existing polyfill logic would go here if needed, but let's keep it simple for now as it was empty in the read output)\n // Actually the read output had \"// ... (Your existing polyfill warning logic) ...\"\n // I should check what was there before or just preserve it.\n }\n\n // Generate Key\n const key = getCacheKey(resolvedLocales, resolvedOptions);\n\n // Check Cache\n let instance = cache.get(key);\n if (instance) return instance;\n\n // Create New Instance\n instance = new Ctor(resolvedLocales as never, resolvedOptions as never);\n\n // Smart Eviction (LRU-ish)\n // Map iterates in insertion order. Deleting the first key removes the \"oldest\".\n if (cache.size >= MAX_CACHE_SIZE) {\n const oldestKey = cache.keys().next().value;\n if (oldestKey) cache.delete(oldestKey);\n }\n\n cache.set(key, instance as InstanceType<T>);\n return instance as InstanceType<T>;\n }\n\n // Preserve prototype for `instanceof` checks\n (Wrapped as any).prototype = (Ctor as any).prototype;\n\n return Wrapped as unknown as ReplaceLocaleWithLocalesValues<T>;\n};\n\n/**\n * Factory that turns the global `Intl` into a cached clone.\n */\nexport const createCachedIntl = (): WrappedIntl => {\n // We must cache the *wrapped constructors* themselves.\n // Otherwise, the Proxy creates a new `Wrapped` function (and a new empty Map)\n // on every single property access.\n const constructorCache = new Map<string | symbol, any>();\n\n return new Proxy(Intl as IntlConstructors, {\n get: (target, prop, receiver) => {\n // Fast return if we already wrapped this constructor\n if (constructorCache.has(prop)) {\n return constructorCache.get(prop);\n }\n\n const value = Reflect.get(target, prop, receiver);\n\n // Wrap only Constructors (Heuristic: Function + starts with Uppercase)\n // This prevents wrapping static methods like `Intl.getCanonicalLocales`\n if (\n typeof value === 'function' &&\n typeof prop === 'string' &&\n /^[A-Z]/.test(prop)\n ) {\n const wrapped = createCachedConstructor(value);\n constructorCache.set(prop, wrapped);\n return wrapped;\n }\n\n // Pass through everything else (static methods, constants)\n return value;\n },\n }) as unknown as WrappedIntl;\n};\n\nexport const CachedIntl = createCachedIntl();\n\n/**\n * Creates a proxied Intl object with a preset locale.\n *\n * @example\n * const intl = bindIntl(Locales.FRENCH);\n * new intl.NumberFormat(undefined, { style: 'currency', currency: 'EUR' }).format(10);\n * // Uses 'fr' automatically\n */\nexport const bindIntl = (locale: LocalesValues): WrappedIntl => {\n return new Proxy(CachedIntl, {\n get: (target, prop) => {\n const value = Reflect.get(target, prop);\n\n // We only want to intercept Constructors (e.g., NumberFormat, DateTimeFormat)\n // to inject the locale into their arguments.\n if (\n typeof value === 'function' &&\n typeof prop === 'string' &&\n /^[A-Z]/.test(prop)\n ) {\n return new Proxy(value, {\n construct: (Ctor, args) => {\n let [locales, options] = args;\n\n // If the user provided a locale (args[0]), respect it.\n // If args[0] is undefined, inject the bound locale.\n // If args[0] is an object (not array), it's the options object.\n if (\n typeof locales === 'object' &&\n !Array.isArray(locales) &&\n locales !== null\n ) {\n options = locales;\n locales = options.locale ?? locale;\n } else if (locales === undefined) {\n locales = locale;\n }\n\n // We pass it to `CachedIntl` which handles caching logic.\n return new Ctor(locales, options);\n },\n // Ensure static methods (like supportedLocalesOf) still work\n get: (Ctor, key) => Reflect.get(Ctor, key),\n });\n }\n\n // Return constants or static methods as-is\n return value;\n },\n }) as unknown as WrappedIntl;\n};\n\n// new CachedIntl.DisplayNames(Locales.FRENCH, { type: 'language' });\n// new CachedIntl.DisplayNames('fr', { type: 'language' });\n// new CachedIntl.DateTimeFormat('fr', {\n// year: 'numeric',\n// month: 'long',\n// day: 'numeric',\n// });\n// new CachedIntl.NumberFormat('fr', {\n// style: 'currency',\n// currency: 'EUR',\n// });\n// new CachedIntl.Collator('fr', { sensitivity: 'base' });\n// new CachedIntl.PluralRules('fr');\n// new CachedIntl.RelativeTimeFormat('fr', { numeric: 'auto' });\n// new CachedIntl.ListFormat('fr', { type: 'conjunction' });\nexport { CachedIntl as Intl };\n"],"mappings":"6IAsEA,MAAM,GACJ,EACA,IACW,CACX,IAAM,EAAY,EAAU,OAAO,EAAQ,CAAGA,EAAAA,QAM9C,OAJK,EAIE,GAAG,EAAU,GAAG,KAAK,UAAU,EAAQ,GAJzB,GAUjB,EACJ,GACG,CAEH,IAAM,EAAQ,IAAI,IAGlB,SAAS,EAAQ,EAA+B,EAAe,CAC7D,IAAI,EAAkB,EAClB,EAAkB,EAIpB,OAAO,GAAY,UACnB,CAAC,MAAM,QAAQ,EAAQ,EACvB,IAAY,OAEZ,EAAkB,EAClB,EAAkB,EAAQ,QAK1B,EAAK,OAAS,gBACN,MAAc,aAQxB,IAAM,EAAM,EAAY,EAAiB,EAAgB,CAGrD,EAAW,EAAM,IAAI,EAAI,CAC7B,GAAI,EAAU,OAAO,EAOrB,GAJA,EAAW,IAAI,EAAK,EAA0B,EAAyB,CAInE,EAAM,MAAQ,GAAgB,CAChC,IAAM,EAAY,EAAM,MAAM,CAAC,MAAM,CAAC,MAClC,GAAW,EAAM,OAAO,EAAU,CAIxC,OADA,EAAM,IAAI,EAAK,EAA4B,CACpC,EAMT,MAFC,GAAgB,UAAa,EAAa,UAEpC,GAMI,MAAsC,CAIjD,IAAM,EAAmB,IAAI,IAE7B,OAAO,IAAI,MAAM,KAA0B,CACzC,KAAM,EAAQ,EAAM,IAAa,CAE/B,GAAI,EAAiB,IAAI,EAAK,CAC5B,OAAO,EAAiB,IAAI,EAAK,CAGnC,IAAM,EAAQ,QAAQ,IAAI,EAAQ,EAAM,EAAS,CAIjD,GACE,OAAO,GAAU,YACjB,OAAO,GAAS,UAChB,SAAS,KAAK,EAAK,CACnB,CACA,IAAM,EAAU,EAAwB,EAAM,CAE9C,OADA,EAAiB,IAAI,EAAM,EAAQ,CAC5B,EAIT,OAAO,GAEV,CAAC,EAGS,EAAa,GAAkB,CAU/B,EAAY,GAChB,IAAI,MAAM,EAAY,CAC3B,KAAM,EAAQ,IAAS,CACrB,IAAM,EAAQ,QAAQ,IAAI,EAAQ,EAAK,CAoCvC,OA/BE,OAAO,GAAU,YACjB,OAAO,GAAS,UAChB,SAAS,KAAK,EAAK,CAEZ,IAAI,MAAM,EAAO,CACtB,WAAY,EAAM,IAAS,CACzB,GAAI,CAAC,EAAS,GAAW,EAiBzB,OAXE,OAAO,GAAY,UACnB,CAAC,MAAM,QAAQ,EAAQ,EACvB,IAAY,MAEZ,EAAU,EACV,EAAU,EAAQ,QAAU,GACnB,IAAY,IAAA,KACrB,EAAU,GAIL,IAAI,EAAK,EAAS,EAAQ,EAGnC,KAAM,EAAM,IAAQ,QAAQ,IAAI,EAAM,EAAI,CAC3C,CAAC,CAIG,GAEV,CAAC"}
|
|
1
|
+
{"version":3,"file":"intl.cjs","names":["ENGLISH"],"sources":["../../../src/utils/intl.ts"],"sourcesContent":["// Cached Intl helper – drop‑in replacement for the global `Intl` object.\n// ‑‑‑\n// • Uses a `Proxy` to lazily wrap every *constructor* hanging off `Intl` (NumberFormat, DateTimeFormat, …).\n// • Each wrapped constructor keeps an in‑memory cache keyed by `[locales, options]` so that identical requests\n// reuse the same heavy instance instead of reparsing CLDR data every time.\n// • A polyfill warning for `Intl.DisplayNames` is emitted only once and only in dev.\n// • The public API is fully type‑safe and mirrors the native `Intl` surface exactly –\n// you can treat `CachedIntl` just like the built‑in `Intl`.\n//\n// Usage examples:\n// ---------------\n// import { CachedIntl } from \"./cached-intl\";\n//\n// const nf = CachedIntl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n// console.log(nf.format(1234));\n//\n// const dn = CachedIntl.DisplayNames([\"fr\"], { type: \"language\" });\n// console.log(dn.of(\"en\")); // → \"anglais\"\n//\n// You can also spin up an isolated instance with its own caches (handy in test suites):\n// const TestIntl = createCachedIntl();\n//\n// ---------------------------------------------------------------------\n\nimport { ENGLISH } from '@intlayer/types/locales';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\n// Helper type that picks just the constructor members off `typeof Intl`.\n// The \"capital‑letter\" heuristic is 100 % accurate today and keeps the\n// mapping short‑lived, so we don't have to manually list every constructor.\ntype IntlConstructors = {\n [K in keyof typeof Intl as (typeof Intl)[K] extends new (\n ...args: any\n ) => any\n ? K\n : never]: (typeof Intl)[K];\n};\n\n// Type wrapper to replace locale arguments with LocalesValues\ntype ReplaceLocaleWithLocalesValues<T> = T extends new (\n locales: any,\n options?: infer Options\n) => infer Instance\n ? {\n new (locales?: LocalesValues, options?: Options): Instance;\n new (options?: Options & { locale?: LocalesValues }): Instance;\n }\n : T extends new (\n locales: any\n ) => infer Instance\n ? {\n new (locales?: LocalesValues): Instance;\n new (options?: { locale?: LocalesValues }): Instance;\n }\n : T;\n\n// Wrapped Intl type with LocalesValues\nexport type WrappedIntl = {\n [K in keyof typeof Intl]: K extends keyof IntlConstructors\n ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]>\n : (typeof Intl)[K];\n};\n\n// ... (Keep your Type Helper definitions here: IntlConstructors, ReplaceLocaleWithLocalesValues, WrappedIntl) ...\n\n/**\n * Optimized Cache Key Generator\n * 1. Fast path: If no options, just use the locale string.\n * 2. Normal path: JSON.stringify for deterministic object comparison.\n */\nconst getCacheKey = (\n locales: LocalesValues | undefined,\n options: unknown\n): string => {\n const localeKey = locales ? String(locales) : ENGLISH;\n\n if (!options) return localeKey;\n\n // JSON.stringify is the most robust way to handle nested options objects\n // without a heavy custom hashing function.\n return `${localeKey}|${JSON.stringify(options)}`;\n};\n\n/**\n * Generic wrapper for any `new Intl.*()` constructor.\n */\nconst createCachedConstructor = <T extends new (...args: any[]) => any>(\n Ctor: T\n) => {\n // The cache lives here, inside the closure of the wrapped constructor.\n const cache = new Map<string, InstanceType<T>>();\n const MAX_CACHE_SIZE = 50;\n\n function Wrapped(locales?: LocalesValues | any, options?: any) {\n let resolvedLocales = locales;\n let resolvedOptions = options;\n\n // Handle case where first argument is an options object instead of locales\n if (\n typeof locales === 'object' &&\n !Array.isArray(locales) &&\n locales !== null\n ) {\n resolvedOptions = locales;\n resolvedLocales = locales.locale;\n }\n\n // Handle DisplayNames Polyfill warning\n if (\n Ctor.name === 'DisplayNames' &&\n typeof (Intl as any)?.DisplayNames !== 'function'\n ) {\n // ... (Existing polyfill logic would go here if needed, but let's keep it simple for now as it was empty in the read output)\n // Actually the read output had \"// ... (Your existing polyfill warning logic) ...\"\n // I should check what was there before or just preserve it.\n }\n\n // Generate Key\n const key = getCacheKey(resolvedLocales, resolvedOptions);\n\n // Check Cache\n let instance = cache.get(key);\n if (instance) return instance;\n\n // Create New Instance\n instance = new Ctor(resolvedLocales as never, resolvedOptions as never);\n\n // Smart Eviction (LRU-ish)\n // Map iterates in insertion order. Deleting the first key removes the \"oldest\".\n if (cache.size >= MAX_CACHE_SIZE) {\n const oldestKey = cache.keys().next().value;\n if (oldestKey) cache.delete(oldestKey);\n }\n\n cache.set(key, instance as InstanceType<T>);\n return instance as InstanceType<T>;\n }\n\n // Preserve prototype for `instanceof` checks\n (Wrapped as any).prototype = (Ctor as any).prototype;\n\n return Wrapped as unknown as ReplaceLocaleWithLocalesValues<T>;\n};\n\n/**\n * Factory that turns the global `Intl` into a cached clone.\n */\nexport const createCachedIntl = (): WrappedIntl => {\n // We must cache the *wrapped constructors* themselves.\n // Otherwise, the Proxy creates a new `Wrapped` function (and a new empty Map)\n // on every single property access.\n const constructorCache = new Map<string | symbol, any>();\n\n return new Proxy(Intl as IntlConstructors, {\n get: (target, prop, receiver) => {\n // Fast return if we already wrapped this constructor\n if (constructorCache.has(prop)) {\n return constructorCache.get(prop);\n }\n\n const value = Reflect.get(target, prop, receiver);\n\n // Wrap only Constructors (Heuristic: Function + starts with Uppercase)\n // This prevents wrapping static methods like `Intl.getCanonicalLocales`\n if (\n typeof value === 'function' &&\n typeof prop === 'string' &&\n /^[A-Z]/.test(prop)\n ) {\n const wrapped = createCachedConstructor(value);\n constructorCache.set(prop, wrapped);\n return wrapped;\n }\n\n // Pass through everything else (static methods, constants)\n return value;\n },\n }) as unknown as WrappedIntl;\n};\n\nexport const CachedIntl = createCachedIntl();\n\n/**\n * Creates a proxied Intl object with a preset locale.\n *\n * @example\n * const intl = bindIntl(Locales.FRENCH);\n * new intl.NumberFormat(undefined, { style: 'currency', currency: 'EUR' }).format(10);\n * // Uses 'fr' automatically\n */\nexport const bindIntl = (locale: LocalesValues): WrappedIntl => {\n return new Proxy(CachedIntl, {\n get: (target, prop) => {\n const value = Reflect.get(target, prop);\n\n // We only want to intercept Constructors (e.g., NumberFormat, DateTimeFormat)\n // to inject the locale into their arguments.\n if (\n typeof value === 'function' &&\n typeof prop === 'string' &&\n /^[A-Z]/.test(prop)\n ) {\n return new Proxy(value, {\n construct: (Ctor, args) => {\n let [locales, options] = args;\n\n // If the user provided a locale (args[0]), respect it.\n // If args[0] is undefined, inject the bound locale.\n // If args[0] is an object (not array), it's the options object.\n if (\n typeof locales === 'object' &&\n !Array.isArray(locales) &&\n locales !== null\n ) {\n options = locales;\n locales = options.locale ?? locale;\n } else if (locales === undefined) {\n locales = locale;\n }\n\n // We pass it to `CachedIntl` which handles caching logic.\n return new Ctor(locales, options);\n },\n // Ensure static methods (like supportedLocalesOf) still work\n get: (Ctor, key) => Reflect.get(Ctor, key),\n });\n }\n\n // Return constants or static methods as-is\n return value;\n },\n }) as unknown as WrappedIntl;\n};\n\n// new CachedIntl.DisplayNames(Locales.FRENCH, { type: 'language' });\n// new CachedIntl.DisplayNames('fr', { type: 'language' });\n// new CachedIntl.DateTimeFormat('fr', {\n// year: 'numeric',\n// month: 'long',\n// day: 'numeric',\n// });\n// new CachedIntl.NumberFormat('fr', {\n// style: 'currency',\n// currency: 'EUR',\n// });\n// new CachedIntl.Collator('fr', { sensitivity: 'base' });\n// new CachedIntl.PluralRules('fr');\n// new CachedIntl.RelativeTimeFormat('fr', { numeric: 'auto' });\n// new CachedIntl.ListFormat('fr', { type: 'conjunction' });\nexport { CachedIntl as Intl };\n"],"mappings":";;;;;;;;;;AAsEA,MAAM,eACJ,SACA,YACW;CACX,MAAM,YAAY,UAAU,OAAO,QAAQ,GAAGA;AAE9C,KAAI,CAAC,QAAS,QAAO;AAIrB,QAAO,GAAG,UAAU,GAAG,KAAK,UAAU,QAAQ;;;;;AAMhD,MAAM,2BACJ,SACG;CAEH,MAAM,wBAAQ,IAAI,KAA8B;CAChD,MAAM,iBAAiB;CAEvB,SAAS,QAAQ,SAA+B,SAAe;EAC7D,IAAI,kBAAkB;EACtB,IAAI,kBAAkB;AAGtB,MACE,OAAO,YAAY,YACnB,CAAC,MAAM,QAAQ,QAAQ,IACvB,YAAY,MACZ;AACA,qBAAkB;AAClB,qBAAkB,QAAQ;;AAI5B,MACE,KAAK,SAAS,kBACd,OAAQ,MAAc,iBAAiB,YACvC;EAOF,MAAM,MAAM,YAAY,iBAAiB,gBAAgB;EAGzD,IAAI,WAAW,MAAM,IAAI,IAAI;AAC7B,MAAI,SAAU,QAAO;AAGrB,aAAW,IAAI,KAAK,iBAA0B,gBAAyB;AAIvE,MAAI,MAAM,QAAQ,gBAAgB;GAChC,MAAM,YAAY,MAAM,MAAM,CAAC,MAAM,CAAC;AACtC,OAAI,UAAW,OAAM,OAAO,UAAU;;AAGxC,QAAM,IAAI,KAAK,SAA4B;AAC3C,SAAO;;AAIT,CAAC,QAAgB,YAAa,KAAa;AAE3C,QAAO;;;;;AAMT,MAAa,yBAAsC;CAIjD,MAAM,mCAAmB,IAAI,KAA2B;AAExD,QAAO,IAAI,MAAM,MAA0B,EACzC,MAAM,QAAQ,MAAM,aAAa;AAE/B,MAAI,iBAAiB,IAAI,KAAK,CAC5B,QAAO,iBAAiB,IAAI,KAAK;EAGnC,MAAM,QAAQ,QAAQ,IAAI,QAAQ,MAAM,SAAS;AAIjD,MACE,OAAO,UAAU,cACjB,OAAO,SAAS,YAChB,SAAS,KAAK,KAAK,EACnB;GACA,MAAM,UAAU,wBAAwB,MAAM;AAC9C,oBAAiB,IAAI,MAAM,QAAQ;AACnC,UAAO;;AAIT,SAAO;IAEV,CAAC;;AAGJ,MAAa,aAAa,kBAAkB;;;;;;;;;AAU5C,MAAa,YAAY,WAAuC;AAC9D,QAAO,IAAI,MAAM,YAAY,EAC3B,MAAM,QAAQ,SAAS;EACrB,MAAM,QAAQ,QAAQ,IAAI,QAAQ,KAAK;AAIvC,MACE,OAAO,UAAU,cACjB,OAAO,SAAS,YAChB,SAAS,KAAK,KAAK,CAEnB,QAAO,IAAI,MAAM,OAAO;GACtB,YAAY,MAAM,SAAS;IACzB,IAAI,CAAC,SAAS,WAAW;AAKzB,QACE,OAAO,YAAY,YACnB,CAAC,MAAM,QAAQ,QAAQ,IACvB,YAAY,MACZ;AACA,eAAU;AACV,eAAU,QAAQ,UAAU;eACnB,YAAY,OACrB,WAAU;AAIZ,WAAO,IAAI,KAAK,SAAS,QAAQ;;GAGnC,MAAM,MAAM,QAAQ,QAAQ,IAAI,MAAM,IAAI;GAC3C,CAAC;AAIJ,SAAO;IAEV,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
//#region src/utils/isSameKeyPath.ts
|
|
4
|
+
const isSameKeyPath = (keyPath1, keyPath2) => keyPath1.every((element, index) => keyPath2[index] && keyPath2[index].key === element.key && keyPath2[index].type === element.type);
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.isSameKeyPath = isSameKeyPath;
|
|
2
8
|
//# sourceMappingURL=isSameKeyPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSameKeyPath.cjs","names":[],"sources":["../../../src/utils/isSameKeyPath.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/types/keyPath';\n\ntype KeyPathWithKey = KeyPath & { key: string };\n\nexport const isSameKeyPath = (keyPath1: KeyPath[], keyPath2: KeyPath[]) =>\n keyPath1.every(\n (element, index) =>\n keyPath2[index] &&\n (keyPath2[index] as KeyPathWithKey).key ===\n (element as KeyPathWithKey).key &&\n keyPath2[index].type === element.type\n );\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isSameKeyPath.cjs","names":[],"sources":["../../../src/utils/isSameKeyPath.ts"],"sourcesContent":["import type { KeyPath } from '@intlayer/types/keyPath';\n\ntype KeyPathWithKey = KeyPath & { key: string };\n\nexport const isSameKeyPath = (keyPath1: KeyPath[], keyPath2: KeyPath[]) =>\n keyPath1.every(\n (element, index) =>\n keyPath2[index] &&\n (keyPath2[index] as KeyPathWithKey).key ===\n (element as KeyPathWithKey).key &&\n keyPath2[index].type === element.type\n );\n"],"mappings":";;;AAIA,MAAa,iBAAiB,UAAqB,aACjD,SAAS,OACN,SAAS,UACR,SAAS,UACR,SAAS,OAA0B,QACjC,QAA2B,OAC9B,SAAS,OAAO,SAAS,QAAQ,KACpC"}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
//#region src/utils/isValidReactElement.ts
|
|
4
|
+
/**
|
|
5
|
+
* Verifies the object is a ReactElement.
|
|
6
|
+
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
7
|
+
* @param object
|
|
8
|
+
* @return True if `object` is a ReactElement.
|
|
9
|
+
* @final
|
|
10
|
+
*/
|
|
11
|
+
const isValidElement = (object) => typeof object === "object" && typeof object?.key !== "undefined" && typeof object?.props !== "undefined";
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.isValidElement = isValidElement;
|
|
2
15
|
//# sourceMappingURL=isValidReactElement.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isValidReactElement.cjs","names":[],"sources":["../../../src/utils/isValidReactElement.ts"],"sourcesContent":["/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param object\n * @return True if `object` is a ReactElement.\n * @final\n */\n\nexport const isValidElement = (object: any): boolean =>\n typeof object === 'object' &&\n typeof object?.key !== 'undefined' &&\n typeof object?.props !== 'undefined';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isValidReactElement.cjs","names":[],"sources":["../../../src/utils/isValidReactElement.ts"],"sourcesContent":["/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param object\n * @return True if `object` is a ReactElement.\n * @final\n */\n\nexport const isValidElement = (object: any): boolean =>\n typeof object === 'object' &&\n typeof object?.key !== 'undefined' &&\n typeof object?.props !== 'undefined';\n"],"mappings":";;;;;;;;;;AAQA,MAAa,kBAAkB,WAC7B,OAAO,WAAW,YAClB,OAAO,QAAQ,QAAQ,eACvB,OAAO,QAAQ,UAAU"}
|
|
@@ -1,2 +1,141 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_getStorageAttributes = require('../getStorageAttributes.cjs');
|
|
4
|
+
const require_utils_getCookie = require('./getCookie.cjs');
|
|
5
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
6
|
+
_intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
|
|
7
|
+
|
|
8
|
+
//#region src/utils/localeStorage.ts
|
|
9
|
+
const buildCookieString = (name, value, attributes) => {
|
|
10
|
+
const parts = [`${name}=${encodeURIComponent(value)}`];
|
|
11
|
+
if (attributes.path) parts.push(`Path=${attributes.path}`);
|
|
12
|
+
if (attributes.domain) parts.push(`Domain=${attributes.domain}`);
|
|
13
|
+
if (attributes.expires instanceof Date) parts.push(`Expires=${attributes.expires.toUTCString()}`);
|
|
14
|
+
if (attributes.secure) parts.push("Secure");
|
|
15
|
+
if (attributes.sameSite) parts.push(`SameSite=${attributes.sameSite}`);
|
|
16
|
+
return parts.join("; ");
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
20
|
+
* The function checks storage locations in order of priority as defined in the configuration.
|
|
21
|
+
*
|
|
22
|
+
* @returns The locale if found in any storage, or undefined if not found
|
|
23
|
+
*/
|
|
24
|
+
const getLocaleFromStorage = (options) => {
|
|
25
|
+
const { routing, internationalization } = _intlayer_config_built.default;
|
|
26
|
+
const { locales } = internationalization;
|
|
27
|
+
const { storage } = routing;
|
|
28
|
+
if (storage === false || options?.isCookieEnabled === false) return void 0;
|
|
29
|
+
const storageAttributes = require_getStorageAttributes.getStorageAttributes(storage);
|
|
30
|
+
const isValidLocale = (value) => {
|
|
31
|
+
if (!value) return false;
|
|
32
|
+
return locales.includes(value);
|
|
33
|
+
};
|
|
34
|
+
const readCookie = (name) => {
|
|
35
|
+
try {
|
|
36
|
+
const fromOption = options?.getCookie?.(name);
|
|
37
|
+
if (fromOption !== null && fromOption !== void 0) return fromOption;
|
|
38
|
+
} catch {}
|
|
39
|
+
return require_utils_getCookie.getCookie(name);
|
|
40
|
+
};
|
|
41
|
+
for (let i = 0; i < storageAttributes.cookies.length; i++) {
|
|
42
|
+
const { name } = storageAttributes.cookies[i];
|
|
43
|
+
const value = readCookie(name);
|
|
44
|
+
if (isValidLocale(value)) return value;
|
|
45
|
+
}
|
|
46
|
+
for (let i = 0; i < storageAttributes.localStorage.length; i++) {
|
|
47
|
+
const { name } = storageAttributes.localStorage[i];
|
|
48
|
+
try {
|
|
49
|
+
const value = options?.getLocaleStorage?.(name);
|
|
50
|
+
if (isValidLocale(value)) return value;
|
|
51
|
+
} catch {}
|
|
52
|
+
}
|
|
53
|
+
for (let i = 0; i < storageAttributes.sessionStorage.length; i++) {
|
|
54
|
+
const { name } = storageAttributes.sessionStorage[i];
|
|
55
|
+
try {
|
|
56
|
+
const value = options?.getSessionStorage?.(name);
|
|
57
|
+
if (isValidLocale(value)) return value;
|
|
58
|
+
} catch {}
|
|
59
|
+
}
|
|
60
|
+
for (let i = 0; i < storageAttributes.headers.length; i++) {
|
|
61
|
+
const { name } = storageAttributes.headers[i];
|
|
62
|
+
try {
|
|
63
|
+
const value = options?.getHeader?.(name);
|
|
64
|
+
if (isValidLocale(value)) return value;
|
|
65
|
+
} catch {}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Stores the locale in various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
70
|
+
* The function writes to all configured storage locations according to their attributes.
|
|
71
|
+
* Respects overwrite flags for localStorage and sessionStorage.
|
|
72
|
+
*
|
|
73
|
+
* @param locale - The locale to store
|
|
74
|
+
*/
|
|
75
|
+
const setLocaleInStorage = (locale, options) => {
|
|
76
|
+
if (_intlayer_config_built.default.routing.storage === false || options?.isCookieEnabled === false) return;
|
|
77
|
+
const storageAttributes = require_getStorageAttributes.getStorageAttributes(_intlayer_config_built.default.routing.storage);
|
|
78
|
+
for (let i = 0; i < storageAttributes.cookies.length; i++) {
|
|
79
|
+
const { name, attributes } = storageAttributes.cookies[i];
|
|
80
|
+
try {
|
|
81
|
+
if (options?.setCookieStore) options?.setCookieStore?.(name, locale, {
|
|
82
|
+
...attributes,
|
|
83
|
+
expires: attributes.expires instanceof Date ? attributes.expires.getTime() : attributes.expires
|
|
84
|
+
});
|
|
85
|
+
} catch {
|
|
86
|
+
try {
|
|
87
|
+
if (options?.setCookieString) {
|
|
88
|
+
const cookieString = buildCookieString(name, locale, attributes);
|
|
89
|
+
options?.setCookieString?.(name, cookieString);
|
|
90
|
+
}
|
|
91
|
+
} catch {}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (options?.setLocaleStorage) for (let i = 0; i < storageAttributes.localStorage.length; i++) {
|
|
95
|
+
const { name } = storageAttributes.localStorage[i];
|
|
96
|
+
try {
|
|
97
|
+
if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {
|
|
98
|
+
if (options?.getLocaleStorage?.(name)) continue;
|
|
99
|
+
}
|
|
100
|
+
options?.setLocaleStorage?.(name, locale);
|
|
101
|
+
} catch {}
|
|
102
|
+
}
|
|
103
|
+
if (options?.setSessionStorage) for (let i = 0; i < storageAttributes.sessionStorage.length; i++) {
|
|
104
|
+
const { name } = storageAttributes.sessionStorage[i];
|
|
105
|
+
try {
|
|
106
|
+
if (!(options?.overwrite ?? true) && options?.getSessionStorage) {
|
|
107
|
+
if (options?.getSessionStorage?.(name)) continue;
|
|
108
|
+
}
|
|
109
|
+
options?.setSessionStorage?.(name, locale);
|
|
110
|
+
} catch {}
|
|
111
|
+
}
|
|
112
|
+
if (options?.setHeader) for (let i = 0; i < storageAttributes.headers.length; i++) {
|
|
113
|
+
const { name } = storageAttributes.headers[i];
|
|
114
|
+
try {
|
|
115
|
+
options?.setHeader?.(name, locale);
|
|
116
|
+
} catch {}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Utility object to get and set the locale in the storage by considering the configuration
|
|
121
|
+
*
|
|
122
|
+
* @property getLocale - Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
123
|
+
* Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
124
|
+
* The function checks storage locations in order of priority as defined in the configuration.
|
|
125
|
+
*
|
|
126
|
+
* @property setLocale - Stores the locale in various storage mechanisms (cookies, localStorage, sessionStorage, headers).
|
|
127
|
+
* The function writes to all configured storage locations according to their attributes.
|
|
128
|
+
* Respects overwrite flags for localStorage and sessionStorage.
|
|
129
|
+
*
|
|
130
|
+
* @returns The locale if found in any storage, or undefined if not found
|
|
131
|
+
*/
|
|
132
|
+
const LocaleStorage = (options) => ({
|
|
133
|
+
getLocale: () => getLocaleFromStorage(options),
|
|
134
|
+
setLocale: (locale) => setLocaleInStorage(locale, options)
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
exports.LocaleStorage = LocaleStorage;
|
|
139
|
+
exports.getLocaleFromStorage = getLocaleFromStorage;
|
|
140
|
+
exports.setLocaleInStorage = setLocaleInStorage;
|
|
2
141
|
//# sourceMappingURL=localeStorage.cjs.map
|