@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.cjs","names":["getHTMLCustomComponents","NodeType"],"sources":["../../../../src/transpiler/html/html.ts"],"sourcesContent":["import { formatNodeType, NodeType, type TypedNodeModel } from '@intlayer/types';\nimport { getHTMLCustomComponents } from './getHTMLCustomComponents';\n\ntype PropsType = 'number' | 'string' | 'node';\n\ntype ComponentName = string;\n\nexport type HTMLContentConstructor<\n Content = unknown,\n T extends Record<string, any> = {},\n> = TypedNodeModel<NodeType.HTML, Content, T>;\n\nexport type HTMLContent<\n Content = unknown,\n Components extends Record<ComponentName, PropsType> = Record<\n ComponentName,\n PropsType\n >,\n> = HTMLContentConstructor<\n Content,\n {\n tags: string[] | Components;\n }\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to parse HTML/JSX-like strings and replace tags with components during interpretation.\n *\n * Usage:\n *\n * ```ts\n * html('Hello <b>World</b>')\n * ```\n *\n */\nexport const html = <\n Components extends Record<string, any> = Record<string, any>,\n Content = unknown,\n>(\n content: Content,\n components?: Components\n): HTMLContent<Content, Components> => {\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.HTML, content, {\n tags: getComponents(),\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.cjs","names":["getHTMLCustomComponents","NodeType"],"sources":["../../../../src/transpiler/html/html.ts"],"sourcesContent":["import { formatNodeType, NodeType, type TypedNodeModel } from '@intlayer/types';\nimport { getHTMLCustomComponents } from './getHTMLCustomComponents';\n\ntype PropsType = 'number' | 'string' | 'node';\n\ntype ComponentName = string;\n\nexport type HTMLContentConstructor<\n Content = unknown,\n T extends Record<string, any> = {},\n> = TypedNodeModel<NodeType.HTML, Content, T>;\n\nexport type HTMLContent<\n Content = unknown,\n Components extends Record<ComponentName, PropsType> = Record<\n ComponentName,\n PropsType\n >,\n> = HTMLContentConstructor<\n Content,\n {\n tags: string[] | Components;\n }\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to parse HTML/JSX-like strings and replace tags with components during interpretation.\n *\n * Usage:\n *\n * ```ts\n * html('Hello <b>World</b>')\n * ```\n *\n */\nexport const html = <\n Components extends Record<string, any> = Record<string, any>,\n Content = unknown,\n>(\n content: Content,\n components?: Components\n): HTMLContent<Content, Components> => {\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.HTML, content, {\n tags: getComponents(),\n });\n};\n"],"mappings":"qMAqCA,MAAa,GAIX,EACA,KA+BA,EAAA,EAAA,gBAAsBC,EAAAA,SAAS,KAAM,EAAS,CAC5C,UA9B0B,CAC1B,GAAI,EACF,OAAO,EAGT,GAAI,OAAO,GAAY,SACrB,OAAOD,EAAAA,wBAAwB,EAAQ,CAGzC,IAAI,EASJ,GAPI,OAAO,GAAY,WACrB,EAAgB,GAAS,CAChB,OAAQ,EAA4B,MAAS,aACtD,EAAgB,SACdA,EAAAA,wBAAyB,MAAO,EAAuC,EAGvE,OAAO,GAAkB,SAC3B,OAAOA,EAAAA,wBAAwB,EAAc,CAG/C,GAAI,CACF,OAAOA,EAAAA,wBAAwB,KAAK,UAAU,EAAQ,CAAC,MAC5C,CACX,MAAO,EAAE,KAKU,CACtB,CAAC"}
|
|
@@ -1,117 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
//#region src/transpiler/html/htmlTags.ts
|
|
4
|
-
/**
|
|
5
|
-
* List of standard HTML tags to provide as default components.
|
|
6
|
-
* These allow users to use standard HTML tags in their html() content
|
|
7
|
-
* without having to pass them explicitly.
|
|
8
|
-
*
|
|
9
|
-
* Used by framework-specific plugins (react-intlayer, vue-intlayer, etc.)
|
|
10
|
-
* to create default HTML tag components.
|
|
11
|
-
*/
|
|
12
|
-
const HTML_TAGS = [
|
|
13
|
-
"html",
|
|
14
|
-
"head",
|
|
15
|
-
"body",
|
|
16
|
-
"main",
|
|
17
|
-
"header",
|
|
18
|
-
"footer",
|
|
19
|
-
"nav",
|
|
20
|
-
"aside",
|
|
21
|
-
"article",
|
|
22
|
-
"section",
|
|
23
|
-
"div",
|
|
24
|
-
"span",
|
|
25
|
-
"h1",
|
|
26
|
-
"h2",
|
|
27
|
-
"h3",
|
|
28
|
-
"h4",
|
|
29
|
-
"h5",
|
|
30
|
-
"h6",
|
|
31
|
-
"p",
|
|
32
|
-
"a",
|
|
33
|
-
"strong",
|
|
34
|
-
"b",
|
|
35
|
-
"em",
|
|
36
|
-
"i",
|
|
37
|
-
"u",
|
|
38
|
-
"s",
|
|
39
|
-
"del",
|
|
40
|
-
"ins",
|
|
41
|
-
"mark",
|
|
42
|
-
"small",
|
|
43
|
-
"sub",
|
|
44
|
-
"sup",
|
|
45
|
-
"code",
|
|
46
|
-
"pre",
|
|
47
|
-
"blockquote",
|
|
48
|
-
"q",
|
|
49
|
-
"cite",
|
|
50
|
-
"abbr",
|
|
51
|
-
"address",
|
|
52
|
-
"time",
|
|
53
|
-
"kbd",
|
|
54
|
-
"samp",
|
|
55
|
-
"var",
|
|
56
|
-
"ul",
|
|
57
|
-
"ol",
|
|
58
|
-
"li",
|
|
59
|
-
"dl",
|
|
60
|
-
"dt",
|
|
61
|
-
"dd",
|
|
62
|
-
"table",
|
|
63
|
-
"thead",
|
|
64
|
-
"tbody",
|
|
65
|
-
"tfoot",
|
|
66
|
-
"tr",
|
|
67
|
-
"th",
|
|
68
|
-
"td",
|
|
69
|
-
"caption",
|
|
70
|
-
"colgroup",
|
|
71
|
-
"col",
|
|
72
|
-
"form",
|
|
73
|
-
"input",
|
|
74
|
-
"textarea",
|
|
75
|
-
"button",
|
|
76
|
-
"select",
|
|
77
|
-
"option",
|
|
78
|
-
"optgroup",
|
|
79
|
-
"label",
|
|
80
|
-
"fieldset",
|
|
81
|
-
"legend",
|
|
82
|
-
"datalist",
|
|
83
|
-
"output",
|
|
84
|
-
"progress",
|
|
85
|
-
"meter",
|
|
86
|
-
"img",
|
|
87
|
-
"video",
|
|
88
|
-
"audio",
|
|
89
|
-
"source",
|
|
90
|
-
"track",
|
|
91
|
-
"picture",
|
|
92
|
-
"figure",
|
|
93
|
-
"figcaption",
|
|
94
|
-
"iframe",
|
|
95
|
-
"embed",
|
|
96
|
-
"object",
|
|
97
|
-
"canvas",
|
|
98
|
-
"svg",
|
|
99
|
-
"details",
|
|
100
|
-
"summary",
|
|
101
|
-
"dialog",
|
|
102
|
-
"br",
|
|
103
|
-
"hr",
|
|
104
|
-
"wbr",
|
|
105
|
-
"ruby",
|
|
106
|
-
"rt",
|
|
107
|
-
"rp",
|
|
108
|
-
"bdi",
|
|
109
|
-
"bdo",
|
|
110
|
-
"data",
|
|
111
|
-
"template",
|
|
112
|
-
"slot"
|
|
113
|
-
];
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
exports.HTML_TAGS = HTML_TAGS;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});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(`.`);exports.HTML_TAGS=e;
|
|
117
2
|
//# sourceMappingURL=htmlTags.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlTags.cjs","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.cjs","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":"mEAQA,MAAa,EAAY,0hBA8GxB"}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_transpiler_html_html = require('./html.cjs');
|
|
3
|
-
const require_transpiler_html_htmlTags = require('./htmlTags.cjs');
|
|
4
|
-
|
|
5
|
-
exports.HTML_TAGS = require_transpiler_html_htmlTags.HTML_TAGS;
|
|
6
|
-
exports.html = require_transpiler_html_html.html;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./html.cjs`),t=require(`./htmlTags.cjs`);exports.HTML_TAGS=t.HTML_TAGS,exports.html=e.html;
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_transpiler_condition_condition = require('./condition/condition.cjs');
|
|
3
|
-
const require_transpiler_enumeration_enumeration = require('./enumeration/enumeration.cjs');
|
|
4
|
-
const require_transpiler_gender_gender = require('./gender/gender.cjs');
|
|
5
|
-
const require_transpiler_html_html = require('./html/html.cjs');
|
|
6
|
-
const require_transpiler_html_htmlTags = require('./html/htmlTags.cjs');
|
|
7
|
-
const require_transpiler_insertion_getInsertionValues = require('./insertion/getInsertionValues.cjs');
|
|
8
|
-
const require_transpiler_insertion_insertion = require('./insertion/insertion.cjs');
|
|
9
|
-
const require_transpiler_markdown_getMarkdownMetadata = require('./markdown/getMarkdownMetadata.cjs');
|
|
10
|
-
const require_transpiler_markdown_markdown = require('./markdown/markdown.cjs');
|
|
11
|
-
const require_transpiler_nesting_nesting = require('./nesting/nesting.cjs');
|
|
12
|
-
const require_transpiler_translation_translation = require('./translation/translation.cjs');
|
|
13
|
-
|
|
14
|
-
exports.HTML_TAGS = require_transpiler_html_htmlTags.HTML_TAGS;
|
|
15
|
-
exports.cond = require_transpiler_condition_condition.cond;
|
|
16
|
-
exports.enu = require_transpiler_enumeration_enumeration.enu;
|
|
17
|
-
exports.gender = require_transpiler_gender_gender.gender;
|
|
18
|
-
exports.getInsertionValues = require_transpiler_insertion_getInsertionValues.getInsertionValues;
|
|
19
|
-
exports.getMarkdownMetadata = require_transpiler_markdown_getMarkdownMetadata.getMarkdownMetadata;
|
|
20
|
-
exports.html = require_transpiler_html_html.html;
|
|
21
|
-
exports.insert = require_transpiler_insertion_insertion.insert;
|
|
22
|
-
exports.md = require_transpiler_markdown_markdown.md;
|
|
23
|
-
exports.nest = require_transpiler_nesting_nesting.nest;
|
|
24
|
-
exports.t = require_transpiler_translation_translation.t;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./condition/condition.cjs`),t=require(`./enumeration/enumeration.cjs`),n=require(`./gender/gender.cjs`),r=require(`./html/html.cjs`),i=require(`./html/htmlTags.cjs`),a=require(`./insertion/getInsertionValues.cjs`),o=require(`./insertion/insertion.cjs`),s=require(`./markdown/getMarkdownMetadata.cjs`),c=require(`./markdown/markdown.cjs`),l=require(`./nesting/nesting.cjs`),u=require(`./translation/translation.cjs`);exports.HTML_TAGS=i.HTML_TAGS,exports.cond=e.cond,exports.enu=t.enu,exports.gender=n.gender,exports.getInsertionValues=a.getInsertionValues,exports.getMarkdownMetadata=s.getMarkdownMetadata,exports.html=r.html,exports.insert=o.insert,exports.md=c.md,exports.nest=l.nest,exports.t=u.t;
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
//#region src/transpiler/insertion/getInsertionValues.ts
|
|
4
|
-
const getInsertionValues = (content) => {
|
|
5
|
-
const matches = [...content.matchAll(/{{\s*(.*?)\s*}}/g)];
|
|
6
|
-
if (matches.length === 0) return [];
|
|
7
|
-
return [...new Set(matches.map((match) => match[1].trim()))].filter(Boolean);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
exports.getInsertionValues = getInsertionValues;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>{let t=[...e.matchAll(/{{\s*(.*?)\s*}}/g)];return t.length===0?[]:[...new Set(t.map(e=>e[1].trim()))].filter(Boolean)};exports.getInsertionValues=e;
|
|
12
2
|
//# sourceMappingURL=getInsertionValues.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInsertionValues.cjs","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.cjs","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":"mEAAA,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,6 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_transpiler_insertion_getInsertionValues = require('./getInsertionValues.cjs');
|
|
3
|
-
const require_transpiler_insertion_insertion = require('./insertion.cjs');
|
|
4
|
-
|
|
5
|
-
exports.getInsertionValues = require_transpiler_insertion_getInsertionValues.getInsertionValues;
|
|
6
|
-
exports.insert = require_transpiler_insertion_insertion.insert;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./getInsertionValues.cjs`),t=require(`./insertion.cjs`);exports.getInsertionValues=e.getInsertionValues,exports.insert=t.insert;
|
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_transpiler_insertion_getInsertionValues = require('./getInsertionValues.cjs');
|
|
4
|
-
let _intlayer_types = require("@intlayer/types");
|
|
5
|
-
|
|
6
|
-
//#region src/transpiler/insertion/insertion.ts
|
|
7
|
-
/**
|
|
8
|
-
* Function intended to be used to build intlayer dictionaries.
|
|
9
|
-
*
|
|
10
|
-
* Allow to identify insertions inside a content.
|
|
11
|
-
*
|
|
12
|
-
* Usage:
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* insertion('Hi, my name is {{name}} and I am {{age}} years old.')
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
const insertion = (content) => {
|
|
20
|
-
const getInsertions = () => {
|
|
21
|
-
if (typeof content === "string") return require_transpiler_insertion_getInsertionValues.getInsertionValues(content);
|
|
22
|
-
let stringContent;
|
|
23
|
-
if (typeof content === "function") stringContent = content();
|
|
24
|
-
else if (typeof content.then === "function") stringContent = async () => require_transpiler_insertion_getInsertionValues.getInsertionValues(await content);
|
|
25
|
-
if (typeof stringContent === "string") return require_transpiler_insertion_getInsertionValues.getInsertionValues(stringContent);
|
|
26
|
-
try {
|
|
27
|
-
return require_transpiler_insertion_getInsertionValues.getInsertionValues(JSON.stringify(content));
|
|
28
|
-
} catch (_e) {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
return (0, _intlayer_types.formatNodeType)(_intlayer_types.NodeType.Insertion, content, { fields: getInsertions() });
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
exports.insert = insertion;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`./getInsertionValues.cjs`);let t=require(`@intlayer/types`);const n=n=>(0,t.formatNodeType)(t.NodeType.Insertion,n,{fields:(()=>{if(typeof n==`string`)return e.getInsertionValues(n);let t;if(typeof n==`function`?t=n():typeof n.then==`function`&&(t=async()=>e.getInsertionValues(await n)),typeof t==`string`)return e.getInsertionValues(t);try{return e.getInsertionValues(JSON.stringify(n))}catch{return[]}})()});exports.insert=n;
|
|
37
2
|
//# sourceMappingURL=insertion.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertion.cjs","names":["getInsertionValues","NodeType"],"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.cjs","names":["getInsertionValues","NodeType"],"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":"gMA2BA,MAAM,EACJ,IA2BA,EAAA,EAAA,gBAAsBC,EAAAA,SAAS,UAAW,EAAS,CACjD,YA1B0B,CAC1B,GAAI,OAAO,GAAY,SACrB,OAAOD,EAAAA,mBAAmB,EAAQ,CAGpC,IAAI,EASJ,GAPI,OAAO,GAAY,WACrB,EAAgB,GAAS,CAChB,OAAQ,EAA4B,MAAS,aACtD,EAAgB,SACdA,EAAAA,mBAAmB,MAAO,EAA4B,EAGtD,OAAO,GAAkB,SAC3B,OAAOA,EAAAA,mBAAmB,EAAc,CAG1C,GAAI,CACF,OAAOA,EAAAA,mBAAmB,KAAK,UAAU,EAAQ,CAAC,MACvC,CACX,MAAO,EAAE,KAKY,CACxB,CAAC"}
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/transpiler/markdown/getMarkdownMetadata.ts
|
|
5
|
-
const getMarkdownMetadata = (markdown) => {
|
|
6
|
-
try {
|
|
7
|
-
const lines = markdown.split(/\r?\n/);
|
|
8
|
-
const firstNonEmptyLine = lines.find((line) => line.trim() !== "");
|
|
9
|
-
if (!firstNonEmptyLine || firstNonEmptyLine.trim() !== "---") return {};
|
|
10
|
-
let metadataEndIndex = -1;
|
|
11
|
-
for (let i = 1; i < lines.length; i++) if (lines[i].trim() === "---") {
|
|
12
|
-
metadataEndIndex = i;
|
|
13
|
-
break;
|
|
14
|
-
}
|
|
15
|
-
if (metadataEndIndex === -1) return {};
|
|
16
|
-
return require_utils_parseYaml.parseYaml(lines.slice(1, metadataEndIndex).join("\n")) ?? {};
|
|
17
|
-
} catch (_e) {
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.getMarkdownMetadata = getMarkdownMetadata;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../utils/parseYaml.cjs`),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.parseYaml(n.slice(1,i).join(`
|
|
2
|
+
`))??{}}catch{return{}}};exports.getMarkdownMetadata=t;
|
|
24
3
|
//# sourceMappingURL=getMarkdownMetadata.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMarkdownMetadata.cjs","names":["parseYaml"],"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.cjs","names":["parseYaml"],"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":"gHAEa,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,CASLA,EAAAA,UAJK,EAAM,MAAM,EAAG,EAAiB,CAChB,KAAK;EAAK,CAGF,EAE1B,EAAE,MACX,CAEX,MADkB,EAAE"}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_transpiler_markdown_getMarkdownMetadata = require('./getMarkdownMetadata.cjs');
|
|
3
|
-
const require_transpiler_markdown_markdown = require('./markdown.cjs');
|
|
4
|
-
|
|
5
|
-
exports.getMarkdownMetadata = require_transpiler_markdown_getMarkdownMetadata.getMarkdownMetadata;
|
|
6
|
-
exports.md = require_transpiler_markdown_markdown.md;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./getMarkdownMetadata.cjs`),t=require(`./markdown.cjs`);exports.getMarkdownMetadata=e.getMarkdownMetadata,exports.md=t.md;
|
|
@@ -1,55 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_interpreter_getContent_getContent = require('../../interpreter/getContent/getContent.cjs');
|
|
4
|
-
const require_transpiler_html_getHTMLCustomComponents = require('../html/getHTMLCustomComponents.cjs');
|
|
5
|
-
const require_transpiler_markdown_getMarkdownMetadata = require('./getMarkdownMetadata.cjs');
|
|
6
|
-
let _intlayer_types = require("@intlayer/types");
|
|
7
|
-
|
|
8
|
-
//#region src/transpiler/markdown/markdown.ts
|
|
9
|
-
const awaitContent = async (content) => {
|
|
10
|
-
if (typeof content === "string" || typeof content === "object") return content;
|
|
11
|
-
if (typeof content === "function") return content();
|
|
12
|
-
if (typeof content.then === "function") return await content;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Function intended to be used to build intlayer dictionaries.
|
|
16
|
-
*
|
|
17
|
-
* Allow to pick a content based on a quantity.
|
|
18
|
-
*
|
|
19
|
-
* Usage:
|
|
20
|
-
*
|
|
21
|
-
* ```ts
|
|
22
|
-
* markdown('## Hello world!');
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
const markdown = (content, components) => {
|
|
27
|
-
const metadata = async () => {
|
|
28
|
-
const flatContent = require_interpreter_getContent_getContent.getContent(await awaitContent(content), {
|
|
29
|
-
dictionaryKey: "",
|
|
30
|
-
keyPath: []
|
|
31
|
-
});
|
|
32
|
-
if (typeof flatContent === "string") return require_transpiler_markdown_getMarkdownMetadata.getMarkdownMetadata(flatContent);
|
|
33
|
-
};
|
|
34
|
-
const getComponents = () => {
|
|
35
|
-
if (components) return components;
|
|
36
|
-
if (typeof content === "string") return require_transpiler_html_getHTMLCustomComponents.getHTMLCustomComponents(content);
|
|
37
|
-
let stringContent;
|
|
38
|
-
if (typeof content === "function") stringContent = content();
|
|
39
|
-
else if (typeof content.then === "function") stringContent = async () => require_transpiler_html_getHTMLCustomComponents.getHTMLCustomComponents(await content);
|
|
40
|
-
if (typeof stringContent === "string") return require_transpiler_html_getHTMLCustomComponents.getHTMLCustomComponents(stringContent);
|
|
41
|
-
try {
|
|
42
|
-
return require_transpiler_html_getHTMLCustomComponents.getHTMLCustomComponents(JSON.stringify(content));
|
|
43
|
-
} catch (_e) {
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return (0, _intlayer_types.formatNodeType)(_intlayer_types.NodeType.Markdown, content, {
|
|
48
|
-
metadata,
|
|
49
|
-
tags: getComponents()
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
//#endregion
|
|
54
|
-
exports.md = markdown;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../interpreter/getContent/getContent.cjs`),t=require(`../html/getHTMLCustomComponents.cjs`),n=require(`./getMarkdownMetadata.cjs`);let r=require(`@intlayer/types`);const i=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},a=(a,o)=>(0,r.formatNodeType)(r.NodeType.Markdown,a,{metadata:async()=>{let t=e.getContent(await i(a),{dictionaryKey:``,keyPath:[]});if(typeof t==`string`)return n.getMarkdownMetadata(t)},tags:(()=>{if(o)return o;if(typeof a==`string`)return t.getHTMLCustomComponents(a);let e;if(typeof a==`function`?e=a():typeof a.then==`function`&&(e=async()=>t.getHTMLCustomComponents(await a)),typeof e==`string`)return t.getHTMLCustomComponents(e);try{return t.getHTMLCustomComponents(JSON.stringify(a))}catch{return[]}})()});exports.md=a;
|
|
55
2
|
//# sourceMappingURL=markdown.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.cjs","names":["getContent","getMarkdownMetadata","getHTMLCustomComponents","NodeType"],"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.cjs","names":["getContent","getMarkdownMetadata","getHTMLCustomComponents","NodeType"],"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":"2SA4BA,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,KA4CA,EAAA,EAAA,gBAAsBG,EAAAA,SAAS,SAAU,EAAS,CAChD,SA3Ce,SAAY,CAG3B,IAAM,EAAcH,EAAAA,WAFG,MAAM,EAAa,EAAQ,CAEH,CAC7C,cAAe,GACf,QAAS,EAAE,CACZ,CAAC,CAEF,GAAI,OAAO,GAAgB,SACzB,OAAOC,EAAAA,oBAAoB,EAAY,EAmCzC,UA/B0B,CAC1B,GAAI,EACF,OAAO,EAGT,GAAI,OAAO,GAAY,SACrB,OAAOC,EAAAA,wBAAwB,EAAQ,CAGzC,IAAI,EASJ,GAPI,OAAO,GAAY,WACrB,EAAgB,GAAS,CAChB,OAAQ,EAA4B,MAAS,aACtD,EAAgB,SACdA,EAAAA,wBAAyB,MAAO,EAAuC,EAGvE,OAAO,GAAkB,SAC3B,OAAOA,EAAAA,wBAAwB,EAAc,CAG/C,GAAI,CACF,OAAOA,EAAAA,wBAAwB,KAAK,UAAU,EAAQ,CAAC,MAC5C,CACX,MAAO,EAAE,KAMU,CACtB,CAAC"}
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_transpiler_nesting_nesting = require('./nesting.cjs');
|
|
3
|
-
|
|
4
|
-
exports.nest = require_transpiler_nesting_nesting.nest;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./nesting.cjs`);exports.nest=e.nest;
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_types = require("@intlayer/types");
|
|
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.formatNodeType)(_intlayer_types.NodeType.Nested, {
|
|
22
|
-
dictionaryKey,
|
|
23
|
-
path
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
exports.nest = nesting;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/types`);const t=(t,n)=>(0,e.formatNodeType)(e.NodeType.Nested,{dictionaryKey:t,path:n});exports.nest=t;
|
|
28
2
|
//# sourceMappingURL=nesting.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nesting.cjs","names":["NodeType"],"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.cjs","names":["NodeType"],"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":"oJA2EA,MAAM,GACJ,EACA,KAAA,EAAA,EAAA,gBAEeA,EAAAA,SAAS,OAAQ,CAC9B,gBACA,OACD,CAAC"}
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_transpiler_translation_translation = require('./translation.cjs');
|
|
3
|
-
|
|
4
|
-
exports.t = require_transpiler_translation_translation.t;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./translation.cjs`);exports.t=e.t;
|
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_types = require("@intlayer/types");
|
|
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.formatNodeType)(_intlayer_types.NodeType.Translation, content);
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
exports.t = translation;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/types`);const t=t=>(0,e.formatNodeType)(e.NodeType.Translation,t);exports.t=t;
|
|
30
2
|
//# sourceMappingURL=translation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.cjs","names":["NodeType"],"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.cjs","names":["NodeType"],"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":"oJAiCA,MAAM,EAKJ,IAAA,EAAA,EAAA,gBAEeA,EAAAA,SAAS,YAAa,EAAQ"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
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;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e);exports.checkIsURLAbsolute=e;
|
|
8
2
|
//# 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":"mEAAA,MAAa,EAAsB,GACjC,4BAA4B,KAAK,EAAI"}
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
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;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});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{}};exports.getCookie=e;
|
|
33
2
|
//# 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":"mEAMA,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
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./parseYaml.cjs`),t=require(`./isValidReactElement.cjs`),n=require(`./intl.cjs`),r=require(`./getCookie.cjs`),i=require(`./localeStorage.cjs`),a=require(`./checkIsURLAbsolute.cjs`),o=require(`./isSameKeyPath.cjs`);exports.CachedIntl=n.CachedIntl,exports.Intl=n.CachedIntl,exports.LocaleStorage=i.LocaleStorage,exports.bindIntl=n.bindIntl,exports.checkIsURLAbsolute=a.checkIsURLAbsolute,exports.createCachedIntl=n.createCachedIntl,exports.getCookie=r.getCookie,exports.getLocaleFromStorage=i.getLocaleFromStorage,exports.isSameKeyPath=o.isSameKeyPath,exports.isValidElement=t.isValidElement,exports.parseYaml=e.parseYaml,exports.setLocaleInStorage=i.setLocaleInStorage;
|