@intlayer/core 9.2.0 → 9.3.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.
- package/README.md +24 -24
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/deepTransformPlugins/getEditedContent.cjs +10 -6
- package/dist/cjs/deepTransformPlugins/getEditedContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs +2 -1
- package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -1
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +41 -32
- package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +6 -5
- package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/getNestedDictionaryReferences.cjs +153 -0
- package/dist/cjs/dictionaryManipulator/getNestedDictionaryReferences.cjs.map +1 -0
- package/dist/cjs/dictionaryManipulator/index.cjs +16 -9
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +4 -3
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs +4 -3
- package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs +1 -171
- package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/qualifiedDictionary.test-d.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/qualifiedDictionaryDeclaration.cjs +69 -0
- package/dist/cjs/dictionaryManipulator/qualifiedDictionaryDeclaration.cjs.map +1 -0
- package/dist/cjs/dictionaryManipulator/qualifiedDynamicLoader.cjs +115 -0
- package/dist/cjs/dictionaryManipulator/qualifiedDynamicLoader.cjs.map +1 -0
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +4 -2
- package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +11 -9
- package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
- package/dist/cjs/formatters/date.cjs +2 -1
- package/dist/cjs/formatters/date.cjs.map +1 -1
- package/dist/cjs/formatters/relativeTime.cjs +3 -3
- package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
- package/dist/cjs/index.cjs +16 -9
- package/dist/cjs/interpreter/getCondition.cjs +0 -1
- package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
- package/dist/cjs/interpreter/getContent/plugins.cjs +12 -1
- package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
- package/dist/cjs/interpreter/getDictionary.cjs +2 -1
- package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
- package/dist/cjs/interpreter/getEnumeration.cjs +0 -1
- package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
- package/dist/cjs/interpreter/getGender.cjs +0 -1
- package/dist/cjs/interpreter/getGender.cjs.map +1 -1
- package/dist/cjs/interpreter/getHTML.cjs +0 -1
- package/dist/cjs/interpreter/getHTML.cjs.map +1 -1
- package/dist/cjs/interpreter/getInsertion.cjs +0 -1
- package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
- package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
- package/dist/cjs/interpreter/getIntlayer.test-d.cjs.map +1 -1
- package/dist/cjs/interpreter/getNesting.optimized.cjs +59 -0
- package/dist/cjs/interpreter/getNesting.optimized.cjs.map +1 -0
- package/dist/cjs/interpreter/getSelect.cjs +0 -1
- package/dist/cjs/interpreter/getSelect.cjs.map +1 -1
- package/dist/cjs/interpreter/getTranslation.cjs +0 -1
- package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
- package/dist/cjs/interpreter/splitAndJoinInsertion.cjs +0 -1
- package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
- package/dist/cjs/localization/domainUtils.cjs +0 -1
- package/dist/cjs/localization/domainUtils.cjs.map +1 -1
- package/dist/cjs/localization/getBrowserLocale.cjs +2 -1
- package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
- package/dist/cjs/localization/getHTMLTextDir.cjs +0 -1
- package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
- package/dist/cjs/localization/getLocale.cjs +2 -1
- package/dist/cjs/localization/getLocale.cjs.map +1 -1
- package/dist/cjs/localization/getLocaleLang.cjs +0 -1
- package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
- package/dist/cjs/localization/localeDetector.cjs +2 -1
- package/dist/cjs/localization/localeDetector.cjs.map +1 -1
- package/dist/cjs/localization/proxyMode.cjs.map +1 -1
- package/dist/cjs/localization/rewriteUtils.cjs +0 -1
- package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
- package/dist/cjs/markdown/compiler.cjs +9 -6
- package/dist/cjs/markdown/compiler.cjs.map +1 -1
- package/dist/cjs/markdown/constants.cjs +0 -1
- package/dist/cjs/markdown/constants.cjs.map +1 -1
- package/dist/cjs/markdown/utils.cjs.map +1 -1
- package/dist/cjs/messageFormat/ICU.cjs +17 -14
- package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
- package/dist/cjs/messageFormat/i18next.cjs +4 -2
- package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
- package/dist/cjs/messageFormat/navigatePath.cjs +0 -1
- package/dist/cjs/messageFormat/navigatePath.cjs.map +1 -1
- package/dist/cjs/messageFormat/resolveMessage.cjs +2 -1
- package/dist/cjs/messageFormat/resolveMessage.cjs.map +1 -1
- package/dist/cjs/messageFormat/verify-icu-format.cjs +3 -2
- package/dist/cjs/messageFormat/verify-icu-format.cjs.map +1 -1
- package/dist/cjs/messageFormat/vue-i18n.cjs +2 -1
- package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
- package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
- package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
- package/dist/cjs/transpiler/file/file.cjs +2 -1
- package/dist/cjs/transpiler/file/file.cjs.map +1 -1
- package/dist/cjs/transpiler/file/fileBrowser.cjs +0 -1
- package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
- package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
- package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +0 -1
- package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -1
- package/dist/cjs/transpiler/html/html.cjs.map +1 -1
- package/dist/cjs/transpiler/html/htmlTags.cjs +0 -1
- package/dist/cjs/transpiler/html/htmlTags.cjs.map +1 -1
- package/dist/cjs/transpiler/html/validateHTML.cjs +12 -12
- package/dist/cjs/transpiler/html/validateHTML.cjs.map +1 -1
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +0 -1
- package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
- package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +2 -1
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/markdown.cjs +2 -1
- package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
- package/dist/cjs/transpiler/markdown/validateMarkdown.cjs +7 -6
- package/dist/cjs/transpiler/markdown/validateMarkdown.cjs.map +1 -1
- package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
- package/dist/cjs/transpiler/plural/plural.cjs.map +1 -1
- package/dist/cjs/transpiler/select/select.cjs.map +1 -1
- package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
- package/dist/cjs/utils/checkIsURLAbsolute.cjs +0 -1
- package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
- package/dist/cjs/utils/cookieExpiry.cjs +0 -1
- package/dist/cjs/utils/cookieExpiry.cjs.map +1 -1
- package/dist/cjs/utils/getCookie.cjs +0 -1
- package/dist/cjs/utils/getCookie.cjs.map +1 -1
- package/dist/cjs/utils/isSameKeyPath.cjs +0 -1
- package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
- package/dist/cjs/utils/isValidReactElement.cjs +0 -1
- package/dist/cjs/utils/isValidReactElement.cjs.map +1 -1
- package/dist/cjs/utils/parseYaml.cjs +0 -1
- package/dist/cjs/utils/parseYaml.cjs.map +1 -1
- package/dist/cjs/utils/stringifyYaml.cjs +0 -1
- package/dist/cjs/utils/stringifyYaml.cjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getEditedContent.mjs +10 -6
- package/dist/esm/deepTransformPlugins/getEditedContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs +2 -1
- package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -1
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs +41 -32
- package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +6 -5
- package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/getNestedDictionaryReferences.mjs +150 -0
- package/dist/esm/dictionaryManipulator/getNestedDictionaryReferences.mjs.map +1 -0
- package/dist/esm/dictionaryManipulator/index.mjs +5 -2
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +4 -3
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs +2 -1
- package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs +1 -162
- package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/qualifiedDictionaryDeclaration.mjs +64 -0
- package/dist/esm/dictionaryManipulator/qualifiedDictionaryDeclaration.mjs.map +1 -0
- package/dist/esm/dictionaryManipulator/qualifiedDynamicLoader.mjs +111 -0
- package/dist/esm/dictionaryManipulator/qualifiedDynamicLoader.mjs.map +1 -0
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +4 -2
- package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +11 -9
- package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
- package/dist/esm/formatters/date.mjs +2 -1
- package/dist/esm/formatters/date.mjs.map +1 -1
- package/dist/esm/formatters/relativeTime.mjs +3 -3
- package/dist/esm/formatters/relativeTime.mjs.map +1 -1
- package/dist/esm/index.mjs +5 -2
- package/dist/esm/interpreter/getContent/plugins.mjs +12 -1
- package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
- package/dist/esm/interpreter/getDictionary.mjs +2 -1
- package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
- package/dist/esm/interpreter/getNesting.optimized.mjs +58 -0
- package/dist/esm/interpreter/getNesting.optimized.mjs.map +1 -0
- package/dist/esm/localization/getBrowserLocale.mjs +2 -1
- package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
- package/dist/esm/localization/getLocale.mjs +2 -1
- package/dist/esm/localization/getLocale.mjs.map +1 -1
- package/dist/esm/localization/localeDetector.mjs +2 -1
- package/dist/esm/localization/localeDetector.mjs.map +1 -1
- package/dist/esm/markdown/compiler.mjs +9 -6
- package/dist/esm/markdown/compiler.mjs.map +1 -1
- package/dist/esm/markdown/utils.mjs.map +1 -1
- package/dist/esm/messageFormat/ICU.mjs +17 -14
- package/dist/esm/messageFormat/ICU.mjs.map +1 -1
- package/dist/esm/messageFormat/i18next.mjs +4 -2
- package/dist/esm/messageFormat/i18next.mjs.map +1 -1
- package/dist/esm/messageFormat/resolveMessage.mjs +2 -1
- package/dist/esm/messageFormat/resolveMessage.mjs.map +1 -1
- package/dist/esm/messageFormat/verify-icu-format.mjs +3 -2
- package/dist/esm/messageFormat/verify-icu-format.mjs.map +1 -1
- package/dist/esm/messageFormat/vue-i18n.mjs +2 -1
- package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
- package/dist/esm/transpiler/file/file.mjs +2 -1
- package/dist/esm/transpiler/file/file.mjs.map +1 -1
- package/dist/esm/transpiler/html/validateHTML.mjs +12 -11
- package/dist/esm/transpiler/html/validateHTML.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +2 -1
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/markdown.mjs +2 -1
- package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
- package/dist/esm/transpiler/markdown/validateMarkdown.mjs +7 -6
- package/dist/esm/transpiler/markdown/validateMarkdown.mjs.map +1 -1
- package/dist/esm/utils/parseYaml.mjs.map +1 -1
- package/dist/types/deepTransformPlugins/getEditedContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +1 -0
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +1 -0
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +1 -0
- package/dist/types/dictionaryManipulator/getNestedDictionaryReferences.d.ts +62 -0
- package/dist/types/dictionaryManipulator/getNestedDictionaryReferences.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/index.d.ts +5 -2
- package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts +18 -126
- package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts.map +1 -1
- package/dist/types/dictionaryManipulator/qualifiedDictionaryDeclaration.d.ts +41 -0
- package/dist/types/dictionaryManipulator/qualifiedDictionaryDeclaration.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/qualifiedDynamicLoader.d.ts +93 -0
- package/dist/types/dictionaryManipulator/qualifiedDynamicLoader.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/interpreter/getContent/plugins.d.ts +10 -0
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/interpreter/getNesting.optimized.d.ts +33 -0
- package/dist/types/interpreter/getNesting.optimized.d.ts.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Dictionary, DictionaryQualifierType } from "@intlayer/types/dictionary";
|
|
2
|
+
//#region src/dictionaryManipulator/qualifiedDictionaryDeclaration.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Canonical order of qualifier dimensions. A key that declares both dimensions
|
|
5
|
+
* always nests them in this order, with `item` innermost so it can act as the
|
|
6
|
+
* collection (array) axis.
|
|
7
|
+
*/
|
|
8
|
+
declare const QUALIFIER_ORDER: readonly ["variant", "item"];
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes the `variant` field of a dictionary into the list of variant ids
|
|
11
|
+
* the declaration registers under. A single value yields one id; an **array**
|
|
12
|
+
* fans out into one id per element (duplicates collapsed). Returns `undefined`
|
|
13
|
+
* when the dictionary does not declare the variant dimension (no `variant`
|
|
14
|
+
* field, or an empty array).
|
|
15
|
+
*/
|
|
16
|
+
declare const getVariantIds: (variant: Dictionary['variant']) => string[] | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the qualifier dimensions declared on a dictionary, in canonical
|
|
19
|
+
* order (`variant → item`). Empty when the dictionary is unqualified
|
|
20
|
+
* (plain dictionary or shared base content of a qualified group).
|
|
21
|
+
*/
|
|
22
|
+
declare const getDictionaryQualifierTypes: (dictionary: Dictionary) => DictionaryQualifierType[];
|
|
23
|
+
/**
|
|
24
|
+
* Returns the qualifier identifiers of a dictionary for the given qualifier
|
|
25
|
+
* dimension — the candidate segments of the composite entry ids.
|
|
26
|
+
*
|
|
27
|
+
* - 'variant' → the serialized variant id(s); an array variant yields one id
|
|
28
|
+
* per element (declaration-side fan-out)
|
|
29
|
+
* - 'item' → the item index as a single-element list
|
|
30
|
+
*/
|
|
31
|
+
declare const getDictionaryQualifierIds: (dictionary: Dictionary, qualifierType: DictionaryQualifierType) => string[] | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Builds every composite entry id of a dictionary — the cartesian product of
|
|
34
|
+
* its per-dimension id lists, joined in canonical order. A dictionary with a
|
|
35
|
+
* plain (non-array) variant yields exactly one id; an array variant fans out
|
|
36
|
+
* into one id per element. `undefined` when a dimension of the set is missing.
|
|
37
|
+
*/
|
|
38
|
+
declare const getDictionaryCompositeIds: (dictionary: Dictionary, qualifierTypes: DictionaryQualifierType[]) => string[] | undefined;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getVariantIds };
|
|
41
|
+
//# sourceMappingURL=qualifiedDictionaryDeclaration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifiedDictionaryDeclaration.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/qualifiedDictionaryDeclaration.ts"],"mappings":";;;;;;;cAca;;;;;;;;cAYA,gBAAa,SACf;;;;;;cAeE,8BAA2B,YAC1B,eACX;;;;;;;;;cAmBU,4BAAyB,YACxB,YAAU,eACP;;;;;;;cAcJ,4BAAyB,YACxB,YAAU,gBACN"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Dictionary, DictionaryQualifierType, DictionarySelector } from "@intlayer/types/dictionary";
|
|
2
|
+
//#region src/dictionaryManipulator/qualifiedDynamicLoader.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Marker property carrying the ordered qualifier dimensions on a dynamic loader
|
|
5
|
+
* map. Its presence distinguishes a qualified group loader map (a nested tree
|
|
6
|
+
* of chunks) from a plain dynamic loader map (one chunk per `locale`). Prefixed
|
|
7
|
+
* and unlikely to collide with a real locale code.
|
|
8
|
+
*/
|
|
9
|
+
declare const QUALIFIER_DYNAMIC_TYPES_KEY = "__intlayerQualifierTypes";
|
|
10
|
+
/**
|
|
11
|
+
* A lazily-imported per-locale dictionary chunk loader.
|
|
12
|
+
*/
|
|
13
|
+
type DynamicDictionaryLoader = () => Promise<Dictionary>;
|
|
14
|
+
/**
|
|
15
|
+
* Nested tree of chunk loaders: one nesting level per declared dimension (in
|
|
16
|
+
* canonical order), leaves are loaders.
|
|
17
|
+
*/
|
|
18
|
+
type QualifiedDynamicLoaderTree = {
|
|
19
|
+
[segment: string]: QualifiedDynamicLoaderTree | DynamicDictionaryLoader;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Default export shape of a generated dynamic entry point for a qualified key.
|
|
23
|
+
* One nesting level per dimension under each locale, plus the dimension marker.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* {
|
|
27
|
+
* __intlayerQualifierTypes: ['variant', 'item'],
|
|
28
|
+
* en: { promo: { '1': () => import('./json/x/promo/1/en.json'), … }, … },
|
|
29
|
+
* fr: { … },
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
type QualifiedDynamicLoaderMap = {
|
|
34
|
+
[QUALIFIER_DYNAMIC_TYPES_KEY]: DictionaryQualifierType[];
|
|
35
|
+
[locale: string]: QualifiedDynamicLoaderTree | DictionaryQualifierType[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Type guard discriminating a qualified dynamic loader map (collections /
|
|
39
|
+
* variants, possibly combined) from a plain dynamic loader map.
|
|
40
|
+
*/
|
|
41
|
+
declare const isQualifiedDynamicLoaderMap: (value: unknown) => value is QualifiedDynamicLoaderMap;
|
|
42
|
+
/**
|
|
43
|
+
* Resolves the content of a qualified dynamic loader map against a selector,
|
|
44
|
+
* loading only the chunk(s) the selector actually targets.
|
|
45
|
+
*
|
|
46
|
+
* Walks the nested loader tree one dimension at a time (canonical order
|
|
47
|
+
* `variant → item`): `variant` descends by the serialized id, falling back to
|
|
48
|
+
* `default` when the selected variant has no chunk of its own, and `item`
|
|
49
|
+
* either narrows to the selected index or — when no item is given — expands
|
|
50
|
+
* into every sibling chunk (the collection axis). Semantics mirror
|
|
51
|
+
* `resolveQualifiedDictionary` so dynamic and static modes behave alike.
|
|
52
|
+
*
|
|
53
|
+
* The Suspense mechanism is injected through `loadChunk` so the same logic
|
|
54
|
+
* serves both the client (suspender cache) and the server (`react.use`). Every
|
|
55
|
+
* targeted loader is started before the first chunk is read, so sibling chunks
|
|
56
|
+
* load in parallel rather than waterfalling.
|
|
57
|
+
*
|
|
58
|
+
* @param loaderMap - The qualified dynamic loader map (entry point default export).
|
|
59
|
+
* @param key - The dictionary key (used to build stable chunk cache keys).
|
|
60
|
+
* @param locale - The resolved locale to load chunks for.
|
|
61
|
+
* @param selector - The selector splitting the qualifier dimensions.
|
|
62
|
+
* @param loadChunk - Reads a started chunk promise, suspending until it resolves.
|
|
63
|
+
* @param transform - Turns a resolved chunk dictionary into final content.
|
|
64
|
+
*/
|
|
65
|
+
declare const resolveQualifiedDynamicContent: <Content>(params: {
|
|
66
|
+
loaderMap: QualifiedDynamicLoaderMap;
|
|
67
|
+
key: string;
|
|
68
|
+
locale: string;
|
|
69
|
+
selector: DictionarySelector | undefined;
|
|
70
|
+
loadChunk: (cacheKey: string, promise: Promise<Dictionary>) => Dictionary;
|
|
71
|
+
transform: (dictionary: Dictionary) => Content;
|
|
72
|
+
}) => Content | Content[] | null;
|
|
73
|
+
/**
|
|
74
|
+
* Async counterpart of {@link resolveQualifiedDynamicContent} for frameworks
|
|
75
|
+
* that load dictionaries with `await` instead of Suspense (Vue, Svelte, Lit,
|
|
76
|
+
* vanilla). Awaits every targeted chunk in parallel, then resolves identically.
|
|
77
|
+
*
|
|
78
|
+
* @param loaderMap - The qualified dynamic loader map.
|
|
79
|
+
* @param key - The dictionary key (used to build stable chunk cache keys).
|
|
80
|
+
* @param locale - The resolved locale to load chunks for.
|
|
81
|
+
* @param selector - The selector splitting the qualifier dimensions.
|
|
82
|
+
* @param transform - Turns a resolved chunk dictionary into final content.
|
|
83
|
+
*/
|
|
84
|
+
declare const resolveQualifiedDynamicContentAsync: <Content>(params: {
|
|
85
|
+
loaderMap: QualifiedDynamicLoaderMap;
|
|
86
|
+
key: string;
|
|
87
|
+
locale: string;
|
|
88
|
+
selector: DictionarySelector | undefined;
|
|
89
|
+
transform: (dictionary: Dictionary) => Content;
|
|
90
|
+
}) => Promise<Content | Content[] | null>;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, isQualifiedDynamicLoaderMap, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync };
|
|
93
|
+
//# sourceMappingURL=qualifiedDynamicLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifiedDynamicLoader.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/qualifiedDynamicLoader.ts"],"mappings":";;;;;;;;cAiBa;;;;KAKD,gCAAgC,QAAQ;;;;;KAMxC;GACT,kBAAkB,6BAA6B;;;;;;;;;;;;;;KAetC;GACT,8BAA8B;GAC9B,iBAAiB,6BAA6B;;;;;;cAOpC,8BAA2B,mBAErC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;cAiHC,iCAAkC,SAAO;EACpD,WAAW;EACX;EACA;EACA,UAAU;EACV,YAAY,kBAAkB,SAAS,QAAQ,gBAAgB;EAC/D,YAAY,YAAY,eAAe;MACrC,UAAU;;;;;;;;;;;;cAkCD,sCAA6C,SAAO;EAC/D,WAAW;EACX;EACA;EACA,UAAU;EACV,YAAY,YAAY,eAAe;MACrC,QAAQ,UAAU"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -48,13 +48,16 @@ import { editDictionaryByKeyPath } from "./dictionaryManipulator/editDictionaryB
|
|
|
48
48
|
import { getContentNodeByKeyPath } from "./dictionaryManipulator/getContentNodeByKeyPath.js";
|
|
49
49
|
import { getDefaultNode } from "./dictionaryManipulator/getDefaultNode.js";
|
|
50
50
|
import { getEmptyNode } from "./dictionaryManipulator/getEmptyNode.js";
|
|
51
|
+
import { NestedFieldReferences, getNestedDictionaryGraph, getNestedDictionaryKeys, getNestedDictionaryReferences } from "./dictionaryManipulator/getNestedDictionaryReferences.js";
|
|
51
52
|
import { getNodeChildren } from "./dictionaryManipulator/getNodeChildren.js";
|
|
52
53
|
import { getNodeType } from "./dictionaryManipulator/getNodeType.js";
|
|
53
54
|
import { mergeDictionaries } from "./dictionaryManipulator/mergeDictionaries.js";
|
|
54
55
|
import { mergeQualifiedDictionaries } from "./dictionaryManipulator/mergeQualifiedDictionaries.js";
|
|
55
56
|
import { normalizeDictionaries, normalizeDictionary } from "./dictionaryManipulator/normalizeDictionary.js";
|
|
56
57
|
import { orderDictionaries } from "./dictionaryManipulator/orderDictionaries.js";
|
|
57
|
-
import { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID,
|
|
58
|
+
import { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, parseDictionarySelector, reconstructQualifiedEntry, resolveDictionaryArgument, resolveEffectiveVariantId, resolveProviderVariant, resolveQualifiedDictionary, serializeVariant, serializeVariantChain } from "./dictionaryManipulator/qualifiedDictionary.js";
|
|
59
|
+
import { QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getVariantIds } from "./dictionaryManipulator/qualifiedDictionaryDeclaration.js";
|
|
60
|
+
import { DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, isQualifiedDynamicLoaderMap, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync } from "./dictionaryManipulator/qualifiedDynamicLoader.js";
|
|
58
61
|
import { removeContentNodeByKeyPath } from "./dictionaryManipulator/removeContentNodeByKeyPath.js";
|
|
59
62
|
import { renameContentNodeByKeyPath } from "./dictionaryManipulator/renameContentNodeByKeyPath.js";
|
|
60
63
|
import { updateNodeChildren } from "./dictionaryManipulator/updateNodeChildren.js";
|
|
@@ -111,4 +114,4 @@ import { CookieBuildAttributes, LocaleStorage, LocaleStorageClient, LocaleStorag
|
|
|
111
114
|
import { YamlRecord, YamlValue, parseYaml } from "./utils/parseYaml.js";
|
|
112
115
|
import { stringifyYaml } from "./utils/stringifyYaml.js";
|
|
113
116
|
import "./utils/index.js";
|
|
114
|
-
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, type BlockQuoteNode, type BoldTextNode, type BreakLineNode, type BreakThematicNode, CAPTURE_LETTER_AFTER_HYPHEN, CODE_BLOCK_FENCED_R, CODE_BLOCK_R, CODE_INLINE_R, COMPOSITE_ID_SEPARATOR, CONSECUTIVE_NEWLINE_R, CR_NEWLINE_R, CUSTOM_COMPONENT_R, CachedIntl, CachedIntl as Intl, type CodeBlockNode, type CodeFencedNode, type CodeInlineNode, type CompileOptions, type ComponentOverrides, ConditionCond, ConditionContent, ConditionContentStates, CookieBuildAttributes, type CustomComponentNode, DEFAULT_VARIANT_ID, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, DateTimePreset, DeepTransformContent, DotPath, DynamicDictionaryLoader, type ElementType, EnterFormat, EnumerationCond, EnumerationContent, EnumerationContentState, type EscapedTextNode, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, FileCond, type FileContent, type FileContentConstructor, type FootnoteNode, type FootnoteReferenceNode, type GFMTaskNode, GFM_TASK_R, Gender, GenderCond, GenderContent, GenderContentStates, type GenerateSitemapOptions, GetNestingResult, type GetPrefixOptions, type GetPrefixResult, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, type HTMLCommentNode, HTMLContent, HTMLContentConstructor, type HTMLNode, type HTMLSelfClosingNode, type 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, type HeadingNode, type HeadingSetextNode, IInterpreterPlugin, IInterpreterPluginState, INLINE_SKIP_R, INTERPOLATION_R, type ImageNode, InsertionCond, InsertionContent, InsertionContentConstructor, InterpolableNode, IntlConstructorName, IsAny, type ItalicTextNode, JsonValue, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, type LinkAngleBraceNode, type LinkBareURLNode, type LinkNode, ListType, type LocaleDomainMap, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, type LocalizedPathResult, MarkdownContent, MarkdownContentConstructor, type MarkdownContext, type MarkdownOptions, type MarkdownRuntime, type HTMLValidationIssue as MarkdownValidationIssue, MarkdownValidationResult, type MarkedTextNode, MessageFormatDialect, MessageValues, NAMED_CODES_TO_UNICODE, NP_TABLE_R, NestedCond, NestedContent, NestedContentState, type NestedParser, type NewlineNode, NodeProps, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, type OrderedListNode, PARAGRAPH_R, type ParagraphNode, type ParseState, ParsedMarkdown, type Parser, type ParserResult, Plugins, PluralCategory, PluralCond, PluralContent, PluralContentState, PortableObject, Priority, PriorityValue, type ProxyMode, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, type ReferenceImageNode, type ReferenceLinkNode, type ReferenceNode, type RenderRuleHook, type Rule, type RuleOutput, RuleType, RuleTypeValue, type Rules, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, SelectCond, SelectContent, SelectContentStates, SelectSelector, type SitemapUrlEntry, type 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, type TableNode, type TableSeparatorNode, TaggedMessageToken, type 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, type UnorderedListNode, VOID_HTML_ELEMENTS, ValidDotPathsFor, ValueAtKey, WrappedIntl, YamlRecord, YamlValue, allowInline, anyScopeRegex, attributeValueToNodePropValue, bindIntl, blockRegex, buildMaskPlugin, captureNothing, checkIsURLAbsolute, checkMissingLocalesPlugin, compact, comparePaths, compile, compileWithOptions, condition as cond, conditionPlugin, createCompiler, createRenderer, currency, cx, date, deepTransformNode, editDictionaryByKeyPath, enumeration as enu, enumerationPlugin, fallbackPlugin, type file, type fileContent, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, formatProxyEnabledMessage, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, generateSitemap, generateSitemapUrl, get, getBasePlugins, getBrowserLocale, getCachedIntl, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getDomainHostname, getDomainOrigin, getEditedContent, getEditedDictionary, getEmptyNode, getEnumeration, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getGender, getHTML, getHTMLTextDir, getInsertion, getInsertionValues, getInternalPath, getInterpolableContent, getIntlayer, getLocale, getLocaleFromDomain, getLocaleFromPath, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, getLocaleLang, getLocaleName, getLocalizedContent, getLocalizedPath, getLocalizedUrl, getMarkdownMetadata, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getMultilingualUrls, getNesting, getNodeChildren, getNodeType, getPathWithoutLocale, getPerLocaleDictionary, getPlural, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSelect, getSplittedContent, getSplittedDictionaryContent, getTranslation, getVariantIds, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, interpolateMessage, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, intlayerToVueI18nFormatter, isInterpolableWrapperNode, isLocaleExclusiveOnDomain, isProxyStorageLocaleEnabled, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, mergeQualifiedDictionaries, navigatePath, nesting as nest, nestedPlugin, normalizeAttributeKey, normalizeDictionaries, normalizeDictionary, normalizePath, normalizeWhitespace, number, orderDictionaries, parseBlock, parseCaptureInline, parseDictionarySelector, parseInline, parseMarkdown, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseTaggedMessage, parseYaml, parserFor, percentage, plural, pluralPlugin, portableObjectToIntlayerFormatter, presets, qualifies, rebuildInterpolableContent, reconstructQualifiedEntry, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderMarkdownAst, renderNothing, resolveDictionaryArgument, resolveMessage, resolveMessageNode, resolveProviderVariant, resolveProxyMode, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, sanitizer, select, selectPlugin, serializeVariant, serializeVariantChain, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, stringifyYaml, translation as t, transformInterpolableNode, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
|
|
117
|
+
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, type BlockQuoteNode, type BoldTextNode, type BreakLineNode, type BreakThematicNode, CAPTURE_LETTER_AFTER_HYPHEN, CODE_BLOCK_FENCED_R, CODE_BLOCK_R, CODE_INLINE_R, COMPOSITE_ID_SEPARATOR, CONSECUTIVE_NEWLINE_R, CR_NEWLINE_R, CUSTOM_COMPONENT_R, CachedIntl, CachedIntl as Intl, type CodeBlockNode, type CodeFencedNode, type CodeInlineNode, type CompileOptions, type ComponentOverrides, ConditionCond, ConditionContent, ConditionContentStates, CookieBuildAttributes, type CustomComponentNode, DEFAULT_VARIANT_ID, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, DateTimePreset, DeepTransformContent, DotPath, DynamicDictionaryLoader, type ElementType, EnterFormat, EnumerationCond, EnumerationContent, EnumerationContentState, type EscapedTextNode, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, FileCond, type FileContent, type FileContentConstructor, type FootnoteNode, type FootnoteReferenceNode, type GFMTaskNode, GFM_TASK_R, Gender, GenderCond, GenderContent, GenderContentStates, type GenerateSitemapOptions, GetNestingResult, type GetPrefixOptions, type GetPrefixResult, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, type HTMLCommentNode, HTMLContent, HTMLContentConstructor, type HTMLNode, type HTMLSelfClosingNode, type 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, type HeadingNode, type HeadingSetextNode, IInterpreterPlugin, IInterpreterPluginState, INLINE_SKIP_R, INTERPOLATION_R, type ImageNode, InsertionCond, InsertionContent, InsertionContentConstructor, InterpolableNode, IntlConstructorName, IsAny, type ItalicTextNode, JsonValue, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, type LinkAngleBraceNode, type LinkBareURLNode, type LinkNode, ListType, type LocaleDomainMap, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, type LocalizedPathResult, MarkdownContent, MarkdownContentConstructor, type MarkdownContext, type MarkdownOptions, type MarkdownRuntime, type HTMLValidationIssue as MarkdownValidationIssue, MarkdownValidationResult, type MarkedTextNode, MessageFormatDialect, MessageValues, NAMED_CODES_TO_UNICODE, NP_TABLE_R, NestedCond, NestedContent, NestedContentState, NestedFieldReferences, type NestedParser, type NewlineNode, NodeProps, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, type OrderedListNode, PARAGRAPH_R, type ParagraphNode, type ParseState, ParsedMarkdown, type Parser, type ParserResult, Plugins, PluralCategory, PluralCond, PluralContent, PluralContentState, PortableObject, Priority, PriorityValue, type ProxyMode, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, type ReferenceImageNode, type ReferenceLinkNode, type ReferenceNode, type RenderRuleHook, type Rule, type RuleOutput, RuleType, RuleTypeValue, type Rules, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, SelectCond, SelectContent, SelectContentStates, SelectSelector, type SitemapUrlEntry, type 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, type TableNode, type TableSeparatorNode, TaggedMessageToken, type 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, type UnorderedListNode, VOID_HTML_ELEMENTS, ValidDotPathsFor, ValueAtKey, WrappedIntl, YamlRecord, YamlValue, allowInline, anyScopeRegex, attributeValueToNodePropValue, bindIntl, blockRegex, buildMaskPlugin, captureNothing, checkIsURLAbsolute, checkMissingLocalesPlugin, compact, comparePaths, compile, compileWithOptions, condition as cond, conditionPlugin, createCompiler, createRenderer, currency, cx, date, deepTransformNode, editDictionaryByKeyPath, enumeration as enu, enumerationPlugin, fallbackPlugin, type file, type fileContent, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, formatProxyEnabledMessage, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, generateSitemap, generateSitemapUrl, get, getBasePlugins, getBrowserLocale, getCachedIntl, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getDomainHostname, getDomainOrigin, getEditedContent, getEditedDictionary, getEmptyNode, getEnumeration, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getGender, getHTML, getHTMLTextDir, getInsertion, getInsertionValues, getInternalPath, getInterpolableContent, getIntlayer, getLocale, getLocaleFromDomain, getLocaleFromPath, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, getLocaleLang, getLocaleName, getLocalizedContent, getLocalizedPath, getLocalizedUrl, getMarkdownMetadata, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getMultilingualUrls, getNestedDictionaryGraph, getNestedDictionaryKeys, getNestedDictionaryReferences, getNesting, getNodeChildren, getNodeType, getPathWithoutLocale, getPerLocaleDictionary, getPlural, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSelect, getSplittedContent, getSplittedDictionaryContent, getTranslation, getVariantIds, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, interpolateMessage, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, intlayerToVueI18nFormatter, isInterpolableWrapperNode, isLocaleExclusiveOnDomain, isProxyStorageLocaleEnabled, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, mergeQualifiedDictionaries, navigatePath, nesting as nest, nestedPlugin, normalizeAttributeKey, normalizeDictionaries, normalizeDictionary, normalizePath, normalizeWhitespace, number, orderDictionaries, parseBlock, parseCaptureInline, parseDictionarySelector, parseInline, parseMarkdown, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseTaggedMessage, parseYaml, parserFor, percentage, plural, pluralPlugin, portableObjectToIntlayerFormatter, presets, qualifies, rebuildInterpolableContent, reconstructQualifiedEntry, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderMarkdownAst, renderNothing, resolveDictionaryArgument, resolveEffectiveVariantId, resolveMessage, resolveMessageNode, resolveProviderVariant, resolveProxyMode, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, sanitizer, select, selectPlugin, serializeVariant, serializeVariantChain, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, stringifyYaml, translation as t, transformInterpolableNode, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
|
|
@@ -149,6 +149,16 @@ interface NodeProps {
|
|
|
149
149
|
locale?: Locale;
|
|
150
150
|
dictionaryPath?: string;
|
|
151
151
|
children?: any;
|
|
152
|
+
/**
|
|
153
|
+
* Dictionaries referenced through `nest()`, attached to the consuming
|
|
154
|
+
* dictionary by the build optimization and threaded down by
|
|
155
|
+
* `deepTransformNode`.
|
|
156
|
+
*
|
|
157
|
+
* Present only in optimized builds, where the global dictionary registry is
|
|
158
|
+
* stripped and `getNesting` resolves from this map instead. See
|
|
159
|
+
* `getNesting.optimized.ts`.
|
|
160
|
+
*/
|
|
161
|
+
nestedDictionaries?: Record<string, unknown>;
|
|
152
162
|
/**
|
|
153
163
|
* Forces eager traversal of plain objects in `deepTransformNode`. By default
|
|
154
164
|
* traversal is lazy (property getters), so callers that discard the returned
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ValidDotPathsFor } from "../transpiler/nesting/nesting.js";
|
|
2
|
+
import "../transpiler/index.js";
|
|
3
|
+
import { GetNestingResult } from "./getNesting.js";
|
|
4
|
+
import { NodeProps } from "./getContent/plugins.js";
|
|
5
|
+
import "./getContent/index.js";
|
|
6
|
+
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
7
|
+
//#region src/interpreter/getNesting.optimized.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Optimized-build replacement for `getNesting`.
|
|
10
|
+
*
|
|
11
|
+
* Resolves a `nest()` reference from the dictionaries the compiler attached to
|
|
12
|
+
* the consuming dictionary (`props.nestedDictionaries`) instead of looking the
|
|
13
|
+
* key up in the global registry exposed by `@intlayer/dictionaries-entry`.
|
|
14
|
+
*
|
|
15
|
+
* That is what lets the build optimization erase the registry entirely: this
|
|
16
|
+
* module never imports `getIntlayer`, so no dictionary reaches the bundle
|
|
17
|
+
* except through the static import injected at the call site. The nest target
|
|
18
|
+
* then lands in the same chunk as the dictionary referencing it — and, in
|
|
19
|
+
* `dynamic` / `fetch` mode, is loaded by the same lazy per-locale loader.
|
|
20
|
+
*
|
|
21
|
+
* The compiler guarantees the attachment for every dictionary holding a nested
|
|
22
|
+
* node, so a missing entry means the dictionary was not produced by the
|
|
23
|
+
* optimized pipeline; the reference then resolves to `undefined`.
|
|
24
|
+
*
|
|
25
|
+
* @param dictionaryKey - The key of the dictionary to nest.
|
|
26
|
+
* @param path - Optional dot-separated path within the nested dictionary.
|
|
27
|
+
* @param props - Interpreter node props, carrying the attached dictionaries.
|
|
28
|
+
* @returns The nested content.
|
|
29
|
+
*/
|
|
30
|
+
declare const getNesting: <const K extends DictionaryKeys, const P>(dictionaryKey: K, path?: P extends ValidDotPathsFor<K> ? P : never, props?: NodeProps) => GetNestingResult<K, P>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getNesting };
|
|
33
|
+
//# sourceMappingURL=getNesting.optimized.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNesting.optimized.d.ts","names":[],"sources":["../../../src/interpreter/getNesting.optimized.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa,mBAAoB,UAAU,sBAAsB,GAAC,eACjD,GAAC,OACT,UAAU,iBAAiB,KAAK,WAAS,QACxC,cACP,iBAAiB,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.3.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": [
|
|
@@ -172,15 +172,15 @@
|
|
|
172
172
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
173
173
|
},
|
|
174
174
|
"dependencies": {
|
|
175
|
-
"@intlayer/api": "9.
|
|
176
|
-
"@intlayer/config": "9.
|
|
177
|
-
"@intlayer/dictionaries-entry": "9.
|
|
178
|
-
"@intlayer/types": "9.
|
|
179
|
-
"@intlayer/unmerged-dictionaries-entry": "9.
|
|
175
|
+
"@intlayer/api": "9.3.1",
|
|
176
|
+
"@intlayer/config": "9.3.1",
|
|
177
|
+
"@intlayer/dictionaries-entry": "9.3.1",
|
|
178
|
+
"@intlayer/types": "9.3.1",
|
|
179
|
+
"@intlayer/unmerged-dictionaries-entry": "9.3.1",
|
|
180
180
|
"defu": "6.1.7"
|
|
181
181
|
},
|
|
182
182
|
"devDependencies": {
|
|
183
|
-
"@types/node": "26.
|
|
183
|
+
"@types/node": "26.2.0",
|
|
184
184
|
"@utils/ts-config": "1.0.4",
|
|
185
185
|
"@utils/ts-config-types": "1.0.4",
|
|
186
186
|
"@utils/tsdown-config": "1.0.4",
|