@intlayer/core 8.1.2 → 8.1.3
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 +1 -29
- package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs +1 -212
- package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs +1 -94
- package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs +1 -45
- package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs +1 -33
- package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getMaskContent.cjs +1 -27
- package/dist/cjs/deepTransformPlugins/getMaskContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs +1 -82
- package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs +1 -87
- package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs +1 -60
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs +1 -122
- package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/index.cjs +1 -32
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +1 -106
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +1 -64
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +1 -18
- package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +1 -55
- package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +1 -26
- package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +1 -23
- package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs +1 -36
- package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/index.cjs +1 -27
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +1 -69
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs +1 -30
- package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +1 -48
- package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +1 -31
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +1 -39
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs +1 -38
- package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
- package/dist/cjs/formatters/compact.cjs +1 -25
- package/dist/cjs/formatters/compact.cjs.map +1 -1
- package/dist/cjs/formatters/currency.cjs +1 -29
- package/dist/cjs/formatters/currency.cjs.map +1 -1
- package/dist/cjs/formatters/date.cjs +1 -60
- package/dist/cjs/formatters/date.cjs.map +1 -1
- package/dist/cjs/formatters/index.cjs +1 -18
- package/dist/cjs/formatters/list.cjs +1 -30
- package/dist/cjs/formatters/list.cjs.map +1 -1
- package/dist/cjs/formatters/number.cjs +1 -18
- package/dist/cjs/formatters/number.cjs.map +1 -1
- package/dist/cjs/formatters/percentage.cjs +1 -25
- package/dist/cjs/formatters/percentage.cjs.map +1 -1
- package/dist/cjs/formatters/relativeTime.cjs +1 -33
- package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
- package/dist/cjs/formatters/units.cjs +1 -23
- package/dist/cjs/formatters/units.cjs.map +1 -1
- package/dist/cjs/getStorageAttributes.cjs +1 -134
- package/dist/cjs/getStorageAttributes.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -300
- package/dist/cjs/interpreter/getCondition.cjs +1 -27
- package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/deepTransform.cjs +1 -41
- package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/getContent.cjs +1 -34
- package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/index.cjs +1 -14
- package/dist/cjs/interpreter/getContent/plugins.cjs +1 -161
- package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
- package/dist/cjs/interpreter/getDictionary.cjs +1 -24
- package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
- package/dist/cjs/interpreter/getEnumeration.cjs +1 -72
- package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
- package/dist/cjs/interpreter/getGender.cjs +1 -38
- package/dist/cjs/interpreter/getGender.cjs.map +1 -1
- package/dist/cjs/interpreter/getHTML.cjs +1 -121
- package/dist/cjs/interpreter/getHTML.cjs.map +1 -1
- package/dist/cjs/interpreter/getInsertion.cjs +1 -22
- package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
- package/dist/cjs/interpreter/getIntlayer.cjs +1 -40
- package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
- package/dist/cjs/interpreter/getNesting.cjs +1 -36
- package/dist/cjs/interpreter/getNesting.cjs.map +1 -1
- package/dist/cjs/interpreter/getTranslation.cjs +1 -112
- package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
- package/dist/cjs/interpreter/index.cjs +1 -31
- package/dist/cjs/interpreter/splitAndJoinInsertion.cjs +1 -55
- package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
- package/dist/cjs/localization/getBrowserLocale.cjs +1 -143
- package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
- package/dist/cjs/localization/getHTMLTextDir.cjs +1 -64
- package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
- package/dist/cjs/localization/getLocale.cjs +1 -27
- package/dist/cjs/localization/getLocale.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleFromPath.cjs +1 -45
- package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleLang.cjs +1 -20
- package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleName.cjs +1 -10
- package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
- package/dist/cjs/localization/getLocalizedUrl.cjs +1 -82
- package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
- package/dist/cjs/localization/getMultilingualUrls.cjs +1 -63
- package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
- package/dist/cjs/localization/getPathWithoutLocale.cjs +1 -55
- package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
- package/dist/cjs/localization/getPrefix.cjs +1 -63
- package/dist/cjs/localization/getPrefix.cjs.map +1 -1
- package/dist/cjs/localization/index.cjs +1 -39
- package/dist/cjs/localization/localeDetector.cjs +1 -133
- package/dist/cjs/localization/localeDetector.cjs.map +1 -1
- package/dist/cjs/localization/localeMapper.cjs +1 -119
- package/dist/cjs/localization/localeMapper.cjs.map +1 -1
- package/dist/cjs/localization/localeResolver.cjs +1 -28
- package/dist/cjs/localization/localeResolver.cjs.map +1 -1
- package/dist/cjs/localization/rewriteUtils.cjs +1 -110
- package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
- package/dist/cjs/localization/validatePrefix.cjs +1 -54
- package/dist/cjs/localization/validatePrefix.cjs.map +1 -1
- package/dist/cjs/markdown/compiler.cjs +10 -810
- package/dist/cjs/markdown/compiler.cjs.map +1 -1
- package/dist/cjs/markdown/constants.cjs +1 -328
- package/dist/cjs/markdown/constants.cjs.map +1 -1
- package/dist/cjs/markdown/index.cjs +1 -120
- package/dist/cjs/markdown/parser.cjs +1 -66
- package/dist/cjs/markdown/parser.cjs.map +1 -1
- package/dist/cjs/markdown/renderer.cjs +1 -61
- package/dist/cjs/markdown/renderer.cjs.map +1 -1
- package/dist/cjs/markdown/utils.cjs +6 -391
- package/dist/cjs/markdown/utils.cjs.map +1 -1
- package/dist/cjs/messageFormat/ICU.cjs +1 -319
- package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
- package/dist/cjs/messageFormat/i18next.cjs +1 -330
- package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
- package/dist/cjs/messageFormat/index.cjs +1 -11
- package/dist/cjs/messageFormat/verify-icu-format.cjs +2 -64
- package/dist/cjs/messageFormat/verify-icu-format.cjs.map +1 -1
- package/dist/cjs/messageFormat/vue-i18n.cjs +1 -166
- package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
- package/dist/cjs/transpiler/condition/condition.cjs +1 -26
- package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
- package/dist/cjs/transpiler/condition/index.cjs +1 -4
- package/dist/cjs/transpiler/enumeration/enumeration.cjs +1 -28
- package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
- package/dist/cjs/transpiler/enumeration/index.cjs +1 -4
- package/dist/cjs/transpiler/file/file.cjs +1 -52
- package/dist/cjs/transpiler/file/file.cjs.map +1 -1
- package/dist/cjs/transpiler/file/fileBrowser.cjs +1 -25
- package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
- package/dist/cjs/transpiler/file/index.cjs +1 -5
- package/dist/cjs/transpiler/gender/gender.cjs +1 -26
- package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
- package/dist/cjs/transpiler/gender/index.cjs +1 -4
- package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +1 -44
- package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -1
- package/dist/cjs/transpiler/html/html.cjs +1 -37
- package/dist/cjs/transpiler/html/html.cjs.map +1 -1
- package/dist/cjs/transpiler/html/htmlTags.cjs +1 -116
- package/dist/cjs/transpiler/html/htmlTags.cjs.map +1 -1
- package/dist/cjs/transpiler/html/index.cjs +1 -6
- package/dist/cjs/transpiler/index.cjs +1 -24
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +1 -11
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
- package/dist/cjs/transpiler/insertion/index.cjs +1 -6
- package/dist/cjs/transpiler/insertion/insertion.cjs +1 -36
- package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +2 -23
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/index.cjs +1 -6
- package/dist/cjs/transpiler/markdown/markdown.cjs +1 -54
- package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
- package/dist/cjs/transpiler/nesting/index.cjs +1 -4
- package/dist/cjs/transpiler/nesting/nesting.cjs +1 -27
- package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
- package/dist/cjs/transpiler/translation/index.cjs +1 -4
- package/dist/cjs/transpiler/translation/translation.cjs +1 -29
- package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
- package/dist/cjs/utils/checkIsURLAbsolute.cjs +1 -7
- package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
- package/dist/cjs/utils/getCookie.cjs +1 -32
- package/dist/cjs/utils/getCookie.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +1 -0
- package/dist/cjs/utils/intl.cjs +1 -91
- package/dist/cjs/utils/intl.cjs.map +1 -1
- package/dist/cjs/utils/isSameKeyPath.cjs +1 -7
- package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
- package/dist/cjs/utils/isValidReactElement.cjs +1 -14
- package/dist/cjs/utils/isValidReactElement.cjs.map +1 -1
- package/dist/cjs/utils/localeStorage.cjs +1 -140
- package/dist/cjs/utils/localeStorage.cjs.map +1 -1
- package/dist/cjs/utils/parseYaml.cjs +16 -322
- package/dist/cjs/utils/parseYaml.cjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs +1 -207
- package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs +1 -89
- package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs +1 -42
- package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs +1 -31
- package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getMaskContent.mjs +1 -25
- package/dist/esm/deepTransformPlugins/getMaskContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs +1 -77
- package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs +1 -86
- package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs +1 -59
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getSplittedContent.mjs +1 -119
- package/dist/esm/deepTransformPlugins/getSplittedContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/index.mjs +1 -12
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs +1 -104
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +1 -62
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs +1 -16
- package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getDefaultNode.mjs +1 -53
- package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getEmptyNode.mjs +1 -24
- package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +1 -21
- package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getNodeType.mjs +1 -34
- package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/index.mjs +1 -14
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +1 -66
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs +1 -28
- package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/orderDictionaries.mjs +1 -45
- package/dist/esm/dictionaryManipulator/orderDictionaries.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +1 -29
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +1 -37
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs +1 -36
- package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs.map +1 -1
- package/dist/esm/formatters/compact.mjs +1 -22
- package/dist/esm/formatters/compact.mjs.map +1 -1
- package/dist/esm/formatters/currency.mjs +1 -26
- package/dist/esm/formatters/currency.mjs.map +1 -1
- package/dist/esm/formatters/date.mjs +1 -57
- package/dist/esm/formatters/date.mjs.map +1 -1
- package/dist/esm/formatters/index.mjs +1 -10
- package/dist/esm/formatters/list.mjs +1 -27
- package/dist/esm/formatters/list.mjs.map +1 -1
- package/dist/esm/formatters/number.mjs +1 -15
- package/dist/esm/formatters/number.mjs.map +1 -1
- package/dist/esm/formatters/percentage.mjs +1 -22
- package/dist/esm/formatters/percentage.mjs.map +1 -1
- package/dist/esm/formatters/relativeTime.mjs +1 -30
- package/dist/esm/formatters/relativeTime.mjs.map +1 -1
- package/dist/esm/formatters/units.mjs +1 -20
- package/dist/esm/formatters/units.mjs.map +1 -1
- package/dist/esm/getStorageAttributes.mjs +1 -132
- package/dist/esm/getStorageAttributes.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -82
- package/dist/esm/interpreter/getCondition.mjs +1 -25
- package/dist/esm/interpreter/getCondition.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/deepTransform.mjs +1 -39
- package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/getContent.mjs +1 -31
- package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -1
- package/dist/esm/interpreter/getContent/index.mjs +1 -5
- package/dist/esm/interpreter/getContent/plugins.mjs +1 -153
- package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
- package/dist/esm/interpreter/getDictionary.mjs +1 -23
- package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
- package/dist/esm/interpreter/getEnumeration.mjs +1 -69
- package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
- package/dist/esm/interpreter/getGender.mjs +1 -36
- package/dist/esm/interpreter/getGender.mjs.map +1 -1
- package/dist/esm/interpreter/getHTML.mjs +1 -119
- package/dist/esm/interpreter/getHTML.mjs.map +1 -1
- package/dist/esm/interpreter/getInsertion.mjs +1 -20
- package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
- package/dist/esm/interpreter/getIntlayer.mjs +1 -36
- package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
- package/dist/esm/interpreter/getNesting.mjs +1 -35
- package/dist/esm/interpreter/getNesting.mjs.map +1 -1
- package/dist/esm/interpreter/getTranslation.mjs +1 -110
- package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
- package/dist/esm/interpreter/index.mjs +1 -13
- package/dist/esm/interpreter/splitAndJoinInsertion.mjs +1 -53
- package/dist/esm/interpreter/splitAndJoinInsertion.mjs.map +1 -1
- package/dist/esm/localization/getBrowserLocale.mjs +1 -138
- package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
- package/dist/esm/localization/getHTMLTextDir.mjs +1 -62
- package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
- package/dist/esm/localization/getLocale.mjs +1 -24
- package/dist/esm/localization/getLocale.mjs.map +1 -1
- package/dist/esm/localization/getLocaleFromPath.mjs +1 -42
- package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
- package/dist/esm/localization/getLocaleLang.mjs +1 -18
- package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
- package/dist/esm/localization/getLocaleName.mjs +1 -9
- package/dist/esm/localization/getLocaleName.mjs.map +1 -1
- package/dist/esm/localization/getLocalizedUrl.mjs +1 -79
- package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
- package/dist/esm/localization/getMultilingualUrls.mjs +1 -60
- package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
- package/dist/esm/localization/getPathWithoutLocale.mjs +1 -52
- package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
- package/dist/esm/localization/getPrefix.mjs +1 -60
- package/dist/esm/localization/getPrefix.mjs.map +1 -1
- package/dist/esm/localization/index.mjs +1 -17
- package/dist/esm/localization/localeDetector.mjs +1 -131
- package/dist/esm/localization/localeDetector.mjs.map +1 -1
- package/dist/esm/localization/localeMapper.mjs +1 -114
- package/dist/esm/localization/localeMapper.mjs.map +1 -1
- package/dist/esm/localization/localeResolver.mjs +1 -25
- package/dist/esm/localization/localeResolver.mjs.map +1 -1
- package/dist/esm/localization/rewriteUtils.mjs +1 -104
- package/dist/esm/localization/rewriteUtils.mjs.map +1 -1
- package/dist/esm/localization/validatePrefix.mjs +1 -51
- package/dist/esm/localization/validatePrefix.mjs.map +1 -1
- package/dist/esm/markdown/compiler.mjs +10 -786
- package/dist/esm/markdown/compiler.mjs.map +1 -1
- package/dist/esm/markdown/constants.mjs +1 -247
- package/dist/esm/markdown/constants.mjs.map +1 -1
- package/dist/esm/markdown/index.mjs +1 -7
- package/dist/esm/markdown/parser.mjs +1 -65
- package/dist/esm/markdown/parser.mjs.map +1 -1
- package/dist/esm/markdown/renderer.mjs +1 -59
- package/dist/esm/markdown/renderer.mjs.map +1 -1
- package/dist/esm/markdown/utils.mjs +6 -361
- package/dist/esm/markdown/utils.mjs.map +1 -1
- package/dist/esm/messageFormat/ICU.mjs +1 -316
- package/dist/esm/messageFormat/ICU.mjs.map +1 -1
- package/dist/esm/messageFormat/i18next.mjs +1 -327
- package/dist/esm/messageFormat/i18next.mjs.map +1 -1
- package/dist/esm/messageFormat/index.mjs +1 -5
- package/dist/esm/messageFormat/verify-icu-format.mjs +2 -64
- package/dist/esm/messageFormat/verify-icu-format.mjs.map +1 -1
- package/dist/esm/messageFormat/vue-i18n.mjs +1 -163
- package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
- package/dist/esm/transpiler/condition/condition.mjs +1 -24
- package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
- package/dist/esm/transpiler/condition/index.mjs +1 -3
- package/dist/esm/transpiler/enumeration/enumeration.mjs +1 -26
- package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
- package/dist/esm/transpiler/enumeration/index.mjs +1 -3
- package/dist/esm/transpiler/file/file.mjs +1 -49
- package/dist/esm/transpiler/file/file.mjs.map +1 -1
- package/dist/esm/transpiler/file/fileBrowser.mjs +1 -24
- package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
- package/dist/esm/transpiler/file/index.mjs +1 -3
- package/dist/esm/transpiler/gender/gender.mjs +1 -24
- package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
- package/dist/esm/transpiler/gender/index.mjs +1 -3
- package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs +1 -43
- package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -1
- package/dist/esm/transpiler/html/html.mjs +1 -35
- package/dist/esm/transpiler/html/html.mjs.map +1 -1
- package/dist/esm/transpiler/html/htmlTags.mjs +1 -114
- package/dist/esm/transpiler/html/htmlTags.mjs.map +1 -1
- package/dist/esm/transpiler/html/index.mjs +1 -4
- package/dist/esm/transpiler/index.mjs +1 -13
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs +1 -9
- package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
- package/dist/esm/transpiler/insertion/index.mjs +1 -4
- package/dist/esm/transpiler/insertion/insertion.mjs +1 -34
- package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +2 -22
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/index.mjs +1 -4
- package/dist/esm/transpiler/markdown/markdown.mjs +1 -52
- package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
- package/dist/esm/transpiler/nesting/index.mjs +1 -3
- package/dist/esm/transpiler/nesting/nesting.mjs +1 -25
- package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
- package/dist/esm/transpiler/translation/index.mjs +1 -3
- package/dist/esm/transpiler/translation/translation.mjs +1 -27
- package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
- package/dist/esm/utils/checkIsURLAbsolute.mjs +1 -5
- package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
- package/dist/esm/utils/getCookie.mjs +1 -30
- package/dist/esm/utils/getCookie.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -0
- package/dist/esm/utils/intl.mjs +1 -86
- package/dist/esm/utils/intl.mjs.map +1 -1
- package/dist/esm/utils/isSameKeyPath.mjs +1 -5
- package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
- package/dist/esm/utils/isValidReactElement.mjs +1 -12
- package/dist/esm/utils/isValidReactElement.mjs.map +1 -1
- package/dist/esm/utils/localeStorage.mjs +1 -135
- package/dist/esm/utils/localeStorage.mjs.map +1 -1
- package/dist/esm/utils/parseYaml.mjs +16 -320
- package/dist/esm/utils/parseYaml.mjs.map +1 -1
- package/dist/types/formatters/index.d.ts +2 -1
- package/dist/types/index.d.ts +8 -2
- package/dist/types/interpreter/getContent/plugins.d.ts +4 -4
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts +2 -1
- package/dist/types/markdown/index.d.ts +4 -1
- package/dist/types/markdown/types.d.ts +1 -1
- package/dist/types/markdown/types.d.ts.map +1 -1
- package/dist/types/transpiler/translation/translation.d.ts +1 -1
- package/dist/types/utils/index.d.ts +8 -0
- package/package.json +65 -11
|
@@ -1,115 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* List of standard HTML tags to provide as default components.
|
|
4
|
-
* These allow users to use standard HTML tags in their html() content
|
|
5
|
-
* without having to pass them explicitly.
|
|
6
|
-
*
|
|
7
|
-
* Used by framework-specific plugins (react-intlayer, vue-intlayer, etc.)
|
|
8
|
-
* to create default HTML tag components.
|
|
9
|
-
*/
|
|
10
|
-
const HTML_TAGS = [
|
|
11
|
-
"html",
|
|
12
|
-
"head",
|
|
13
|
-
"body",
|
|
14
|
-
"main",
|
|
15
|
-
"header",
|
|
16
|
-
"footer",
|
|
17
|
-
"nav",
|
|
18
|
-
"aside",
|
|
19
|
-
"article",
|
|
20
|
-
"section",
|
|
21
|
-
"div",
|
|
22
|
-
"span",
|
|
23
|
-
"h1",
|
|
24
|
-
"h2",
|
|
25
|
-
"h3",
|
|
26
|
-
"h4",
|
|
27
|
-
"h5",
|
|
28
|
-
"h6",
|
|
29
|
-
"p",
|
|
30
|
-
"a",
|
|
31
|
-
"strong",
|
|
32
|
-
"b",
|
|
33
|
-
"em",
|
|
34
|
-
"i",
|
|
35
|
-
"u",
|
|
36
|
-
"s",
|
|
37
|
-
"del",
|
|
38
|
-
"ins",
|
|
39
|
-
"mark",
|
|
40
|
-
"small",
|
|
41
|
-
"sub",
|
|
42
|
-
"sup",
|
|
43
|
-
"code",
|
|
44
|
-
"pre",
|
|
45
|
-
"blockquote",
|
|
46
|
-
"q",
|
|
47
|
-
"cite",
|
|
48
|
-
"abbr",
|
|
49
|
-
"address",
|
|
50
|
-
"time",
|
|
51
|
-
"kbd",
|
|
52
|
-
"samp",
|
|
53
|
-
"var",
|
|
54
|
-
"ul",
|
|
55
|
-
"ol",
|
|
56
|
-
"li",
|
|
57
|
-
"dl",
|
|
58
|
-
"dt",
|
|
59
|
-
"dd",
|
|
60
|
-
"table",
|
|
61
|
-
"thead",
|
|
62
|
-
"tbody",
|
|
63
|
-
"tfoot",
|
|
64
|
-
"tr",
|
|
65
|
-
"th",
|
|
66
|
-
"td",
|
|
67
|
-
"caption",
|
|
68
|
-
"colgroup",
|
|
69
|
-
"col",
|
|
70
|
-
"form",
|
|
71
|
-
"input",
|
|
72
|
-
"textarea",
|
|
73
|
-
"button",
|
|
74
|
-
"select",
|
|
75
|
-
"option",
|
|
76
|
-
"optgroup",
|
|
77
|
-
"label",
|
|
78
|
-
"fieldset",
|
|
79
|
-
"legend",
|
|
80
|
-
"datalist",
|
|
81
|
-
"output",
|
|
82
|
-
"progress",
|
|
83
|
-
"meter",
|
|
84
|
-
"img",
|
|
85
|
-
"video",
|
|
86
|
-
"audio",
|
|
87
|
-
"source",
|
|
88
|
-
"track",
|
|
89
|
-
"picture",
|
|
90
|
-
"figure",
|
|
91
|
-
"figcaption",
|
|
92
|
-
"iframe",
|
|
93
|
-
"embed",
|
|
94
|
-
"object",
|
|
95
|
-
"canvas",
|
|
96
|
-
"svg",
|
|
97
|
-
"details",
|
|
98
|
-
"summary",
|
|
99
|
-
"dialog",
|
|
100
|
-
"br",
|
|
101
|
-
"hr",
|
|
102
|
-
"wbr",
|
|
103
|
-
"ruby",
|
|
104
|
-
"rt",
|
|
105
|
-
"rp",
|
|
106
|
-
"bdi",
|
|
107
|
-
"bdo",
|
|
108
|
-
"data",
|
|
109
|
-
"template",
|
|
110
|
-
"slot"
|
|
111
|
-
];
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
export { HTML_TAGS };
|
|
1
|
+
const e=`html.head.body.main.header.footer.nav.aside.article.section.div.span.h1.h2.h3.h4.h5.h6.p.a.strong.b.em.i.u.s.del.ins.mark.small.sub.sup.code.pre.blockquote.q.cite.abbr.address.time.kbd.samp.var.ul.ol.li.dl.dt.dd.table.thead.tbody.tfoot.tr.th.td.caption.colgroup.col.form.input.textarea.button.select.option.optgroup.label.fieldset.legend.datalist.output.progress.meter.img.video.audio.source.track.picture.figure.figcaption.iframe.embed.object.canvas.svg.details.summary.dialog.br.hr.wbr.ruby.rt.rp.bdi.bdo.data.template.slot`.split(`.`);export{e as HTML_TAGS};
|
|
115
2
|
//# sourceMappingURL=htmlTags.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlTags.mjs","names":[],"sources":["../../../../src/transpiler/html/htmlTags.ts"],"sourcesContent":["/**\n * List of standard HTML tags to provide as default components.\n * These allow users to use standard HTML tags in their html() content\n * without having to pass them explicitly.\n *\n * Used by framework-specific plugins (react-intlayer, vue-intlayer, etc.)\n * to create default HTML tag components.\n */\nexport const HTML_TAGS = [\n // Document structure\n 'html',\n 'head',\n 'body',\n 'main',\n 'header',\n 'footer',\n 'nav',\n 'aside',\n 'article',\n 'section',\n 'div',\n 'span',\n // Headings\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n // Text content\n 'p',\n 'a',\n 'strong',\n 'b',\n 'em',\n 'i',\n 'u',\n 's',\n 'del',\n 'ins',\n 'mark',\n 'small',\n 'sub',\n 'sup',\n 'code',\n 'pre',\n 'blockquote',\n 'q',\n 'cite',\n 'abbr',\n 'address',\n 'time',\n 'kbd',\n 'samp',\n 'var',\n // Lists\n 'ul',\n 'ol',\n 'li',\n 'dl',\n 'dt',\n 'dd',\n // Tables\n 'table',\n 'thead',\n 'tbody',\n 'tfoot',\n 'tr',\n 'th',\n 'td',\n 'caption',\n 'colgroup',\n 'col',\n // Forms\n 'form',\n 'input',\n 'textarea',\n 'button',\n 'select',\n 'option',\n 'optgroup',\n 'label',\n 'fieldset',\n 'legend',\n 'datalist',\n 'output',\n 'progress',\n 'meter',\n // Media\n 'img',\n 'video',\n 'audio',\n 'source',\n 'track',\n 'picture',\n 'figure',\n 'figcaption',\n 'iframe',\n 'embed',\n 'object',\n 'canvas',\n 'svg',\n // Interactive\n 'details',\n 'summary',\n 'dialog',\n // Other\n 'br',\n 'hr',\n 'wbr',\n 'ruby',\n 'rt',\n 'rp',\n 'bdi',\n 'bdo',\n 'data',\n 'template',\n 'slot',\n] as const;\n\nexport type HTMLTagsType = {\n // Document structure\n html: HTMLHtmlElement;\n head: HTMLHeadElement;\n body: HTMLBodyElement;\n main: HTMLElement;\n header: HTMLElement;\n footer: HTMLElement;\n nav: HTMLElement;\n aside: HTMLElement;\n article: HTMLElement;\n section: HTMLElement;\n div: HTMLDivElement;\n span: HTMLSpanElement;\n\n // Headings\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n\n // Text content\n p: HTMLParagraphElement;\n a: HTMLAnchorElement;\n strong: HTMLElement;\n b: HTMLElement;\n em: HTMLElement;\n i: HTMLElement;\n u: HTMLElement;\n s: HTMLElement;\n del: HTMLModElement;\n ins: HTMLModElement;\n mark: HTMLElement;\n small: HTMLElement;\n sub: HTMLElement;\n sup: HTMLElement;\n code: HTMLElement;\n pre: HTMLPreElement;\n blockquote: HTMLQuoteElement;\n q: HTMLQuoteElement;\n cite: HTMLElement;\n abbr: HTMLElement;\n address: HTMLElement;\n time: HTMLTimeElement;\n kbd: HTMLElement;\n samp: HTMLElement;\n var: HTMLElement;\n\n // Lists\n ul: HTMLUListElement;\n ol: HTMLOListElement;\n li: HTMLLIElement;\n dl: HTMLDListElement;\n dt: HTMLElement;\n dd: HTMLElement;\n\n // Tables\n table: HTMLTableElement;\n thead: HTMLTableSectionElement;\n tbody: HTMLTableSectionElement;\n tfoot: HTMLTableSectionElement;\n tr: HTMLTableRowElement;\n th: HTMLTableCellElement;\n td: HTMLTableCellElement;\n caption: HTMLTableCaptionElement;\n colgroup: HTMLTableColElement;\n col: HTMLTableColElement;\n\n // Forms\n form: HTMLFormElement;\n input: HTMLInputElement;\n textarea: HTMLTextAreaElement;\n button: HTMLButtonElement;\n select: HTMLSelectElement;\n option: HTMLOptionElement;\n optgroup: HTMLOptGroupElement;\n label: HTMLLabelElement;\n fieldset: HTMLFieldSetElement;\n legend: HTMLLegendElement;\n datalist: HTMLDataListElement;\n output: HTMLOutputElement;\n progress: HTMLProgressElement;\n meter: HTMLMeterElement;\n\n // Media\n img: HTMLImageElement;\n video: HTMLVideoElement;\n audio: HTMLAudioElement;\n source: HTMLSourceElement;\n track: HTMLTrackElement;\n picture: HTMLPictureElement;\n figure: HTMLElement;\n figcaption: HTMLElement;\n iframe: HTMLIFrameElement;\n embed: HTMLEmbedElement;\n object: HTMLObjectElement;\n canvas: HTMLCanvasElement;\n svg: SVGSVGElement;\n\n // Interactive\n details: HTMLDetailsElement;\n summary: HTMLElement;\n dialog: HTMLDialogElement;\n\n // Other\n br: HTMLBRElement;\n hr: HTMLHRElement;\n wbr: HTMLElement;\n ruby: HTMLElement;\n rt: HTMLElement;\n rp: HTMLElement;\n bdi: HTMLElement;\n bdo: HTMLElement;\n data: HTMLDataElement;\n template: HTMLTemplateElement;\n slot: HTMLSlotElement;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"htmlTags.mjs","names":[],"sources":["../../../../src/transpiler/html/htmlTags.ts"],"sourcesContent":["/**\n * List of standard HTML tags to provide as default components.\n * These allow users to use standard HTML tags in their html() content\n * without having to pass them explicitly.\n *\n * Used by framework-specific plugins (react-intlayer, vue-intlayer, etc.)\n * to create default HTML tag components.\n */\nexport const HTML_TAGS = [\n // Document structure\n 'html',\n 'head',\n 'body',\n 'main',\n 'header',\n 'footer',\n 'nav',\n 'aside',\n 'article',\n 'section',\n 'div',\n 'span',\n // Headings\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n // Text content\n 'p',\n 'a',\n 'strong',\n 'b',\n 'em',\n 'i',\n 'u',\n 's',\n 'del',\n 'ins',\n 'mark',\n 'small',\n 'sub',\n 'sup',\n 'code',\n 'pre',\n 'blockquote',\n 'q',\n 'cite',\n 'abbr',\n 'address',\n 'time',\n 'kbd',\n 'samp',\n 'var',\n // Lists\n 'ul',\n 'ol',\n 'li',\n 'dl',\n 'dt',\n 'dd',\n // Tables\n 'table',\n 'thead',\n 'tbody',\n 'tfoot',\n 'tr',\n 'th',\n 'td',\n 'caption',\n 'colgroup',\n 'col',\n // Forms\n 'form',\n 'input',\n 'textarea',\n 'button',\n 'select',\n 'option',\n 'optgroup',\n 'label',\n 'fieldset',\n 'legend',\n 'datalist',\n 'output',\n 'progress',\n 'meter',\n // Media\n 'img',\n 'video',\n 'audio',\n 'source',\n 'track',\n 'picture',\n 'figure',\n 'figcaption',\n 'iframe',\n 'embed',\n 'object',\n 'canvas',\n 'svg',\n // Interactive\n 'details',\n 'summary',\n 'dialog',\n // Other\n 'br',\n 'hr',\n 'wbr',\n 'ruby',\n 'rt',\n 'rp',\n 'bdi',\n 'bdo',\n 'data',\n 'template',\n 'slot',\n] as const;\n\nexport type HTMLTagsType = {\n // Document structure\n html: HTMLHtmlElement;\n head: HTMLHeadElement;\n body: HTMLBodyElement;\n main: HTMLElement;\n header: HTMLElement;\n footer: HTMLElement;\n nav: HTMLElement;\n aside: HTMLElement;\n article: HTMLElement;\n section: HTMLElement;\n div: HTMLDivElement;\n span: HTMLSpanElement;\n\n // Headings\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n\n // Text content\n p: HTMLParagraphElement;\n a: HTMLAnchorElement;\n strong: HTMLElement;\n b: HTMLElement;\n em: HTMLElement;\n i: HTMLElement;\n u: HTMLElement;\n s: HTMLElement;\n del: HTMLModElement;\n ins: HTMLModElement;\n mark: HTMLElement;\n small: HTMLElement;\n sub: HTMLElement;\n sup: HTMLElement;\n code: HTMLElement;\n pre: HTMLPreElement;\n blockquote: HTMLQuoteElement;\n q: HTMLQuoteElement;\n cite: HTMLElement;\n abbr: HTMLElement;\n address: HTMLElement;\n time: HTMLTimeElement;\n kbd: HTMLElement;\n samp: HTMLElement;\n var: HTMLElement;\n\n // Lists\n ul: HTMLUListElement;\n ol: HTMLOListElement;\n li: HTMLLIElement;\n dl: HTMLDListElement;\n dt: HTMLElement;\n dd: HTMLElement;\n\n // Tables\n table: HTMLTableElement;\n thead: HTMLTableSectionElement;\n tbody: HTMLTableSectionElement;\n tfoot: HTMLTableSectionElement;\n tr: HTMLTableRowElement;\n th: HTMLTableCellElement;\n td: HTMLTableCellElement;\n caption: HTMLTableCaptionElement;\n colgroup: HTMLTableColElement;\n col: HTMLTableColElement;\n\n // Forms\n form: HTMLFormElement;\n input: HTMLInputElement;\n textarea: HTMLTextAreaElement;\n button: HTMLButtonElement;\n select: HTMLSelectElement;\n option: HTMLOptionElement;\n optgroup: HTMLOptGroupElement;\n label: HTMLLabelElement;\n fieldset: HTMLFieldSetElement;\n legend: HTMLLegendElement;\n datalist: HTMLDataListElement;\n output: HTMLOutputElement;\n progress: HTMLProgressElement;\n meter: HTMLMeterElement;\n\n // Media\n img: HTMLImageElement;\n video: HTMLVideoElement;\n audio: HTMLAudioElement;\n source: HTMLSourceElement;\n track: HTMLTrackElement;\n picture: HTMLPictureElement;\n figure: HTMLElement;\n figcaption: HTMLElement;\n iframe: HTMLIFrameElement;\n embed: HTMLEmbedElement;\n object: HTMLObjectElement;\n canvas: HTMLCanvasElement;\n svg: SVGSVGElement;\n\n // Interactive\n details: HTMLDetailsElement;\n summary: HTMLElement;\n dialog: HTMLDialogElement;\n\n // Other\n br: HTMLBRElement;\n hr: HTMLHRElement;\n wbr: HTMLElement;\n ruby: HTMLElement;\n rt: HTMLElement;\n rp: HTMLElement;\n bdi: HTMLElement;\n bdo: HTMLElement;\n data: HTMLDataElement;\n template: HTMLTemplateElement;\n slot: HTMLSlotElement;\n};\n"],"mappings":"AAQA,MAAa,EAAY,0hBA8GxB"}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { enu as enumeration } from "./enumeration/enumeration.mjs";
|
|
3
|
-
import { gender } from "./gender/gender.mjs";
|
|
4
|
-
import { html } from "./html/html.mjs";
|
|
5
|
-
import { HTML_TAGS } from "./html/htmlTags.mjs";
|
|
6
|
-
import { getInsertionValues } from "./insertion/getInsertionValues.mjs";
|
|
7
|
-
import { insert as insertion } from "./insertion/insertion.mjs";
|
|
8
|
-
import { getMarkdownMetadata } from "./markdown/getMarkdownMetadata.mjs";
|
|
9
|
-
import { md as markdown } from "./markdown/markdown.mjs";
|
|
10
|
-
import { nest as nesting } from "./nesting/nesting.mjs";
|
|
11
|
-
import { t as translation } from "./translation/translation.mjs";
|
|
12
|
-
|
|
13
|
-
export { HTML_TAGS, condition as cond, enumeration as enu, gender, getInsertionValues, getMarkdownMetadata, html, insertion as insert, markdown as md, nesting as nest, translation as t };
|
|
1
|
+
import{cond as e}from"./condition/condition.mjs";import{enu as t}from"./enumeration/enumeration.mjs";import{gender as n}from"./gender/gender.mjs";import{html as r}from"./html/html.mjs";import{HTML_TAGS as i}from"./html/htmlTags.mjs";import{getInsertionValues as a}from"./insertion/getInsertionValues.mjs";import{insert as o}from"./insertion/insertion.mjs";import{getMarkdownMetadata as s}from"./markdown/getMarkdownMetadata.mjs";import{md as c}from"./markdown/markdown.mjs";import{nest as l}from"./nesting/nesting.mjs";import{t as u}from"./translation/translation.mjs";export{i as HTML_TAGS,e as cond,t as enu,n as gender,a as getInsertionValues,s as getMarkdownMetadata,r as html,o as insert,c as md,l as nest,u as t};
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const getInsertionValues = (content) => {
|
|
3
|
-
const matches = [...content.matchAll(/{{\s*(.*?)\s*}}/g)];
|
|
4
|
-
if (matches.length === 0) return [];
|
|
5
|
-
return [...new Set(matches.map((match) => match[1].trim()))].filter(Boolean);
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
export { getInsertionValues };
|
|
1
|
+
const e=e=>{let t=[...e.matchAll(/{{\s*(.*?)\s*}}/g)];return t.length===0?[]:[...new Set(t.map(e=>e[1].trim()))].filter(Boolean)};export{e as getInsertionValues};
|
|
10
2
|
//# sourceMappingURL=getInsertionValues.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInsertionValues.mjs","names":[],"sources":["../../../../src/transpiler/insertion/getInsertionValues.ts"],"sourcesContent":["export const getInsertionValues = (content: string): string[] => {\n // Regular expression to match {{field}} patterns\n const regex = /{{\\s*(.*?)\\s*}}/g;\n const matches = [...content.matchAll(regex)];\n\n // If no matches are found, return undefined\n if (matches.length === 0) return [];\n\n // Extract field names from matches and return as an object with the field names\n return [...new Set(matches.map((match) => match[1].trim()))].filter(Boolean);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getInsertionValues.mjs","names":[],"sources":["../../../../src/transpiler/insertion/getInsertionValues.ts"],"sourcesContent":["export const getInsertionValues = (content: string): string[] => {\n // Regular expression to match {{field}} patterns\n const regex = /{{\\s*(.*?)\\s*}}/g;\n const matches = [...content.matchAll(regex)];\n\n // If no matches are found, return undefined\n if (matches.length === 0) return [];\n\n // Extract field names from matches and return as an object with the field names\n return [...new Set(matches.map((match) => match[1].trim()))].filter(Boolean);\n};\n"],"mappings":"AAAA,MAAa,EAAsB,GAA8B,CAG/D,IAAM,EAAU,CAAC,GAAG,EAAQ,SADd,mBAC6B,CAAC,CAM5C,OAHI,EAAQ,SAAW,EAAU,EAAE,CAG5B,CAAC,GAAG,IAAI,IAAI,EAAQ,IAAK,GAAU,EAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,QAAQ"}
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { insert as insertion } from "./insertion.mjs";
|
|
3
|
-
|
|
4
|
-
export { getInsertionValues, insertion as insert };
|
|
1
|
+
import{getInsertionValues as e}from"./getInsertionValues.mjs";import{insert as t}from"./insertion.mjs";export{e as getInsertionValues,t as insert};
|
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { NodeType, formatNodeType } from "@intlayer/types";
|
|
3
|
-
|
|
4
|
-
//#region src/transpiler/insertion/insertion.ts
|
|
5
|
-
/**
|
|
6
|
-
* Function intended to be used to build intlayer dictionaries.
|
|
7
|
-
*
|
|
8
|
-
* Allow to identify insertions inside a content.
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* insertion('Hi, my name is {{name}} and I am {{age}} years old.')
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
const insertion = (content) => {
|
|
18
|
-
const getInsertions = () => {
|
|
19
|
-
if (typeof content === "string") return getInsertionValues(content);
|
|
20
|
-
let stringContent;
|
|
21
|
-
if (typeof content === "function") stringContent = content();
|
|
22
|
-
else if (typeof content.then === "function") stringContent = async () => getInsertionValues(await content);
|
|
23
|
-
if (typeof stringContent === "string") return getInsertionValues(stringContent);
|
|
24
|
-
try {
|
|
25
|
-
return getInsertionValues(JSON.stringify(content));
|
|
26
|
-
} catch (_e) {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
return formatNodeType(NodeType.Insertion, content, { fields: getInsertions() });
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
//#endregion
|
|
34
|
-
export { insertion as insert };
|
|
1
|
+
import{getInsertionValues as e}from"./getInsertionValues.mjs";import{NodeType as t,formatNodeType as n}from"@intlayer/types";const r=r=>n(t.Insertion,r,{fields:(()=>{if(typeof r==`string`)return e(r);let t;if(typeof r==`function`?t=r():typeof r.then==`function`&&(t=async()=>e(await r)),typeof t==`string`)return e(t);try{return e(JSON.stringify(r))}catch{return[]}})()});export{r as insert};
|
|
35
2
|
//# sourceMappingURL=insertion.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertion.mjs","names":[],"sources":["../../../../src/transpiler/insertion/insertion.ts"],"sourcesContent":["import { formatNodeType, NodeType, type TypedNodeModel } from '@intlayer/types';\nimport { getInsertionValues } from './getInsertionValues';\n\nexport type InsertionContentConstructor<\n Content = unknown,\n T extends Record<string, any> = {},\n> = TypedNodeModel<NodeType.Insertion, Content, T>;\n\nexport type InsertionContent<Content = unknown> = InsertionContentConstructor<\n Content,\n {\n fields: string[];\n }\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to identify insertions inside a content.\n *\n * Usage:\n *\n * ```ts\n * insertion('Hi, my name is {{name}} and I am {{age}} years old.')\n * ```\n *\n */\nconst insertion = <Content = unknown>(\n content: Content\n): InsertionContent<Content> => {\n const getInsertions = () => {\n if (typeof content === 'string') {\n return getInsertionValues(content);\n }\n\n let stringContent: any;\n\n if (typeof content === 'function') {\n stringContent = content();\n } else if (typeof (content as Promise<string>).then === 'function') {\n stringContent = async () =>\n getInsertionValues(await (content as Promise<string>));\n }\n\n if (typeof stringContent === 'string') {\n return getInsertionValues(stringContent);\n }\n\n try {\n return getInsertionValues(JSON.stringify(content));\n } catch (_e) {\n return [];\n }\n };\n\n return formatNodeType(NodeType.Insertion, content, {\n fields: getInsertions(),\n });\n};\n\nexport { insertion as insert };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"insertion.mjs","names":[],"sources":["../../../../src/transpiler/insertion/insertion.ts"],"sourcesContent":["import { formatNodeType, NodeType, type TypedNodeModel } from '@intlayer/types';\nimport { getInsertionValues } from './getInsertionValues';\n\nexport type InsertionContentConstructor<\n Content = unknown,\n T extends Record<string, any> = {},\n> = TypedNodeModel<NodeType.Insertion, Content, T>;\n\nexport type InsertionContent<Content = unknown> = InsertionContentConstructor<\n Content,\n {\n fields: string[];\n }\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to identify insertions inside a content.\n *\n * Usage:\n *\n * ```ts\n * insertion('Hi, my name is {{name}} and I am {{age}} years old.')\n * ```\n *\n */\nconst insertion = <Content = unknown>(\n content: Content\n): InsertionContent<Content> => {\n const getInsertions = () => {\n if (typeof content === 'string') {\n return getInsertionValues(content);\n }\n\n let stringContent: any;\n\n if (typeof content === 'function') {\n stringContent = content();\n } else if (typeof (content as Promise<string>).then === 'function') {\n stringContent = async () =>\n getInsertionValues(await (content as Promise<string>));\n }\n\n if (typeof stringContent === 'string') {\n return getInsertionValues(stringContent);\n }\n\n try {\n return getInsertionValues(JSON.stringify(content));\n } catch (_e) {\n return [];\n }\n };\n\n return formatNodeType(NodeType.Insertion, content, {\n fields: getInsertions(),\n });\n};\n\nexport { insertion as insert };\n"],"mappings":"6HA2BA,MAAM,EACJ,GA2BO,EAAe,EAAS,UAAW,EAAS,CACjD,YA1B0B,CAC1B,GAAI,OAAO,GAAY,SACrB,OAAO,EAAmB,EAAQ,CAGpC,IAAI,EASJ,GAPI,OAAO,GAAY,WACrB,EAAgB,GAAS,CAChB,OAAQ,EAA4B,MAAS,aACtD,EAAgB,SACd,EAAmB,MAAO,EAA4B,EAGtD,OAAO,GAAkB,SAC3B,OAAO,EAAmB,EAAc,CAG1C,GAAI,CACF,OAAO,EAAmB,KAAK,UAAU,EAAQ,CAAC,MACvC,CACX,MAAO,EAAE,KAKY,CACxB,CAAC"}
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/transpiler/markdown/getMarkdownMetadata.ts
|
|
4
|
-
const getMarkdownMetadata = (markdown) => {
|
|
5
|
-
try {
|
|
6
|
-
const lines = markdown.split(/\r?\n/);
|
|
7
|
-
const firstNonEmptyLine = lines.find((line) => line.trim() !== "");
|
|
8
|
-
if (!firstNonEmptyLine || firstNonEmptyLine.trim() !== "---") return {};
|
|
9
|
-
let metadataEndIndex = -1;
|
|
10
|
-
for (let i = 1; i < lines.length; i++) if (lines[i].trim() === "---") {
|
|
11
|
-
metadataEndIndex = i;
|
|
12
|
-
break;
|
|
13
|
-
}
|
|
14
|
-
if (metadataEndIndex === -1) return {};
|
|
15
|
-
return parseYaml(lines.slice(1, metadataEndIndex).join("\n")) ?? {};
|
|
16
|
-
} catch (_e) {
|
|
17
|
-
return {};
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { getMarkdownMetadata };
|
|
1
|
+
import{parseYaml as e}from"../../utils/parseYaml.mjs";const t=t=>{try{let n=t.split(/\r?\n/),r=n.find(e=>e.trim()!==``);if(!r||r.trim()!==`---`)return{};let i=-1;for(let e=1;e<n.length;e++)if(n[e].trim()===`---`){i=e;break}return i===-1?{}:e(n.slice(1,i).join(`
|
|
2
|
+
`))??{}}catch{return{}}};export{t as getMarkdownMetadata};
|
|
23
3
|
//# sourceMappingURL=getMarkdownMetadata.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMarkdownMetadata.mjs","names":[],"sources":["../../../../src/transpiler/markdown/getMarkdownMetadata.ts"],"sourcesContent":["import { parseYaml } from '../../utils/parseYaml';\n\nexport const getMarkdownMetadata = <T extends Record<string, any>>(\n markdown: string\n): T => {\n try {\n const lines = markdown.split(/\\r?\\n/);\n\n // Check if the very first non-empty line is the metadata start delimiter.\n const firstNonEmptyLine = lines.find((line) => line.trim() !== '');\n\n if (!firstNonEmptyLine || firstNonEmptyLine.trim() !== '---') {\n const result: T = {} as T;\n return result;\n }\n\n // Find the end of the metadata block\n let metadataEndIndex = -1;\n for (let i = 1; i < lines.length; i++) {\n if (lines[i].trim() === '---') {\n metadataEndIndex = i;\n break;\n }\n }\n\n if (metadataEndIndex === -1) {\n // No closing delimiter found\n const result: T = {} as T;\n return result;\n }\n\n // Extract the metadata content between the delimiters\n const metadataLines = lines.slice(1, metadataEndIndex);\n const metadataContent = metadataLines.join('\\n');\n\n // Use the improved parseYaml function to parse the entire metadata block\n const metadata = parseYaml<T>(metadataContent);\n\n return metadata ?? ({} as T);\n } catch (_e) {\n const result: T = {} as T;\n return result;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getMarkdownMetadata.mjs","names":[],"sources":["../../../../src/transpiler/markdown/getMarkdownMetadata.ts"],"sourcesContent":["import { parseYaml } from '../../utils/parseYaml';\n\nexport const getMarkdownMetadata = <T extends Record<string, any>>(\n markdown: string\n): T => {\n try {\n const lines = markdown.split(/\\r?\\n/);\n\n // Check if the very first non-empty line is the metadata start delimiter.\n const firstNonEmptyLine = lines.find((line) => line.trim() !== '');\n\n if (!firstNonEmptyLine || firstNonEmptyLine.trim() !== '---') {\n const result: T = {} as T;\n return result;\n }\n\n // Find the end of the metadata block\n let metadataEndIndex = -1;\n for (let i = 1; i < lines.length; i++) {\n if (lines[i].trim() === '---') {\n metadataEndIndex = i;\n break;\n }\n }\n\n if (metadataEndIndex === -1) {\n // No closing delimiter found\n const result: T = {} as T;\n return result;\n }\n\n // Extract the metadata content between the delimiters\n const metadataLines = lines.slice(1, metadataEndIndex);\n const metadataContent = metadataLines.join('\\n');\n\n // Use the improved parseYaml function to parse the entire metadata block\n const metadata = parseYaml<T>(metadataContent);\n\n return metadata ?? ({} as T);\n } catch (_e) {\n const result: T = {} as T;\n return result;\n }\n};\n"],"mappings":"sDAEA,MAAa,EACX,GACM,CACN,GAAI,CACF,IAAM,EAAQ,EAAS,MAAM,QAAQ,CAG/B,EAAoB,EAAM,KAAM,GAAS,EAAK,MAAM,GAAK,GAAG,CAElE,GAAI,CAAC,GAAqB,EAAkB,MAAM,GAAK,MAErD,MADkB,EAAE,CAKtB,IAAI,EAAmB,GACvB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAChC,GAAI,EAAM,GAAG,MAAM,GAAK,MAAO,CAC7B,EAAmB,EACnB,MAiBJ,OAbI,IAAqB,GAEL,EAAE,CASL,EAJK,EAAM,MAAM,EAAG,EAAiB,CAChB,KAAK;EAAK,CAGF,EAE1B,EAAE,MACX,CAEX,MADkB,EAAE"}
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { md as markdown } from "./markdown.mjs";
|
|
3
|
-
|
|
4
|
-
export { getMarkdownMetadata, markdown as md };
|
|
1
|
+
import{getMarkdownMetadata as e}from"./getMarkdownMetadata.mjs";import{md as t}from"./markdown.mjs";export{e as getMarkdownMetadata,t as md};
|
|
@@ -1,53 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getHTMLCustomComponents } from "../html/getHTMLCustomComponents.mjs";
|
|
3
|
-
import { getMarkdownMetadata } from "./getMarkdownMetadata.mjs";
|
|
4
|
-
import { NodeType, formatNodeType } from "@intlayer/types";
|
|
5
|
-
|
|
6
|
-
//#region src/transpiler/markdown/markdown.ts
|
|
7
|
-
const awaitContent = async (content) => {
|
|
8
|
-
if (typeof content === "string" || typeof content === "object") return content;
|
|
9
|
-
if (typeof content === "function") return content();
|
|
10
|
-
if (typeof content.then === "function") return await content;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Function intended to be used to build intlayer dictionaries.
|
|
14
|
-
*
|
|
15
|
-
* Allow to pick a content based on a quantity.
|
|
16
|
-
*
|
|
17
|
-
* Usage:
|
|
18
|
-
*
|
|
19
|
-
* ```ts
|
|
20
|
-
* markdown('## Hello world!');
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
const markdown = (content, components) => {
|
|
25
|
-
const metadata = async () => {
|
|
26
|
-
const flatContent = getContent(await awaitContent(content), {
|
|
27
|
-
dictionaryKey: "",
|
|
28
|
-
keyPath: []
|
|
29
|
-
});
|
|
30
|
-
if (typeof flatContent === "string") return getMarkdownMetadata(flatContent);
|
|
31
|
-
};
|
|
32
|
-
const getComponents = () => {
|
|
33
|
-
if (components) return components;
|
|
34
|
-
if (typeof content === "string") return getHTMLCustomComponents(content);
|
|
35
|
-
let stringContent;
|
|
36
|
-
if (typeof content === "function") stringContent = content();
|
|
37
|
-
else if (typeof content.then === "function") stringContent = async () => getHTMLCustomComponents(await content);
|
|
38
|
-
if (typeof stringContent === "string") return getHTMLCustomComponents(stringContent);
|
|
39
|
-
try {
|
|
40
|
-
return getHTMLCustomComponents(JSON.stringify(content));
|
|
41
|
-
} catch (_e) {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
return formatNodeType(NodeType.Markdown, content, {
|
|
46
|
-
metadata,
|
|
47
|
-
tags: getComponents()
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
export { markdown as md };
|
|
1
|
+
import{getContent as e}from"../../interpreter/getContent/getContent.mjs";import{getHTMLCustomComponents as t}from"../html/getHTMLCustomComponents.mjs";import{getMarkdownMetadata as n}from"./getMarkdownMetadata.mjs";import{NodeType as r,formatNodeType as i}from"@intlayer/types";const a=async e=>{if(typeof e==`string`||typeof e==`object`)return e;if(typeof e==`function`)return e();if(typeof e.then==`function`)return await e},o=(o,s)=>i(r.Markdown,o,{metadata:async()=>{let t=e(await a(o),{dictionaryKey:``,keyPath:[]});if(typeof t==`string`)return n(t)},tags:(()=>{if(s)return s;if(typeof o==`string`)return t(o);let e;if(typeof o==`function`?e=o():typeof o.then==`function`&&(e=async()=>t(await o)),typeof e==`string`)return t(e);try{return t(JSON.stringify(o))}catch{return[]}})()});export{o as md};
|
|
53
2
|
//# sourceMappingURL=markdown.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.mjs","names":[],"sources":["../../../../src/transpiler/markdown/markdown.ts"],"sourcesContent":["import { formatNodeType, NodeType, type TypedNodeModel } from '@intlayer/types';\nimport { getContent } from '../../interpreter/getContent/getContent';\nimport { getHTMLCustomComponents } from '../html/getHTMLCustomComponents';\nimport { getMarkdownMetadata } from './getMarkdownMetadata';\n\ntype PropsType = 'number' | 'string' | 'node';\n\ntype ComponentName = string;\n\nexport type MarkdownContentConstructor<\n T extends Record<string, any> = {},\n Content = unknown,\n> = TypedNodeModel<NodeType.Markdown, Content, T>;\n\nexport type MarkdownContent<\n Content = unknown,\n Components extends Record<ComponentName, PropsType> = Record<\n ComponentName,\n PropsType\n >,\n> = MarkdownContentConstructor<\n {\n metadata?: Record<string, any>;\n tags?: string[] | Components;\n },\n Content\n>;\n\nconst awaitContent = async (content: any) => {\n if (typeof content === 'string' || typeof content === 'object') {\n return content as any;\n }\n\n if (typeof content === 'function') {\n return content();\n }\n if (typeof content.then === 'function') {\n return await content;\n }\n};\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * markdown('## Hello world!');\n * ```\n *\n */\nconst markdown = <\n Components extends Record<string, any> = Record<string, any>,\n Content = unknown,\n>(\n content: Content,\n components?: Components\n): MarkdownContent<Content, Components> => {\n const metadata = async () => {\n const awaitedContent = await awaitContent(content);\n\n const flatContent = getContent(awaitedContent, {\n dictionaryKey: '',\n keyPath: [],\n });\n\n if (typeof flatContent === 'string') {\n return getMarkdownMetadata(flatContent);\n }\n };\n\n const getComponents = () => {\n if (components) {\n return components;\n }\n\n if (typeof content === 'string') {\n return getHTMLCustomComponents(content);\n }\n\n let stringContent: any;\n\n if (typeof content === 'function') {\n stringContent = content();\n } else if (typeof (content as Promise<string>).then === 'function') {\n stringContent = async () =>\n getHTMLCustomComponents((await (content as Promise<string>)) as string);\n }\n\n if (typeof stringContent === 'string') {\n return getHTMLCustomComponents(stringContent);\n }\n\n try {\n return getHTMLCustomComponents(JSON.stringify(content));\n } catch (_e) {\n return [];\n }\n };\n\n return formatNodeType(NodeType.Markdown, content, {\n metadata,\n tags: getComponents(),\n });\n};\n\nexport { markdown as md };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.mjs","names":[],"sources":["../../../../src/transpiler/markdown/markdown.ts"],"sourcesContent":["import { formatNodeType, NodeType, type TypedNodeModel } from '@intlayer/types';\nimport { getContent } from '../../interpreter/getContent/getContent';\nimport { getHTMLCustomComponents } from '../html/getHTMLCustomComponents';\nimport { getMarkdownMetadata } from './getMarkdownMetadata';\n\ntype PropsType = 'number' | 'string' | 'node';\n\ntype ComponentName = string;\n\nexport type MarkdownContentConstructor<\n T extends Record<string, any> = {},\n Content = unknown,\n> = TypedNodeModel<NodeType.Markdown, Content, T>;\n\nexport type MarkdownContent<\n Content = unknown,\n Components extends Record<ComponentName, PropsType> = Record<\n ComponentName,\n PropsType\n >,\n> = MarkdownContentConstructor<\n {\n metadata?: Record<string, any>;\n tags?: string[] | Components;\n },\n Content\n>;\n\nconst awaitContent = async (content: any) => {\n if (typeof content === 'string' || typeof content === 'object') {\n return content as any;\n }\n\n if (typeof content === 'function') {\n return content();\n }\n if (typeof content.then === 'function') {\n return await content;\n }\n};\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * markdown('## Hello world!');\n * ```\n *\n */\nconst markdown = <\n Components extends Record<string, any> = Record<string, any>,\n Content = unknown,\n>(\n content: Content,\n components?: Components\n): MarkdownContent<Content, Components> => {\n const metadata = async () => {\n const awaitedContent = await awaitContent(content);\n\n const flatContent = getContent(awaitedContent, {\n dictionaryKey: '',\n keyPath: [],\n });\n\n if (typeof flatContent === 'string') {\n return getMarkdownMetadata(flatContent);\n }\n };\n\n const getComponents = () => {\n if (components) {\n return components;\n }\n\n if (typeof content === 'string') {\n return getHTMLCustomComponents(content);\n }\n\n let stringContent: any;\n\n if (typeof content === 'function') {\n stringContent = content();\n } else if (typeof (content as Promise<string>).then === 'function') {\n stringContent = async () =>\n getHTMLCustomComponents((await (content as Promise<string>)) as string);\n }\n\n if (typeof stringContent === 'string') {\n return getHTMLCustomComponents(stringContent);\n }\n\n try {\n return getHTMLCustomComponents(JSON.stringify(content));\n } catch (_e) {\n return [];\n }\n };\n\n return formatNodeType(NodeType.Markdown, content, {\n metadata,\n tags: getComponents(),\n });\n};\n\nexport { markdown as md };\n"],"mappings":"sRA4BA,MAAM,EAAe,KAAO,IAAiB,CAC3C,GAAI,OAAO,GAAY,UAAY,OAAO,GAAY,SACpD,OAAO,EAGT,GAAI,OAAO,GAAY,WACrB,OAAO,GAAS,CAElB,GAAI,OAAO,EAAQ,MAAS,WAC1B,OAAO,MAAM,GAgBX,GAIJ,EACA,IA4CO,EAAe,EAAS,SAAU,EAAS,CAChD,SA3Ce,SAAY,CAG3B,IAAM,EAAc,EAFG,MAAM,EAAa,EAAQ,CAEH,CAC7C,cAAe,GACf,QAAS,EAAE,CACZ,CAAC,CAEF,GAAI,OAAO,GAAgB,SACzB,OAAO,EAAoB,EAAY,EAmCzC,UA/B0B,CAC1B,GAAI,EACF,OAAO,EAGT,GAAI,OAAO,GAAY,SACrB,OAAO,EAAwB,EAAQ,CAGzC,IAAI,EASJ,GAPI,OAAO,GAAY,WACrB,EAAgB,GAAS,CAChB,OAAQ,EAA4B,MAAS,aACtD,EAAgB,SACd,EAAyB,MAAO,EAAuC,EAGvE,OAAO,GAAkB,SAC3B,OAAO,EAAwB,EAAc,CAG/C,GAAI,CACF,OAAO,EAAwB,KAAK,UAAU,EAAQ,CAAC,MAC5C,CACX,MAAO,EAAE,KAMU,CACtB,CAAC"}
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/transpiler/nesting/nesting.ts
|
|
4
|
-
/**
|
|
5
|
-
* Function intended to be used to build intlayer dictionaries.
|
|
6
|
-
*
|
|
7
|
-
* Allow to extract the content of another dictionary and nest it in the current dictionary.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
*
|
|
11
|
-
* ```ts
|
|
12
|
-
* nest("dictionaryKey");
|
|
13
|
-
* nest("dictionaryKey", "path.to.content");
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* The order of the keys will define the priority of the content.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
const nesting = (dictionaryKey, path) => formatNodeType(NodeType.Nested, {
|
|
20
|
-
dictionaryKey,
|
|
21
|
-
path
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { nesting as nest };
|
|
1
|
+
import{NodeType as e,formatNodeType as t}from"@intlayer/types";const n=(n,r)=>t(e.Nested,{dictionaryKey:n,path:r});export{n as nest};
|
|
26
2
|
//# sourceMappingURL=nesting.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nesting.mjs","names":[],"sources":["../../../../src/transpiler/nesting/nesting.ts"],"sourcesContent":["import type { DictionaryRegistryContent } from '@intlayer/types';\nimport {\n type DictionaryKeys,\n formatNodeType,\n NodeType,\n type TypedNodeModel,\n} from '@intlayer/types';\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 NodeType.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(NodeType.Nested, {\n dictionaryKey,\n path,\n });\n\nexport { nesting as nest };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nesting.mjs","names":[],"sources":["../../../../src/transpiler/nesting/nesting.ts"],"sourcesContent":["import type { DictionaryRegistryContent } from '@intlayer/types';\nimport {\n type DictionaryKeys,\n formatNodeType,\n NodeType,\n type TypedNodeModel,\n} from '@intlayer/types';\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 NodeType.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(NodeType.Nested, {\n dictionaryKey,\n path,\n });\n\nexport { nesting as nest };\n"],"mappings":"+DA2EA,MAAM,GACJ,EACA,IAEA,EAAe,EAAS,OAAQ,CAC9B,gBACA,OACD,CAAC"}
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/transpiler/translation/translation.ts
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* Function intended to be used to build intlayer dictionaries.
|
|
7
|
-
*
|
|
8
|
-
* Get the content of a translation based on the locale.
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* translation<string>({
|
|
14
|
-
* "en": "Hello",
|
|
15
|
-
* "fr": "Bonjour",
|
|
16
|
-
* // ... any other available locale
|
|
17
|
-
* })
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* Using TypeScript:
|
|
21
|
-
* - this function require each locale to be defined if defined in the project configuration.
|
|
22
|
-
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
23
|
-
*/
|
|
24
|
-
const translation = (content) => formatNodeType(NodeType.Translation, content);
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
export { translation as t };
|
|
1
|
+
import{NodeType as e,formatNodeType as t}from"@intlayer/types";const n=n=>t(e.Translation,n);export{n as t};
|
|
28
2
|
//# sourceMappingURL=translation.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.mjs","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":["import {\n formatNodeType,\n NodeType,\n type StrictModeLocaleMap,\n type TypedNodeModel,\n} from '@intlayer/types';\n\nexport type TranslationContent<\n Content = unknown,\n RecordContent extends\n StrictModeLocaleMap<Content> = StrictModeLocaleMap<Content>,\n> = TypedNodeModel<NodeType.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(NodeType.Translation, content) satisfies TranslationContent<\n Content,\n ContentRecord\n >;\n\nexport { translation as t };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translation.mjs","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":["import {\n formatNodeType,\n NodeType,\n type StrictModeLocaleMap,\n type TypedNodeModel,\n} from '@intlayer/types';\n\nexport type TranslationContent<\n Content = unknown,\n RecordContent extends\n StrictModeLocaleMap<Content> = StrictModeLocaleMap<Content>,\n> = TypedNodeModel<NodeType.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(NodeType.Translation, content) satisfies TranslationContent<\n Content,\n ContentRecord\n >;\n\nexport { translation as t };\n"],"mappings":"+DAiCA,MAAM,EAKJ,GAEA,EAAe,EAAS,YAAa,EAAQ"}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const checkIsURLAbsolute = (url) => /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url);
|
|
3
|
-
|
|
4
|
-
//#endregion
|
|
5
|
-
export { checkIsURLAbsolute };
|
|
1
|
+
const e=e=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e);export{e as checkIsURLAbsolute};
|
|
6
2
|
//# sourceMappingURL=checkIsURLAbsolute.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkIsURLAbsolute.mjs","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.mjs","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,EAAsB,GACjC,4BAA4B,KAAK,EAAI"}
|
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Retrieves a cookie by name from a cookie string or document.cookie
|
|
4
|
-
* @param name - The name of the cookie to retrieve
|
|
5
|
-
* @param cookieString - Optional cookie string to parse (defaults to document.cookie in browser)
|
|
6
|
-
* @returns The cookie value or undefined if not found
|
|
7
|
-
*/
|
|
8
|
-
const getCookie = (name, cookieString) => {
|
|
9
|
-
try {
|
|
10
|
-
const str = cookieString ?? (typeof document !== "undefined" ? document.cookie : "");
|
|
11
|
-
if (!str) return void 0;
|
|
12
|
-
const pairs = str.split(";");
|
|
13
|
-
for (let i = 0; i < pairs.length; i++) {
|
|
14
|
-
const part = pairs[i].trim();
|
|
15
|
-
if (!part) continue;
|
|
16
|
-
const equalIndex = part.indexOf("=");
|
|
17
|
-
if ((equalIndex >= 0 ? part.substring(0, equalIndex) : part) === name) {
|
|
18
|
-
const rawValue = equalIndex >= 0 ? part.substring(equalIndex + 1) : "";
|
|
19
|
-
try {
|
|
20
|
-
return decodeURIComponent(rawValue);
|
|
21
|
-
} catch {
|
|
22
|
-
return rawValue;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
} catch {}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { getCookie };
|
|
1
|
+
const e=(e,t)=>{try{let n=t??(typeof document<`u`?document.cookie:``);if(!n)return;let r=n.split(`;`);for(let t=0;t<r.length;t++){let n=r[t].trim();if(!n)continue;let i=n.indexOf(`=`);if((i>=0?n.substring(0,i):n)===e){let e=i>=0?n.substring(i+1):``;try{return decodeURIComponent(e)}catch{return e}}}}catch{}};export{e as getCookie};
|
|
31
2
|
//# sourceMappingURL=getCookie.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCookie.mjs","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.mjs","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,GACX,EACA,IACuB,CACvB,GAAI,CACF,IAAM,EACJ,IAAiB,OAAO,SAAa,IAAc,SAAS,OAAS,IAEvE,GAAI,CAAC,EAAK,OAEV,IAAM,EAAQ,EAAI,MAAM,IAAI,CAE5B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAAK,CACrC,IAAM,EAAO,EAAM,GAAG,MAAM,CAE5B,GAAI,CAAC,EAAM,SAEX,IAAM,EAAa,EAAK,QAAQ,IAAI,CAGpC,IAFY,GAAc,EAAI,EAAK,UAAU,EAAG,EAAW,CAAG,KAElD,EAAM,CAChB,IAAM,EAAW,GAAc,EAAI,EAAK,UAAU,EAAa,EAAE,CAAG,GAEpE,GAAI,CACF,OAAO,mBAAmB,EAAS,MAC7B,CACN,OAAO,UAIP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseYaml as e}from"./parseYaml.mjs";import{isValidElement as t}from"./isValidReactElement.mjs";import{CachedIntl as n,bindIntl as r,createCachedIntl as i}from"./intl.mjs";import{getCookie as a}from"./getCookie.mjs";import{LocaleStorage as o,getLocaleFromStorage as s,setLocaleInStorage as c}from"./localeStorage.mjs";import{checkIsURLAbsolute as l}from"./checkIsURLAbsolute.mjs";import{isSameKeyPath as u}from"./isSameKeyPath.mjs";export{n as CachedIntl,n as Intl,o as LocaleStorage,r as bindIntl,l as checkIsURLAbsolute,i as createCachedIntl,a as getCookie,s as getLocaleFromStorage,u as isSameKeyPath,t as isValidElement,e as parseYaml,c as setLocaleInStorage};
|