@intlayer/core 8.5.2 → 8.6.1

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.
Files changed (125) hide show
  1. package/dist/cjs/formatters/compact.cjs +1 -1
  2. package/dist/cjs/formatters/compact.cjs.map +1 -1
  3. package/dist/cjs/formatters/currency.cjs +1 -1
  4. package/dist/cjs/formatters/currency.cjs.map +1 -1
  5. package/dist/cjs/formatters/date.cjs +1 -1
  6. package/dist/cjs/formatters/date.cjs.map +1 -1
  7. package/dist/cjs/formatters/index.cjs +1 -1
  8. package/dist/cjs/formatters/list.cjs +1 -1
  9. package/dist/cjs/formatters/list.cjs.map +1 -1
  10. package/dist/cjs/formatters/number.cjs +1 -1
  11. package/dist/cjs/formatters/number.cjs.map +1 -1
  12. package/dist/cjs/formatters/percentage.cjs +2 -2
  13. package/dist/cjs/formatters/percentage.cjs.map +1 -1
  14. package/dist/cjs/formatters/relativeTime.cjs +1 -1
  15. package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
  16. package/dist/cjs/formatters/units.cjs +1 -1
  17. package/dist/cjs/formatters/units.cjs.map +1 -1
  18. package/dist/cjs/index.cjs +17 -9
  19. package/dist/cjs/interpreter/getContent/getContent.cjs +1 -1
  20. package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -1
  21. package/dist/cjs/interpreter/getContent/index.cjs +1 -0
  22. package/dist/cjs/interpreter/getContent/plugins.cjs +20 -9
  23. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  24. package/dist/cjs/interpreter/index.cjs +1 -0
  25. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs +10 -35
  26. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
  27. package/dist/cjs/localization/generateSitemap.cjs +111 -0
  28. package/dist/cjs/localization/generateSitemap.cjs.map +1 -0
  29. package/dist/cjs/localization/getBrowserLocale.cjs +1 -1
  30. package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
  31. package/dist/cjs/localization/getLocale.cjs +2 -2
  32. package/dist/cjs/localization/getLocale.cjs.map +1 -1
  33. package/dist/cjs/localization/getLocalizedUrl.cjs +1 -1
  34. package/dist/cjs/localization/getPrefix.cjs +1 -1
  35. package/dist/cjs/localization/index.cjs +8 -7
  36. package/dist/cjs/localization/localeMapper.cjs +1 -1
  37. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +2 -3
  38. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -1
  39. package/dist/cjs/utils/index.cjs +9 -3
  40. package/dist/cjs/utils/intl.cjs +88 -72
  41. package/dist/cjs/utils/intl.cjs.map +1 -1
  42. package/dist/cjs/utils/localeStorage.cjs +191 -64
  43. package/dist/cjs/utils/localeStorage.cjs.map +1 -1
  44. package/dist/esm/formatters/compact.mjs +2 -2
  45. package/dist/esm/formatters/compact.mjs.map +1 -1
  46. package/dist/esm/formatters/currency.mjs +2 -2
  47. package/dist/esm/formatters/currency.mjs.map +1 -1
  48. package/dist/esm/formatters/date.mjs +2 -2
  49. package/dist/esm/formatters/date.mjs.map +1 -1
  50. package/dist/esm/formatters/index.mjs +2 -2
  51. package/dist/esm/formatters/list.mjs +2 -2
  52. package/dist/esm/formatters/list.mjs.map +1 -1
  53. package/dist/esm/formatters/number.mjs +2 -2
  54. package/dist/esm/formatters/number.mjs.map +1 -1
  55. package/dist/esm/formatters/percentage.mjs +3 -3
  56. package/dist/esm/formatters/percentage.mjs.map +1 -1
  57. package/dist/esm/formatters/relativeTime.mjs +2 -2
  58. package/dist/esm/formatters/relativeTime.mjs.map +1 -1
  59. package/dist/esm/formatters/units.mjs +2 -2
  60. package/dist/esm/formatters/units.mjs.map +1 -1
  61. package/dist/esm/index.mjs +11 -11
  62. package/dist/esm/interpreter/getContent/getContent.mjs +1 -1
  63. package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -1
  64. package/dist/esm/interpreter/getContent/index.mjs +2 -2
  65. package/dist/esm/interpreter/getContent/plugins.mjs +20 -10
  66. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  67. package/dist/esm/interpreter/index.mjs +2 -2
  68. package/dist/esm/interpreter/splitAndJoinInsertion.mjs +10 -35
  69. package/dist/esm/interpreter/splitAndJoinInsertion.mjs.map +1 -1
  70. package/dist/esm/localization/generateSitemap.mjs +109 -0
  71. package/dist/esm/localization/generateSitemap.mjs.map +1 -0
  72. package/dist/esm/localization/getBrowserLocale.mjs +2 -2
  73. package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
  74. package/dist/esm/localization/getLocale.mjs +3 -3
  75. package/dist/esm/localization/getLocale.mjs.map +1 -1
  76. package/dist/esm/localization/getLocalizedUrl.mjs +1 -1
  77. package/dist/esm/localization/getPrefix.mjs +1 -1
  78. package/dist/esm/localization/index.mjs +7 -7
  79. package/dist/esm/localization/localeMapper.mjs +1 -1
  80. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs +2 -4
  81. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -1
  82. package/dist/esm/utils/index.mjs +4 -4
  83. package/dist/esm/utils/intl.mjs +87 -72
  84. package/dist/esm/utils/intl.mjs.map +1 -1
  85. package/dist/esm/utils/localeStorage.mjs +186 -65
  86. package/dist/esm/utils/localeStorage.mjs.map +1 -1
  87. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +10 -10
  88. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
  89. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +10 -10
  90. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -1
  91. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +10 -10
  92. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -1
  93. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +2 -2
  94. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -1
  95. package/dist/types/formatters/index.d.ts +2 -2
  96. package/dist/types/formatters/number.d.ts +4 -1
  97. package/dist/types/formatters/number.d.ts.map +1 -1
  98. package/dist/types/formatters/percentage.d.ts +4 -1
  99. package/dist/types/formatters/percentage.d.ts.map +1 -1
  100. package/dist/types/index.d.ts +5 -5
  101. package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
  102. package/dist/types/interpreter/getContent/index.d.ts +2 -2
  103. package/dist/types/interpreter/getContent/plugins.d.ts +7 -1
  104. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
  105. package/dist/types/interpreter/index.d.ts +2 -2
  106. package/dist/types/interpreter/splitAndJoinInsertion.d.ts +0 -17
  107. package/dist/types/interpreter/splitAndJoinInsertion.d.ts.map +1 -1
  108. package/dist/types/localization/generateSitemap.d.ts +93 -0
  109. package/dist/types/localization/generateSitemap.d.ts.map +1 -0
  110. package/dist/types/localization/getBrowserLocale.d.ts +2 -2
  111. package/dist/types/localization/getBrowserLocale.d.ts.map +1 -1
  112. package/dist/types/localization/index.d.ts +2 -2
  113. package/dist/types/transpiler/html/getHTMLCustomComponents.d.ts.map +1 -1
  114. package/dist/types/utils/index.d.ts +3 -3
  115. package/dist/types/utils/intl.d.ts +15 -11
  116. package/dist/types/utils/intl.d.ts.map +1 -1
  117. package/dist/types/utils/localeStorage.d.ts +85 -68
  118. package/dist/types/utils/localeStorage.d.ts.map +1 -1
  119. package/package.json +8 -8
  120. package/dist/cjs/getStorageAttributes.cjs +0 -135
  121. package/dist/cjs/getStorageAttributes.cjs.map +0 -1
  122. package/dist/esm/getStorageAttributes.mjs +0 -133
  123. package/dist/esm/getStorageAttributes.mjs.map +0 -1
  124. package/dist/types/getStorageAttributes.d.ts +0 -29
  125. package/dist/types/getStorageAttributes.d.ts.map +0 -1
@@ -14,7 +14,7 @@ import { DotPath, NestedContent, NestedContentState, ValidDotPathsFor, nest as n
14
14
  import { TranslationContent, t as translation } from "./transpiler/translation/translation.js";
15
15
  import { getCondition } from "./interpreter/getCondition.js";
16
16
  import { GetNestingResult, getNesting } from "./interpreter/getNesting.js";
17
- import { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, enumerationPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./interpreter/getContent/plugins.js";
17
+ import { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./interpreter/getContent/plugins.js";
18
18
  import { deepTransformNode } from "./interpreter/getContent/deepTransform.js";
19
19
  import { getBasePlugins, getContent } from "./interpreter/getContent/getContent.js";
20
20
  import { getDictionary } from "./interpreter/getDictionary.js";
@@ -48,14 +48,14 @@ import { updateNodeChildren } from "./dictionaryManipulator/updateNodeChildren.j
48
48
  import { compact } from "./formatters/compact.js";
49
49
  import { currency } from "./formatters/currency.js";
50
50
  import { DateTimePreset, date, presets } from "./formatters/date.js";
51
- import { CachedIntl, WrappedIntl, bindIntl, createCachedIntl } from "./utils/intl.js";
51
+ import { CachedIntl, WrappedIntl, bindIntl, getCachedIntl } from "./utils/intl.js";
52
52
  import { list } from "./formatters/list.js";
53
53
  import { number } from "./formatters/number.js";
54
54
  import { percentage } from "./formatters/percentage.js";
55
55
  import { relativeTime } from "./formatters/relativeTime.js";
56
56
  import { units } from "./formatters/units.js";
57
- import { ProcessedStorageAttributes, getStorageAttributes } from "./getStorageAttributes.js";
58
- import { LocaleStorage, LocaleStorageOptions, getLocaleFromStorage, setLocaleInStorage } from "./utils/localeStorage.js";
57
+ import { GenerateSitemapOptions, SitemapUrlEntry, generateSitemap, generateSitemapUrl } from "./localization/generateSitemap.js";
58
+ import { CookieBuildAttributes, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer } from "./utils/localeStorage.js";
59
59
  import { getBrowserLocale, localeStorageOptions } from "./localization/getBrowserLocale.js";
60
60
  import { getHTMLTextDir } from "./localization/getHTMLTextDir.js";
61
61
  import { getLocale } from "./localization/getLocale.js";
@@ -85,4 +85,4 @@ import { getCookie } from "./utils/getCookie.js";
85
85
  import { isSameKeyPath } from "./utils/isSameKeyPath.js";
86
86
  import { isValidElement } from "./utils/isValidReactElement.js";
87
87
  import { parseYaml } from "./utils/parseYaml.js";
88
- export { ATTRIBUTES_TO_SANITIZE, ATTRIBUTE_TO_NODE_PROP_MAP, ATTR_EXTRACTOR_R, BLOCKQUOTE_ALERT_R, BLOCKQUOTE_R, BLOCKQUOTE_TRIM_LEFT_MULTILINE_R, BLOCK_END_R, BREAK_LINE_R, BREAK_THEMATIC_R, BlockQuoteNode, BoldTextNode, BreakLineNode, BreakThematicNode, CAPTURE_LETTER_AFTER_HYPHEN, CODE_BLOCK_FENCED_R, CODE_BLOCK_R, CODE_INLINE_R, CONSECUTIVE_NEWLINE_R, CR_NEWLINE_R, CUSTOM_COMPONENT_R, CachedIntl, CachedIntl as Intl, CodeBlockNode, CodeFencedNode, CodeInlineNode, CompileOptions, ComponentOverrides, ConditionCond, ConditionContent, ConditionContentStates, CustomComponentNode, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, DateTimePreset, DeepTransformContent, DotPath, ElementType, EnterFormat, EnumerationCond, EnumerationContent, EnumerationContentState, EscapedTextNode, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, FileCond, FileContent, FileContentConstructor, FootnoteNode, FootnoteReferenceNode, GFMTaskNode, GFM_TASK_R, Gender, GenderCond, GenderContent, GenderContentStates, GetNestingResult, GetPrefixOptions, GetPrefixResult, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, HTMLCommentNode, HTMLContent, HTMLContentConstructor, HTMLNode, HTMLSelfClosingNode, HTMLTag, HTMLTagsType, HTMLValidationIssue, HTMLValidationResult, HTML_BLOCK_ELEMENT_R, HTML_CHAR_CODE_R, HTML_COMMENT_R, HTML_CUSTOM_ATTR_R, HTML_LEFT_TRIM_AMOUNT_R, HTML_SELF_CLOSING_ELEMENT_R, HTML_TAGS, HeadingNode, HeadingSetextNode, IInterpreterPlugin, IInterpreterPluginState, INLINE_SKIP_R, INTERPOLATION_R, ImageNode, InsertionCond, InsertionContent, InsertionContentConstructor, IsAny, ItalicTextNode, JsonValue, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, LinkAngleBraceNode, LinkBareURLNode, LinkNode, ListType, LocaleStorage, LocaleStorageOptions, LocalizedPathResult, MarkdownContent, MarkdownContentConstructor, MarkdownContext, MarkdownOptions, MarkdownRuntime, HTMLValidationIssue as MarkdownValidationIssue, MarkdownValidationResult, MarkedTextNode, NAMED_CODES_TO_UNICODE, NP_TABLE_R, NestedCond, NestedContent, NestedContentState, NestedParser, NewlineNode, NodeProps, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, OrderedListNode, PARAGRAPH_R, ParagraphNode, ParseState, Parser, ParserResult, Plugins, Priority, PriorityValue, ProcessedStorageAttributes, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, ReferenceImageNode, ReferenceLinkNode, ReferenceNode, RenderRuleHook, Rule, RuleOutput, RuleType, RuleTypeValue, Rules, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, StrikethroughTextNode, TABLE_CENTER_ALIGN, TABLE_LEFT_ALIGN, TABLE_RIGHT_ALIGN, TABLE_TRIM_PIPES, TAB_R, TEXT_BOLD_R, TEXT_EMPHASIZED_R, TEXT_ESCAPED_R, TEXT_MARKED_R, TEXT_PLAIN_R, TEXT_STRIKETHROUGHED_R, TRIM_STARTING_NEWLINES, TableNode, TableSeparatorNode, TextNode, TranslationCond, TranslationContent, UNESCAPE_R, UNORDERED, UNORDERED_LIST_BULLET, UNORDERED_LIST_ITEM_PREFIX, UNORDERED_LIST_ITEM_PREFIX_R, UNORDERED_LIST_ITEM_R, UNORDERED_LIST_R, UnionKeys, UnorderedListNode, VOID_ELEMENTS, ValidDotPathsFor, ValueAtKey, WrappedIntl, allowInline, anyScopeRegex, attributeValueToNodePropValue, bindIntl, blockRegex, buildMaskPlugin, captureNothing, checkIsURLAbsolute, checkMissingLocalesPlugin, compact, compile, compileWithOptions, condition as cond, conditionPlugin, createCachedIntl, createCompiler, createRenderer, currency, cx, date, deepTransformNode, editDictionaryByKeyPath, enumeration as enu, enumerationPlugin, file, fileContent, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, get, getBasePlugins, getBrowserLocale, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary, getEmptyNode, getEnumeration, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getHTML, getHTMLTextDir, getInsertionValues, getInternalPath, getIntlayer, getLocale, getLocaleFromPath, getLocaleFromStorage, getLocaleLang, getLocaleName, getLocalizedContent, getLocalizedPath, getLocalizedUrl, getMarkdownMetadata, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getMultilingualUrls, getNesting, getNodeChildren, getNodeType, getPathWithoutLocale, getPerLocaleDictionary, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSplittedContent, getSplittedDictionaryContent, getStorageAttributes, getTranslation, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToVueI18nFormatter, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, nesting as nest, nestedPlugin, normalizeAttributeKey, normalizeDictionaries, normalizeDictionary, normalizeWhitespace, number, orderDictionaries, parseBlock, parseCaptureInline, parseInline, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseYaml, parserFor, percentage, presets, qualifies, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderNothing, sanitizer, setLocaleInStorage, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, translation as t, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
88
+ export { ATTRIBUTES_TO_SANITIZE, ATTRIBUTE_TO_NODE_PROP_MAP, ATTR_EXTRACTOR_R, BLOCKQUOTE_ALERT_R, BLOCKQUOTE_R, BLOCKQUOTE_TRIM_LEFT_MULTILINE_R, BLOCK_END_R, BREAK_LINE_R, BREAK_THEMATIC_R, BlockQuoteNode, BoldTextNode, BreakLineNode, BreakThematicNode, CAPTURE_LETTER_AFTER_HYPHEN, CODE_BLOCK_FENCED_R, CODE_BLOCK_R, CODE_INLINE_R, CONSECUTIVE_NEWLINE_R, CR_NEWLINE_R, CUSTOM_COMPONENT_R, CachedIntl, CachedIntl as Intl, CodeBlockNode, CodeFencedNode, CodeInlineNode, CompileOptions, ComponentOverrides, ConditionCond, ConditionContent, ConditionContentStates, CookieBuildAttributes, CustomComponentNode, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, DateTimePreset, DeepTransformContent, DotPath, ElementType, EnterFormat, EnumerationCond, EnumerationContent, EnumerationContentState, EscapedTextNode, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, FileCond, FileContent, FileContentConstructor, FootnoteNode, FootnoteReferenceNode, GFMTaskNode, GFM_TASK_R, Gender, GenderCond, GenderContent, GenderContentStates, GenerateSitemapOptions, GetNestingResult, GetPrefixOptions, GetPrefixResult, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, HTMLCommentNode, HTMLContent, HTMLContentConstructor, HTMLNode, HTMLSelfClosingNode, HTMLTag, HTMLTagsType, HTMLValidationIssue, HTMLValidationResult, HTML_BLOCK_ELEMENT_R, HTML_CHAR_CODE_R, HTML_COMMENT_R, HTML_CUSTOM_ATTR_R, HTML_LEFT_TRIM_AMOUNT_R, HTML_SELF_CLOSING_ELEMENT_R, HTML_TAGS, HeadingNode, HeadingSetextNode, IInterpreterPlugin, IInterpreterPluginState, INLINE_SKIP_R, INTERPOLATION_R, ImageNode, InsertionCond, InsertionContent, InsertionContentConstructor, IsAny, ItalicTextNode, JsonValue, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, LinkAngleBraceNode, LinkBareURLNode, LinkNode, ListType, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, LocalizedPathResult, MarkdownContent, MarkdownContentConstructor, MarkdownContext, MarkdownOptions, MarkdownRuntime, HTMLValidationIssue as MarkdownValidationIssue, MarkdownValidationResult, MarkedTextNode, NAMED_CODES_TO_UNICODE, NP_TABLE_R, NestedCond, NestedContent, NestedContentState, NestedParser, NewlineNode, NodeProps, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, OrderedListNode, PARAGRAPH_R, ParagraphNode, ParseState, Parser, ParserResult, Plugins, Priority, PriorityValue, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, ReferenceImageNode, ReferenceLinkNode, ReferenceNode, RenderRuleHook, Rule, RuleOutput, RuleType, RuleTypeValue, Rules, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, SitemapUrlEntry, StrikethroughTextNode, TABLE_CENTER_ALIGN, TABLE_LEFT_ALIGN, TABLE_RIGHT_ALIGN, TABLE_TRIM_PIPES, TAB_R, TEXT_BOLD_R, TEXT_EMPHASIZED_R, TEXT_ESCAPED_R, TEXT_MARKED_R, TEXT_PLAIN_R, TEXT_STRIKETHROUGHED_R, TRIM_STARTING_NEWLINES, TableNode, TableSeparatorNode, TextNode, TranslationCond, TranslationContent, UNESCAPE_R, UNORDERED, UNORDERED_LIST_BULLET, UNORDERED_LIST_ITEM_PREFIX, UNORDERED_LIST_ITEM_PREFIX_R, UNORDERED_LIST_ITEM_R, UNORDERED_LIST_R, UnionKeys, UnorderedListNode, VOID_ELEMENTS, ValidDotPathsFor, ValueAtKey, WrappedIntl, allowInline, anyScopeRegex, attributeValueToNodePropValue, bindIntl, blockRegex, buildMaskPlugin, captureNothing, checkIsURLAbsolute, checkMissingLocalesPlugin, compact, compile, compileWithOptions, condition as cond, conditionPlugin, createCompiler, createRenderer, currency, cx, date, deepTransformNode, editDictionaryByKeyPath, enumeration as enu, enumerationPlugin, fallbackPlugin, file, fileContent, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, generateSitemap, generateSitemapUrl, get, getBasePlugins, getBrowserLocale, getCachedIntl, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary, getEmptyNode, getEnumeration, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getHTML, getHTMLTextDir, getInsertionValues, getInternalPath, getIntlayer, getLocale, getLocaleFromPath, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, getLocaleLang, getLocaleName, getLocalizedContent, getLocalizedPath, getLocalizedUrl, getMarkdownMetadata, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getMultilingualUrls, getNesting, getNodeChildren, getNodeType, getPathWithoutLocale, getPerLocaleDictionary, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSplittedContent, getSplittedDictionaryContent, getTranslation, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToVueI18nFormatter, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, nesting as nest, nestedPlugin, normalizeAttributeKey, normalizeDictionaries, normalizeDictionary, normalizeWhitespace, number, orderDictionaries, parseBlock, parseCaptureInline, parseInline, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseYaml, parserFor, percentage, presets, qualifies, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderNothing, sanitizer, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, translation as t, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
@@ -1 +1 @@
1
- {"version":3,"file":"getContent.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/getContent.ts"],"mappings":";;;;;cAqBa,cAAA,GACX,MAAA,GAAS,aAAA,EACT,QAAA,eACC,OAAA;;AAHH;;;;;cAsBa,UAAA,aACD,WAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,IAAA,EAAM,CAAA,EACN,SAAA,EAAW,SAAA,EACX,OAAA,GAAS,OAAA,OAKH,oBAAA,CAAqB,CAAA,EAAG,uBAAA,EAAyB,CAAA"}
1
+ {"version":3,"file":"getContent.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/getContent.ts"],"mappings":";;;;;cAqBa,cAAA,GACX,MAAA,GAAS,aAAA,EACT,QAAA,eACC,OAAA;;AAHH;;;;;cAuBa,UAAA,aACD,WAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,IAAA,EAAM,CAAA,EACN,SAAA,EAAW,SAAA,EACX,OAAA,GAAS,OAAA,OAKH,oBAAA,CAAqB,CAAA,EAAG,uBAAA,EAAyB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, enumerationPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./plugins.js";
1
+ import { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./plugins.js";
2
2
  import { deepTransformNode } from "./deepTransform.js";
3
3
  import { getBasePlugins, getContent } from "./getContent.js";
4
- export { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, deepTransformNode, enumerationPlugin, filePlugin, genderPlugin, getBasePlugins, getContent, insertionPlugin, nestedPlugin, translationPlugin };
4
+ export { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, deepTransformNode, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, getBasePlugins, getContent, insertionPlugin, nestedPlugin, translationPlugin };
@@ -22,6 +22,12 @@ type Plugins = {
22
22
  canHandle: (node: any) => boolean;
23
23
  transform: (node: any, props: NodeProps, transformFn: (node: any, props: NodeProps) => any) => any;
24
24
  };
25
+ /** ---------------------------------------------
26
+ * FALLBACK PLUGIN
27
+ *
28
+ * Used to fallback a tree-shaken plugin
29
+ * --------------------------------------------- */
30
+ declare const fallbackPlugin: Plugins;
25
31
  /** ---------------------------------------------
26
32
  * TRANSLATION PLUGIN
27
33
  * --------------------------------------------- */
@@ -148,5 +154,5 @@ type IsAny<T> = 0 extends 1 & T ? true : false;
148
154
  */
149
155
  type DeepTransformContent<T, S = IInterpreterPluginState, L extends LocalesValues = DeclaredLocales> = IsAny<T> extends true ? T : CheckApplyPlugin<T, keyof IInterpreterPlugin<T, S, L>, S, L> extends never ? Traverse<T, S, L> : CheckApplyPlugin<T, keyof IInterpreterPlugin<T, S, L>, S, L>;
150
156
  //#endregion
151
- export { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, enumerationPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin };
157
+ export { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin };
152
158
  //# sourceMappingURL=plugins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"mappings":";;;;;;;;;;;;AAqCA;;;;;;;AAAA,KAAY,OAAA;EACV,EAAA;EACA,SAAA,GAAY,IAAA;EACZ,SAAA,GACE,IAAA,OACA,KAAA,EAAO,SAAA,EACP,WAAA,GAAc,IAAA,OAAW,KAAA,EAAO,SAAA;AAAA;;;;KAQxB,SAAA,MAAe,CAAA,yBAA0B,CAAA;AAAA,KACzC,UAAA,SAAmB,CAAA,mBAC3B,CAAA,eAAgB,CAAA,GACd,CAAA,CAAE,CAAA;AAAA,KAII,eAAA,iBAAgC,aAAA,IAAiB,CAAA;EAC3D,QAAA,EAAU,QAAA;EAAA,CACT,SAAA,CAAU,WAAA;AAAA,IAET,CAAA,SAAU,MAAA,CAAO,WAAA,aACf,CAAA,OAAQ,CAAA,UAAW,MAAA,CAAO,WAAA,qBAEhB,SAAA,CAAU,CAAA,OAAQ,CAAA,KAAM,CAAA,eAAgB,CAAA,GAC1C,CAAA,eAAgB,CAAA,CAAE,CAAA,IAChB,CAAA,CAAE,CAAA,EAAG,CAAA,IACL,UAAA,CAAW,CAAA,OAAQ,CAAA,GAAI,CAAA,IACzB,UAAA,CAAW,CAAA,OAAQ,CAAA,GAAI,CAAA,4BAE3B,oBAAA,CAAqB,OAAA,EAAS,CAAA,aAE/B,CAAA,eAAgB,CAAA,GAAI,CAAA,CAAE,CAAA,IAAK,CAAA,OAAQ,CAAA,2BAClC,oBAAA,CAAqB,OAAA,EAAS,CAAA;;cAM3B,iBAAA,GACX,MAAA,EAAQ,aAAA,EACR,QAAA,GAAW,aAAA,KACV,OAAA;;AA/BH;;KA+DY,eAAA,aAA4B,CAAA;EACtC,QAAA,EAAU,QAAA;EAAA,CACT,SAAA,CAAU,WAAA;AAAA,KAGP,QAAA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,GAAI,oBAAA,CAAqB,CAAA,CAAE,CAAA,GAAI,CAAA,EAAG,CAAA,MAChD,CAAA;AAAA,KAEI,KAAA,oBAAyB,CAAA;;;;KAKzB,oBAAA,QAEN,uBAAA,YACM,aAAA,GAAgB,eAAA,IAE1B,KAAA,CAAM,CAAA,iBACF,CAAA,GACA,gBAAA,CAAiB,CAAA,QAAS,kBAAA,CAAmB,CAAA,EAAG,CAAA,EAAG,CAAA,GAAI,CAAA,EAAG,CAAA,kBAExD,QAAA,CAAS,CAAA,EAAG,CAAA,EAAG,CAAA,IAEf,gBAAA,CAAiB,CAAA,QAAS,kBAAA,CAAmB,CAAA,EAAG,CAAA,EAAG,CAAA,GAAI,CAAA,EAAG,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { getCondition } from "./getCondition.js";
2
2
  import { GetNestingResult, getNesting } from "./getNesting.js";
3
- import { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, enumerationPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./getContent/plugins.js";
3
+ import { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, insertionPlugin, nestedPlugin, translationPlugin } from "./getContent/plugins.js";
4
4
  import { deepTransformNode } from "./getContent/deepTransform.js";
5
5
  import { getBasePlugins, getContent } from "./getContent/getContent.js";
6
6
  import { getDictionary } from "./getDictionary.js";
@@ -9,4 +9,4 @@ import { getHTML } from "./getHTML.js";
9
9
  import { getIntlayer } from "./getIntlayer.js";
10
10
  import { getTranslation } from "./getTranslation.js";
11
11
  import { splitInsertionTemplate } from "./splitAndJoinInsertion.js";
12
- export { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, GetNestingResult, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, deepTransformNode, enumerationPlugin, filePlugin, findMatchingCondition, genderPlugin, getBasePlugins, getCondition, getContent, getDictionary, getEnumeration, getHTML, getIntlayer, getNesting, getTranslation, insertionPlugin, nestedPlugin, splitInsertionTemplate, translationPlugin };
12
+ export { ConditionCond, DeepTransformContent, EnumerationCond, FileCond, GenderCond, GetNestingResult, IInterpreterPlugin, IInterpreterPluginState, InsertionCond, IsAny, NestedCond, NodeProps, Plugins, TranslationCond, UnionKeys, ValueAtKey, conditionPlugin, deepTransformNode, enumerationPlugin, fallbackPlugin, filePlugin, findMatchingCondition, genderPlugin, getBasePlugins, getCondition, getContent, getDictionary, getEnumeration, getHTML, getIntlayer, getNesting, getTranslation, insertionPlugin, nestedPlugin, splitInsertionTemplate, translationPlugin };
@@ -1,21 +1,4 @@
1
1
  //#region src/interpreter/splitAndJoinInsertion.d.ts
2
- /**
3
- * Core logic for splitting insertion strings and joining with values.
4
- * Returns an array of parts that can be wrapped by framework-specific Fragment implementations.
5
- *
6
- * @param template - The template string with {{ placeholder }} syntax
7
- * @param values - Map of placeholder names to their replacement values
8
- * @returns Object with `isSimple` flag and `parts` array
9
- *
10
- * @example
11
- * ```ts
12
- * const result = splitInsertionTemplate('Hello {{ name }}!', { name: 'World' });
13
- * // { isSimple: true, parts: 'Hello World!' }
14
- *
15
- * const result = splitInsertionTemplate('Hello {{ name }}!', { name: <Component /> });
16
- * // { isSimple: false, parts: ['Hello ', <Component />, '!'] }
17
- * ```
18
- */
19
2
  declare const splitInsertionTemplate: <T = any>(template: string, values?: Record<string, T>) => {
20
3
  isSimple: boolean;
21
4
  parts: string | T[];
@@ -1 +1 @@
1
- {"version":3,"file":"splitAndJoinInsertion.d.ts","names":[],"sources":["../../../src/interpreter/splitAndJoinInsertion.ts"],"mappings":";;AA+BA;;;;;;;;;;;;;;;;cAAa,sBAAA,YACX,QAAA,UACA,MAAA,GAAQ,MAAA,SAAe,CAAA;EACpB,QAAA;EAAmB,KAAA,WAAgB,CAAA;AAAA"}
1
+ {"version":3,"file":"splitAndJoinInsertion.d.ts","names":[],"sources":["../../../src/interpreter/splitAndJoinInsertion.ts"],"mappings":";cAaa,sBAAA,YACX,QAAA,UACA,MAAA,GAAQ,MAAA,SAAe,CAAA;EACpB,QAAA;EAAmB,KAAA,WAAgB,CAAA;AAAA"}
@@ -0,0 +1,93 @@
1
+ import { LocalesValues } from "@intlayer/types/module_augmentation";
2
+ import { RoutingConfig } from "@intlayer/types/config";
3
+
4
+ //#region src/localization/generateSitemap.d.ts
5
+ type SitemapUrlEntry = {
6
+ /** The canonical path, e.g. '/dashboard' */path: string;
7
+ changefreq?: string;
8
+ priority?: number; /** ISO date string, e.g. '2024-01-15' */
9
+ lastmod?: string;
10
+ };
11
+ type GenerateSitemapOptions = {
12
+ /** Base site URL without trailing slash, e.g. 'https://example.com' */siteUrl: string;
13
+ /**
14
+ * Whether to include xhtml:link alternate tags for multilingual support.
15
+ *
16
+ * When enabled, alternate links are only generated for modes where URLs
17
+ * differ per locale:
18
+ * - 'prefix-no-default': included
19
+ * - 'prefix-all': included
20
+ * - 'search-params': included
21
+ * - 'no-prefix': excluded (all locales share the same URL)
22
+ *
23
+ * @default true
24
+ */
25
+ xhtmlLinks?: boolean;
26
+ locales?: LocalesValues[];
27
+ defaultLocale?: LocalesValues;
28
+ mode?: RoutingConfig['mode'];
29
+ rewrite?: RoutingConfig['rewrite'];
30
+ };
31
+ /**
32
+ * Generates a single `<url>` sitemap entry for the given path.
33
+ *
34
+ * Example:
35
+ *
36
+ * ```ts
37
+ * generateSitemapUrl('/dashboard', {
38
+ * siteUrl: 'https://example.com',
39
+ * changefreq: 'weekly',
40
+ * priority: 0.8,
41
+ * xhtmlLinks: true,
42
+ * locales: ['en', 'fr'],
43
+ * defaultLocale: 'en',
44
+ * mode: 'prefix-no-default',
45
+ * });
46
+ * // Returns:
47
+ * // <url>
48
+ * // <loc>https://example.com/dashboard</loc>
49
+ * // <changefreq>weekly</changefreq>
50
+ * // <priority>0.8</priority>
51
+ * // <xhtml:link rel="alternate" hrefLang="en" href="https://example.com/dashboard"/>
52
+ * // <xhtml:link rel="alternate" hrefLang="fr" href="https://example.com/fr/dashboard"/>
53
+ * // <xhtml:link rel="alternate" hrefLang="x-default" href="https://example.com/dashboard"/>
54
+ * // </url>
55
+ * ```
56
+ *
57
+ * @param path - The canonical path to generate the entry for.
58
+ * @param options - Configuration options.
59
+ * @returns A `<url>` XML string.
60
+ */
61
+ declare const generateSitemapUrl: (path: string, options: SitemapUrlEntry & GenerateSitemapOptions) => string;
62
+ /**
63
+ * Generates a full XML sitemap string from an array of URL entries.
64
+ *
65
+ * Automatically adds `xmlns:xhtml` to the `<urlset>` declaration when
66
+ * xhtml:link alternate tags are included.
67
+ *
68
+ * Example:
69
+ *
70
+ * ```ts
71
+ * generateSitemap(
72
+ * [
73
+ * { path: '/', changefreq: 'daily', priority: 1.0 },
74
+ * { path: '/about', changefreq: 'monthly', priority: 0.5 },
75
+ * ],
76
+ * {
77
+ * siteUrl: 'https://example.com',
78
+ * xhtmlLinks: true,
79
+ * locales: ['en', 'fr'],
80
+ * defaultLocale: 'en',
81
+ * mode: 'prefix-no-default',
82
+ * }
83
+ * );
84
+ * ```
85
+ *
86
+ * @param entries - Array of URL entries to include in the sitemap.
87
+ * @param options - Sitemap generation options.
88
+ * @returns A full XML sitemap string.
89
+ */
90
+ declare const generateSitemap: (entries: SitemapUrlEntry[], options: GenerateSitemapOptions) => string;
91
+ //#endregion
92
+ export { GenerateSitemapOptions, SitemapUrlEntry, generateSitemap, generateSitemapUrl };
93
+ //# sourceMappingURL=generateSitemap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateSitemap.d.ts","names":[],"sources":["../../../src/localization/generateSitemap.ts"],"mappings":";;;;KAKY,eAAA;8CAEV,IAAA;EACA,UAAA;EACA,QAAA,WAJyB;EAMzB,OAAA;AAAA;AAAA,KAGU,sBAAA;EAHV,uEAKA,OAAA;EALO;AAGT;;;;;;;;;;;EAeE,UAAA;EACA,OAAA,GAAU,aAAA;EACV,aAAA,GAAgB,aAAA;EAChB,IAAA,GAAO,aAAA;EACP,OAAA,GAAU,aAAA;AAAA;;;;;AA6CZ;;;;;;;;;;AA0EA;;;;;;;;;;;;;;;;cA1Ea,kBAAA,GACX,IAAA,UACA,OAAA,EAAS,eAAA,GAAkB,sBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwEhB,eAAA,GACX,OAAA,EAAS,eAAA,IACT,OAAA,EAAS,sBAAA"}
@@ -1,4 +1,4 @@
1
- import { LocaleStorageOptions } from "../utils/localeStorage.js";
1
+ import { LocaleStorageClientOptions } from "../utils/localeStorage.js";
2
2
  import { Locale } from "@intlayer/types/allLocales";
3
3
 
4
4
  //#region src/localization/getBrowserLocale.d.ts
@@ -8,7 +8,7 @@ declare enum LanguageDetector {
8
8
  Navigator = "navigator",
9
9
  HtmlTag = "htmlTag"
10
10
  }
11
- declare const localeStorageOptions: LocaleStorageOptions;
11
+ declare const localeStorageOptions: LocaleStorageClientOptions;
12
12
  type LanguageDetectorOptions = {
13
13
  order?: LanguageDetector[];
14
14
  lookupQuerystring?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"getBrowserLocale.d.ts","names":[],"sources":["../../../src/localization/getBrowserLocale.tsx"],"mappings":";;;;aASY,gBAAA;EACV,WAAA;EACA,OAAA;EACA,SAAA;EACA,OAAA;AAAA;AAAA,cAGW,oBAAA,EAAsB,oBAAA;AAAA,KA2B9B,uBAAA;EACH,KAAA,GAAQ,gBAAA;EACR,iBAAA;EACA,OAAA,GAAU,WAAA;AAAA;AA9BZ;;;;;AAwBE;;;;;;;;;;AAxBF,cA4La,gBAAA,GACX,WAAA,GAAa,uBAAA,iBACZ,MAAA"}
1
+ {"version":3,"file":"getBrowserLocale.d.ts","names":[],"sources":["../../../src/localization/getBrowserLocale.tsx"],"mappings":";;;;aASY,gBAAA;EACV,WAAA;EACA,OAAA;EACA,SAAA;EACA,OAAA;AAAA;AAAA,cAGW,oBAAA,EAAsB,0BAAA;AAAA,KA2B9B,uBAAA;EACH,KAAA,GAAQ,gBAAA;EACR,iBAAA;EACA,OAAA,GAAU,WAAA;AAAA;AA9BZ;;;;;AAwBE;;;;;;;;;;AAxBF,cA4La,gBAAA,GACX,WAAA,GAAa,uBAAA,iBACZ,MAAA"}
@@ -1,4 +1,4 @@
1
- import { ProcessedStorageAttributes, getStorageAttributes } from "../getStorageAttributes.js";
1
+ import { GenerateSitemapOptions, SitemapUrlEntry, generateSitemap, generateSitemapUrl } from "./generateSitemap.js";
2
2
  import { getBrowserLocale, localeStorageOptions } from "./getBrowserLocale.js";
3
3
  import { getHTMLTextDir } from "./getHTMLTextDir.js";
4
4
  import { getLocale } from "./getLocale.js";
@@ -14,4 +14,4 @@ import { localeFlatMap, localeMap, localeRecord } from "./localeMapper.js";
14
14
  import { localeResolver } from "./localeResolver.js";
15
15
  import { LocalizedPathResult, getCanonicalPath, getInternalPath, getLocalizedPath, getRewritePath, getRewriteRules } from "./rewriteUtils.js";
16
16
  import { validatePrefix } from "./validatePrefix.js";
17
- export { type GetPrefixOptions, type GetPrefixResult, type LocalizedPathResult, ProcessedStorageAttributes, getBrowserLocale, getCanonicalPath, getHTMLTextDir, getInternalPath, getLocale, getLocaleFromPath, getLocaleLang, getLocaleName, getLocalizedPath, getLocalizedUrl, getMultilingualUrls, getPathWithoutLocale, getPrefix, getRewritePath, getRewriteRules, getStorageAttributes, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, validatePrefix };
17
+ export { type GenerateSitemapOptions, type GetPrefixOptions, type GetPrefixResult, type LocalizedPathResult, type SitemapUrlEntry, generateSitemap, generateSitemapUrl, getBrowserLocale, getCanonicalPath, getHTMLTextDir, getInternalPath, getLocale, getLocaleFromPath, getLocaleLang, getLocaleName, getLocalizedPath, getLocalizedUrl, getMultilingualUrls, getPathWithoutLocale, getPrefix, getRewritePath, getRewriteRules, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, validatePrefix };
@@ -1 +1 @@
1
- {"version":3,"file":"getHTMLCustomComponents.d.ts","names":[],"sources":["../../../../src/transpiler/html/getHTMLCustomComponents.ts"],"mappings":";;AA6BA;;;;cAAa,uBAAA,GACX,OAAA,aACC,MAAA,SAAe,MAAA"}
1
+ {"version":3,"file":"getHTMLCustomComponents.d.ts","names":[],"sources":["../../../../src/transpiler/html/getHTMLCustomComponents.ts"],"mappings":";;AA2BA;;;;cAAa,uBAAA,GACX,OAAA,aACC,MAAA,SAAe,MAAA"}
@@ -1,8 +1,8 @@
1
- import { CachedIntl, WrappedIntl, bindIntl, createCachedIntl } from "./intl.js";
2
- import { LocaleStorage, LocaleStorageOptions, getLocaleFromStorage, setLocaleInStorage } from "./localeStorage.js";
1
+ import { CachedIntl, WrappedIntl, bindIntl, getCachedIntl } from "./intl.js";
2
+ import { CookieBuildAttributes, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer } from "./localeStorage.js";
3
3
  import { checkIsURLAbsolute } from "./checkIsURLAbsolute.js";
4
4
  import { getCookie } from "./getCookie.js";
5
5
  import { isSameKeyPath } from "./isSameKeyPath.js";
6
6
  import { isValidElement } from "./isValidReactElement.js";
7
7
  import { parseYaml } from "./parseYaml.js";
8
- export { CachedIntl, CachedIntl as Intl, LocaleStorage, LocaleStorageOptions, WrappedIntl, bindIntl, checkIsURLAbsolute, createCachedIntl, getCookie, getLocaleFromStorage, isSameKeyPath, isValidElement, parseYaml, setLocaleInStorage };
8
+ export { CachedIntl, CachedIntl as Intl, CookieBuildAttributes, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, WrappedIntl, bindIntl, checkIsURLAbsolute, getCachedIntl, getCookie, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, isSameKeyPath, isValidElement, parseYaml, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer };
@@ -7,27 +7,31 @@ type ReplaceLocaleWithLocalesValues<T> = T extends (new (locales: any, options?:
7
7
  new (options?: Options & {
8
8
  locale?: LocalesValues;
9
9
  }): Instance;
10
+ (locales?: LocalesValues, options?: Options): Instance;
11
+ (options?: Options & {
12
+ locale?: LocalesValues;
13
+ }): Instance;
10
14
  } : T extends (new (locales: any) => infer Instance) ? {
11
15
  new (locales?: LocalesValues): Instance;
12
16
  new (options?: {
13
17
  locale?: LocalesValues;
14
18
  }): Instance;
19
+ (locales?: LocalesValues): Instance;
20
+ (options?: {
21
+ locale?: LocalesValues;
22
+ }): Instance;
15
23
  } : T;
16
24
  type WrappedIntl = { [K in keyof typeof Intl]: K extends keyof IntlConstructors ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]> : (typeof Intl)[K] };
17
25
  /**
18
- * Factory that turns the global `Intl` into a cached clone.
26
+ * Generic caching instantiator for Intl constructors.
19
27
  */
20
- declare const createCachedIntl: () => WrappedIntl;
21
- declare const CachedIntl: WrappedIntl;
28
+ declare const getCachedIntl: <T extends new (...args: any[]) => any>(Ctor: T, locale?: LocalesValues | string, options?: any) => InstanceType<T>;
22
29
  /**
23
- * Creates a proxied Intl object with a preset locale.
24
- *
25
- * @example
26
- * const intl = bindIntl(Locales.FRENCH);
27
- * new intl.NumberFormat(undefined, { style: 'currency', currency: 'EUR' }).format(10);
28
- * // Uses 'fr' automatically
30
+ * Optional: Keep bindIntl if your library exports it publicly.
31
+ * It now uses the much smaller getCachedIntl under the hood.
29
32
  */
30
- declare const bindIntl: (locale: LocalesValues) => WrappedIntl;
33
+ declare const bindIntl: (boundLocale: LocalesValues) => WrappedIntl;
34
+ declare const CachedIntl: any;
31
35
  //#endregion
32
- export { CachedIntl, CachedIntl as Intl, WrappedIntl, bindIntl, createCachedIntl };
36
+ export { CachedIntl, CachedIntl as Intl, WrappedIntl, bindIntl, getCachedIntl };
33
37
  //# sourceMappingURL=intl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"intl.d.ts","names":[],"sources":["../../../src/utils/intl.ts"],"mappings":";;;KA8BK,gBAAA,wBACgB,IAAA,YAAgB,IAAA,EAAM,CAAA,mBACpC,IAAA,iBAED,CAAA,mBACgB,IAAA,EAAM,CAAA;AAAA,KAIvB,8BAAA,MAAoC,CAAA,eACvC,OAAA,OACA,OAAA;EAAA,KAGS,OAAA,GAAU,aAAA,EAAe,OAAA,GAAU,OAAA,GAAU,QAAA;EAAA,KAC7C,OAAA,GAAU,OAAA;IAAY,MAAA,GAAS,aAAA;EAAA,IAAkB,QAAA;AAAA,IAExD,CAAA,eACI,OAAA;EAAA,KAGK,OAAA,GAAU,aAAA,GAAgB,QAAA;EAAA,KAC1B,OAAA;IAAY,MAAA,GAAS,aAAA;EAAA,IAAkB,QAAA;AAAA,IAE9C,CAAA;AAAA,KAGM,WAAA,wBACS,IAAA,GAAO,CAAA,eAAgB,gBAAA,GACtC,8BAAA,SAAuC,IAAA,EAAM,CAAA,aACrC,IAAA,EAAM,CAAA;;;;cAuFP,gBAAA,QAAuB,WAAA;AAAA,cAiCvB,UAAA,EAAU,WAAA;;AAjJM;;;;;;;cA2JhB,QAAA,GAAY,MAAA,EAAQ,aAAA,KAAgB,WAAA"}
1
+ {"version":3,"file":"intl.d.ts","names":[],"sources":["../../../src/utils/intl.ts"],"mappings":";;;KAgCK,gBAAA,wBACgB,IAAA,YAAgB,IAAA,EAAM,CAAA,mBACpC,IAAA,iBAED,CAAA,mBACgB,IAAA,EAAM,CAAA;AAAA,KAGvB,8BAAA,MAAoC,CAAA,eACvC,OAAA,OACA,OAAA;EAAA,KAGS,OAAA,GAAU,aAAA,EAAe,OAAA,GAAU,OAAA,GAAU,QAAA;EAAA,KAC7C,OAAA,GAAU,OAAA;IAAY,MAAA,GAAS,aAAA;EAAA,IAAkB,QAAA;EAAA,CACrD,OAAA,GAAU,aAAA,EAAe,OAAA,GAAU,OAAA,GAAU,QAAA;EAAA,CAC7C,OAAA,GAAU,OAAA;IAAY,MAAA,GAAS,aAAA;EAAA,IAAkB,QAAA;AAAA,IAEpD,CAAA,eACI,OAAA;EAAA,KAGK,OAAA,GAAU,aAAA,GAAgB,QAAA;EAAA,KAC1B,OAAA;IAAY,MAAA,GAAS,aAAA;EAAA,IAAkB,QAAA;EAAA,CAC3C,OAAA,GAAU,aAAA,GAAgB,QAAA;EAAA,CAC1B,OAAA;IAAY,MAAA,GAAS,aAAA;EAAA,IAAkB,QAAA;AAAA,IAE1C,CAAA;AAAA,KAEM,WAAA,wBACS,IAAA,GAAO,CAAA,eAAgB,gBAAA,GACtC,8BAAA,SAAuC,IAAA,EAAM,CAAA,aACrC,IAAA,EAAM,CAAA;;;;cAMP,aAAA,qBAAmC,IAAA,iBAC9C,IAAA,EAAM,CAAA,EACN,MAAA,GAAS,aAAA,WACT,OAAA,WACC,YAAA,CAAa,CAAA;;;;;cA0BH,QAAA,GAAY,WAAA,EAAa,aAAA,KAAgB,WAAA;AAAA,cA+BzC,UAAA"}
@@ -3,62 +3,14 @@ import { Locale } from "@intlayer/types/allLocales";
3
3
 
4
4
  //#region src/utils/localeStorage.d.ts
5
5
  type CookieBuildAttributes = {
6
- /**
7
- * Cookie domain to store the locale information
8
- *
9
- * Default: undefined
10
- *
11
- * Define the domain where the cookie is available. Defaults to
12
- * the domain of the page where the cookie was created.
13
- */
14
6
  domain?: string;
15
- /**
16
- * Cookie path to store the locale information
17
- *
18
- * Default: undefined
19
- *
20
- * Define the path where the cookie is available. Defaults to '/'
21
- */
22
7
  path?: string;
23
- /**
24
- * Cookie secure to store the locale information
25
- *
26
- * Default: undefined
27
- *
28
- * A Boolean indicating if the cookie transmission requires a
29
- * secure protocol (https). Defaults to false.
30
- */
31
8
  secure?: boolean;
32
- /**
33
- * Cookie httpOnly to store the locale information
34
- *
35
- * Default: undefined
36
- *
37
- * The cookie httpOnly where the locale information is stored.
38
- */
39
9
  httpOnly?: boolean;
40
- /**
41
- * Cookie sameSite to store the locale information
42
- *
43
- * Default: undefined
44
- *
45
- * Asserts that a cookie must not be sent with cross-origin requests,
46
- * providing some protection against cross-site request forgery
47
- * attacks (CSRF)
48
- */
49
- sameSite?: 'strict' | 'lax' | 'none';
50
- /**
51
- * Cookie expires to store the locale information
52
- *
53
- * Default: undefined
54
- *
55
- * Define when the cookie will be removed. Value can be a Number
56
- * which will be interpreted as days from time of creation or a
57
- * Date instance. If omitted, the cookie becomes a session cookie.
58
- */
10
+ sameSite?: 'strict' | 'lax' | 'none'; /** Expiry as milliseconds since epoch (Date.getTime()) or number of days */
59
11
  expires?: number | undefined;
60
12
  };
61
- type LocaleStorageOptions = {
13
+ type LocaleStorageClientOptions = {
62
14
  overwrite?: boolean;
63
15
  isCookieEnabled?: boolean;
64
16
  setCookieStore?: (name: string, value: string, cookie: CookieBuildAttributes) => void;
@@ -68,41 +20,106 @@ type LocaleStorageOptions = {
68
20
  getSessionStorage?: (name: string) => string | undefined | null;
69
21
  setLocaleStorage?: (name: string, value: string) => void;
70
22
  getLocaleStorage?: (name: string) => string | undefined | null;
23
+ };
24
+ /**
25
+ * Retrieves the locale from browser storage mechanisms
26
+ * (cookies, localStorage, sessionStorage).
27
+ * Does not read from headers — use `getLocaleFromStorageServer` for that.
28
+ */
29
+ declare const getLocaleFromStorageClient: (options: LocaleStorageClientOptions) => Locale | undefined;
30
+ /**
31
+ * Stores the locale in browser storage mechanisms
32
+ * (cookies, localStorage, sessionStorage).
33
+ * Does not write to headers — use `setLocaleInStorageServer` for that.
34
+ */
35
+ declare const setLocaleInStorageClient: (locale: LocalesValues, options?: LocaleStorageClientOptions) => void;
36
+ /**
37
+ * Client-side locale storage utility.
38
+ * Handles cookies (browser), localStorage and sessionStorage.
39
+ * Does not access headers.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const storage = LocaleStorageClient(localeStorageOptions);
44
+ * const locale = storage.getLocale();
45
+ * storage.setLocale('fr');
46
+ * ```
47
+ */
48
+ declare const LocaleStorageClient: (options: LocaleStorageClientOptions) => {
49
+ getLocale: () => Locale;
50
+ setLocale: (locale: LocalesValues) => void;
51
+ };
52
+ type LocaleStorageServerOptions = {
53
+ overwrite?: boolean;
54
+ isCookieEnabled?: boolean;
55
+ setCookieStore?: (name: string, value: string, cookie: CookieBuildAttributes) => void;
56
+ setCookieString?: (name: string, cookie: string) => void;
57
+ getCookie?: (name: string) => string | undefined | null;
71
58
  getHeader?: (name: string) => string | undefined | null;
72
59
  setHeader?: (name: string, value: string) => void;
73
60
  };
74
61
  /**
75
- * Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
76
- * The function checks storage locations in order of priority as defined in the configuration.
62
+ * Retrieves the locale from server-side storage mechanisms (cookies, headers).
63
+ * Does not access localStorage or sessionStorage.
64
+ * No browser cookie fallback — the caller must provide `getCookie`.
65
+ */
66
+ declare const getLocaleFromStorageServer: (options: LocaleStorageServerOptions) => Locale | undefined;
67
+ /**
68
+ * Stores the locale in server-side storage mechanisms (cookies, headers).
69
+ * Does not write to localStorage or sessionStorage.
70
+ */
71
+ declare const setLocaleInStorageServer: (locale: LocalesValues, options?: LocaleStorageServerOptions) => void;
72
+ /**
73
+ * Server-side locale storage utility.
74
+ * Handles cookies (via injected getter/setter) and headers.
75
+ * Does not access localStorage or sessionStorage.
77
76
  *
78
- * @returns The locale if found in any storage, or undefined if not found
77
+ * @example
78
+ * ```ts
79
+ * const storage = LocaleStorageServer({
80
+ * getCookie: (name) => req.cookies[name],
81
+ * setCookieStore: (name, value, attrs) => res.cookie(name, value, attrs),
82
+ * getHeader: (name) => req.headers[name],
83
+ * setHeader: (name, value) => res.setHeader(name, value),
84
+ * });
85
+ * const locale = storage.getLocale();
86
+ * storage.setLocale('fr');
87
+ * ```
88
+ */
89
+ declare const LocaleStorageServer: (options: LocaleStorageServerOptions) => {
90
+ getLocale: () => Locale;
91
+ setLocale: (locale: LocalesValues) => void;
92
+ };
93
+ /**
94
+ * @deprecated Use {@link LocaleStorageClientOptions} or {@link LocaleStorageServerOptions} instead.
95
+ */
96
+ type LocaleStorageOptions = LocaleStorageClientOptions & LocaleStorageServerOptions;
97
+ /**
98
+ * Retrieves the locale from all storage mechanisms
99
+ * (cookies, localStorage, sessionStorage, headers).
100
+ *
101
+ * @deprecated Use {@link getLocaleFromStorageClient} (browser) or
102
+ * {@link getLocaleFromStorageServer} (server) instead.
79
103
  */
80
104
  declare const getLocaleFromStorage: (options: Pick<LocaleStorageOptions, "getCookie" | "getSessionStorage" | "getLocaleStorage" | "getHeader" | "isCookieEnabled">) => Locale | undefined;
81
105
  /**
82
- * Stores the locale in various storage mechanisms (cookies, localStorage, sessionStorage, headers).
83
- * The function writes to all configured storage locations according to their attributes.
84
- * Respects overwrite flags for localStorage and sessionStorage.
106
+ * Stores the locale in all configured storage mechanisms
107
+ * (cookies, localStorage, sessionStorage, headers).
85
108
  *
86
- * @param locale - The locale to store
109
+ * @deprecated Use {@link setLocaleInStorageClient} (browser) or
110
+ * {@link setLocaleInStorageServer} (server) instead.
87
111
  */
88
112
  declare const setLocaleInStorage: (locale: LocalesValues, options?: LocaleStorageOptions) => void;
89
113
  /**
90
- * Utility object to get and set the locale in the storage by considering the configuration
91
- *
92
- * @property getLocale - Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
93
- * Retrieves the locale from various storage mechanisms (cookies, localStorage, sessionStorage, headers).
94
- * The function checks storage locations in order of priority as defined in the configuration.
95
- *
96
- * @property setLocale - Stores the locale in various storage mechanisms (cookies, localStorage, sessionStorage, headers).
97
- * The function writes to all configured storage locations according to their attributes.
98
- * Respects overwrite flags for localStorage and sessionStorage.
114
+ * Utility object to get and set the locale in storage based on configuration.
99
115
  *
100
- * @returns The locale if found in any storage, or undefined if not found
116
+ * @deprecated Use {@link LocaleStorageClient} (browser) or
117
+ * {@link LocaleStorageServer} (server) instead.
101
118
  */
102
119
  declare const LocaleStorage: (options: LocaleStorageOptions) => {
103
120
  getLocale: () => Locale;
104
121
  setLocale: (locale: LocalesValues) => void;
105
122
  };
106
123
  //#endregion
107
- export { LocaleStorage, LocaleStorageOptions, getLocaleFromStorage, setLocaleInStorage };
124
+ export { CookieBuildAttributes, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer };
108
125
  //# sourceMappingURL=localeStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"localeStorage.d.ts","names":[],"sources":["../../../src/utils/localeStorage.ts"],"mappings":";;;;KAOK,qBAAA;;AAJoE;;;;;;;EAavE,MAAA;EAmCA;;;;AAgCF;;;EA3DE,IAAA;EA4DA;;;;;;;;EAnDA,MAAA;EA0DiC;;;;;;;EAlDjC,QAAA;EAsDA;;;;;;;;;EA5CA,QAAA;EA+CwC;;AAS1C;;;;;;;EA7CE,OAAA;AAAA;AAAA,KAqBU,oBAAA;EACV,SAAA;EACA,eAAA;EACA,cAAA,IACE,IAAA,UACA,KAAA,UACA,MAAA,EAAQ,qBAAA;EAEV,eAAA,IAAmB,IAAA,UAAc,MAAA;EACjC,SAAA,IAAa,IAAA;EACb,iBAAA,IAAqB,IAAA,UAAc,KAAA;EACnC,iBAAA,IAAqB,IAAA;EACrB,gBAAA,IAAoB,IAAA,UAAc,KAAA;EAClC,gBAAA,IAAoB,IAAA;EACpB,SAAA,IAAa,IAAA;EACb,SAAA,IAAa,IAAA,UAAc,KAAA;AAAA;;;AAmM7B;;;;cA1La,oBAAA,GACX,OAAA,EAAS,IAAA,CACP,oBAAA,gGAO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AAA,EAAS,0BAAA;;sBAEvB,aAAA;AAAA;;;;KAYV,oBAAA,GAAuB,0BAAA,GACjC,0BAAA;;;;;;;;cASW,oBAAA,GACX,OAAA,EAAS,IAAA,CACP,oBAAA,gGAOD,MAAA;AA3HH;;;;;;;AAAA,cAoLa,kBAAA,GACX,MAAA,EAAQ,aAAA,EACR,OAAA,GAAU,oBAAA;;AAvJZ;;;;;cA6Na,aAAA,GAAiB,OAAA,EAAS,oBAAA;;sBAEjB,aAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "8.5.2",
3
+ "version": "8.6.1",
4
4
  "private": false,
5
5
  "description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
6
6
  "keywords": [
@@ -168,11 +168,11 @@
168
168
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
169
169
  },
170
170
  "dependencies": {
171
- "@intlayer/api": "8.5.2",
172
- "@intlayer/config": "8.5.1",
173
- "@intlayer/dictionaries-entry": "8.5.2",
174
- "@intlayer/types": "8.5.2",
175
- "@intlayer/unmerged-dictionaries-entry": "8.5.2",
171
+ "@intlayer/api": "8.6.1",
172
+ "@intlayer/config": "8.6.1",
173
+ "@intlayer/dictionaries-entry": "8.6.1",
174
+ "@intlayer/types": "8.6.1",
175
+ "@intlayer/unmerged-dictionaries-entry": "8.6.1",
176
176
  "defu": "6.1.4"
177
177
  },
178
178
  "devDependencies": {
@@ -181,9 +181,9 @@
181
181
  "@utils/ts-config-types": "1.0.4",
182
182
  "@utils/tsdown-config": "1.0.4",
183
183
  "rimraf": "6.1.3",
184
- "tsdown": "0.21.4",
184
+ "tsdown": "0.21.7",
185
185
  "typescript": "6.0.2",
186
- "vitest": "4.1.1"
186
+ "vitest": "4.1.2"
187
187
  },
188
188
  "engines": {
189
189
  "node": ">=14.18"