@intlayer/core 8.12.5-canary.0 → 9.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/deepTransformPlugins/getEditedContent.cjs +96 -0
- package/dist/cjs/deepTransformPlugins/getEditedContent.cjs.map +1 -0
- package/dist/cjs/deepTransformPlugins/index.cjs +3 -0
- package/dist/cjs/dictionaryManipulator/index.cjs +18 -0
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +4 -1
- package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs +70 -0
- package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs.map +1 -0
- package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs +302 -0
- package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs.map +1 -0
- package/dist/cjs/index.cjs +26 -0
- package/dist/cjs/interpreter/getCollection.cjs +25 -0
- package/dist/cjs/interpreter/getCollection.cjs.map +1 -0
- package/dist/cjs/interpreter/getDictionary.cjs +26 -11
- package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
- package/dist/cjs/interpreter/getIntlayer.cjs +16 -3
- package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
- package/dist/cjs/interpreter/getVariant.cjs +30 -0
- package/dist/cjs/interpreter/getVariant.cjs.map +1 -0
- package/dist/cjs/localization/getBrowserLocale.cjs +1 -1
- package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
- package/dist/cjs/messageFormat/ICU.cjs +32 -2
- package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
- package/dist/cjs/messageFormat/i18next.cjs +1 -1
- package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
- package/dist/cjs/messageFormat/index.cjs +5 -0
- package/dist/cjs/messageFormat/resolveMessage.cjs +183 -0
- package/dist/cjs/messageFormat/resolveMessage.cjs.map +1 -0
- package/dist/cjs/messageFormat/vue-i18n.cjs +8 -9
- package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
- package/dist/cjs/transpiler/collection/collection.cjs +32 -0
- package/dist/cjs/transpiler/collection/collection.cjs.map +1 -0
- package/dist/cjs/transpiler/collection/index.cjs +4 -0
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +2 -3
- package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
- package/dist/cjs/transpiler/variant/index.cjs +4 -0
- package/dist/cjs/transpiler/variant/variant.cjs +35 -0
- package/dist/cjs/transpiler/variant/variant.cjs.map +1 -0
- package/dist/cjs/utils/parseYaml.cjs +37 -17
- package/dist/cjs/utils/parseYaml.cjs.map +1 -1
- package/dist/esm/deepTransformPlugins/getEditedContent.mjs +92 -0
- package/dist/esm/deepTransformPlugins/getEditedContent.mjs.map +1 -0
- package/dist/esm/deepTransformPlugins/index.mjs +2 -1
- package/dist/esm/dictionaryManipulator/index.mjs +3 -1
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +4 -1
- package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs +68 -0
- package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs.map +1 -0
- package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs +286 -0
- package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs.map +1 -0
- package/dist/esm/index.mjs +5 -1
- package/dist/esm/interpreter/getCollection.mjs +23 -0
- package/dist/esm/interpreter/getCollection.mjs.map +1 -0
- package/dist/esm/interpreter/getDictionary.mjs +26 -11
- package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
- package/dist/esm/interpreter/getIntlayer.mjs +16 -3
- package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
- package/dist/esm/interpreter/getVariant.mjs +28 -0
- package/dist/esm/interpreter/getVariant.mjs.map +1 -0
- package/dist/esm/localization/getBrowserLocale.mjs +1 -1
- package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
- package/dist/esm/messageFormat/ICU.mjs +32 -2
- package/dist/esm/messageFormat/ICU.mjs.map +1 -1
- package/dist/esm/messageFormat/i18next.mjs +1 -1
- package/dist/esm/messageFormat/i18next.mjs.map +1 -1
- package/dist/esm/messageFormat/index.mjs +2 -1
- package/dist/esm/messageFormat/resolveMessage.mjs +177 -0
- package/dist/esm/messageFormat/resolveMessage.mjs.map +1 -0
- package/dist/esm/messageFormat/vue-i18n.mjs +8 -9
- package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
- package/dist/esm/transpiler/collection/collection.mjs +30 -0
- package/dist/esm/transpiler/collection/collection.mjs.map +1 -0
- package/dist/esm/transpiler/collection/index.mjs +3 -0
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +2 -3
- package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
- package/dist/esm/transpiler/variant/index.mjs +3 -0
- package/dist/esm/transpiler/variant/variant.mjs +33 -0
- package/dist/esm/transpiler/variant/variant.mjs.map +1 -0
- package/dist/esm/utils/parseYaml.mjs +37 -17
- package/dist/esm/utils/parseYaml.mjs.map +1 -1
- package/dist/types/@intlayer/core/dist/types/formatters/compact.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/formatters/currency.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/formatters/date.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/formatters/index.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/formatters/list.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/formatters/number.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/formatters/percentage.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/formatters/relativeTime.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/formatters/units.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getCondition.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getContent/deepTransform.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getContent/getContent.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getContent/plugins.d.ts +4 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getDictionary.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getEnumeration.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getIntlayer.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getNesting.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getPlural.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getTranslation.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/getVariant.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/interpreter/index.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/intlayer/dist/types/index.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/generateSitemap.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/localization/getBrowserLocale.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getHTMLTextDir.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getLocale.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getLocaleFromPath.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getLocaleLang.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getLocaleName.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getLocalizedUrl.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getMultilingualUrls.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getPathWithoutLocale.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/getPrefix.d.ts +3 -0
- package/dist/types/@intlayer/core/dist/types/localization/index.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/localeDetector.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/localeMapper.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/localization/localeResolver.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/localization/rewriteUtils.d.ts +3 -0
- package/dist/types/@intlayer/core/dist/types/localization/validatePrefix.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/markdown/index.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/collection/collection.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/condition/condition.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/enumeration/enumeration.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/file/file.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/gender/gender.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/html/html.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/index.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/insertion/insertion.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/markdown/markdown.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/nesting/nesting.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/plural/plural.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/translation/translation.d.ts +2 -0
- package/dist/types/@intlayer/core/dist/types/transpiler/variant/variant.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/utils/index.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/utils/intl.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/utils/isSameKeyPath.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/utils/localeStorage.d.ts +2 -0
- package/dist/types/deepTransformPlugins/getEditedContent.d.ts +33 -0
- package/dist/types/deepTransformPlugins/getEditedContent.d.ts.map +1 -0
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +6 -3
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +6 -3
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -1
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +4 -1
- package/dist/types/deepTransformPlugins/index.d.ts +2 -1
- package/dist/types/dictionaryManipulator/index.d.ts +3 -1
- package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts +22 -0
- package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts.map +1 -0
- package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts +176 -0
- package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -2
- package/dist/types/interpreter/getCollection.d.ts +19 -0
- package/dist/types/interpreter/getCollection.d.ts.map +1 -0
- package/dist/types/interpreter/getDictionary.d.ts +13 -7
- package/dist/types/interpreter/getDictionary.d.ts.map +1 -1
- package/dist/types/interpreter/getIntlayer.d.ts +13 -2
- package/dist/types/interpreter/getIntlayer.d.ts.map +1 -1
- package/dist/types/interpreter/getPlural.d.ts +1 -1
- package/dist/types/interpreter/getVariant.d.ts +26 -0
- package/dist/types/interpreter/getVariant.d.ts.map +1 -0
- package/dist/types/intlayer/dist/types/index.d.ts +4 -0
- package/dist/types/messageFormat/ICU.d.ts.map +1 -1
- package/dist/types/messageFormat/i18next.d.ts.map +1 -1
- package/dist/types/messageFormat/index.d.ts +2 -1
- package/dist/types/messageFormat/resolveMessage.d.ts +72 -0
- package/dist/types/messageFormat/resolveMessage.d.ts.map +1 -0
- package/dist/types/messageFormat/vue-i18n.d.ts.map +1 -1
- package/dist/types/transpiler/collection/collection.d.ts +34 -0
- package/dist/types/transpiler/collection/collection.d.ts.map +1 -0
- package/dist/types/transpiler/collection/index.d.ts +2 -0
- package/dist/types/transpiler/variant/index.d.ts +2 -0
- package/dist/types/transpiler/variant/variant.d.ts +43 -0
- package/dist/types/transpiler/variant/variant.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/parseYaml.d.ts +12 -2
- package/dist/types/utils/parseYaml.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { CONDITION, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ENUMERATION, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { FILE, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { GENDER, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { HTML, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { INSERTION, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { MARKDOWN, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { PLURAL, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { KeyPath } from "@intlayer/types/keyPath";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ContentNode, Dictionary } from "@intlayer/types/dictionary";
|
|
2
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
|
+
|
|
4
|
+
//#region src/deepTransformPlugins/getEditedContent.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Returns the partial content holding only the `translation` nodes whose
|
|
7
|
+
* source (`defaultLocale`) value was added or changed between `previousContent`
|
|
8
|
+
* and `newContent`. Each changed node is reduced to its source locale so that
|
|
9
|
+
* every target locale is regenerated when the partial is translated.
|
|
10
|
+
*
|
|
11
|
+
* Returns `{}` (empty content) when no source value changed.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // default value of `title` changed → only `title` is returned, source-only
|
|
15
|
+
* getEditedContent(
|
|
16
|
+
* { title: t({ en: 'Old', fr: 'Vieux' }), body: t({ en: 'B', fr: 'B' }) },
|
|
17
|
+
* { title: t({ en: 'New', fr: 'Vieux' }), body: t({ en: 'B', fr: 'B' }) },
|
|
18
|
+
* 'en'
|
|
19
|
+
* ); // → { title: { nodeType: 'translation', translation: { en: 'New' } } }
|
|
20
|
+
*/
|
|
21
|
+
declare const getEditedContent: (previousContent: ContentNode | undefined, newContent: ContentNode, defaultLocale: LocalesValues) => ContentNode;
|
|
22
|
+
/**
|
|
23
|
+
* Dictionary-level wrapper around {@link getEditedContent}. Returns a partial
|
|
24
|
+
* dictionary (same `key`) whose `content` holds only the changed source nodes.
|
|
25
|
+
*
|
|
26
|
+
* @param previousDictionary - Dictionary state before the edit.
|
|
27
|
+
* @param newDictionary - Dictionary state after the edit.
|
|
28
|
+
* @param defaultLocale - The source locale to diff against.
|
|
29
|
+
*/
|
|
30
|
+
declare const getEditedDictionary: (previousDictionary: Dictionary | undefined, newDictionary: Dictionary, defaultLocale: LocalesValues) => Dictionary;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getEditedContent, getEditedDictionary };
|
|
33
|
+
//# sourceMappingURL=getEditedContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEditedContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getEditedContent.ts"],"mappings":";;;;;;AA2JA;;;;;;;;;;;;;;cAAa,gBAAA,GACX,eAAA,EAAiB,WAAA,cACjB,UAAA,EAAY,WAAA,EACZ,aAAA,EAAe,aAAA,KACd,WAAA;;;;AAYH;;;;;cAAa,mBAAA,GACX,kBAAA,EAAoB,UAAA,cACpB,aAAA,EAAe,UAAA,EACf,aAAA,EAAe,aAAA,KACd,UAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
|
|
2
|
-
import * as _$_intlayer_types0 from "@intlayer/types";
|
|
3
2
|
import { ContentNode, Dictionary } from "@intlayer/types/dictionary";
|
|
4
|
-
import { DeclaredLocales
|
|
3
|
+
import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
4
|
+
import * as _$_intlayer_types0 from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts
|
|
7
7
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
@@ -20,7 +20,7 @@ declare const filterMissingTranslationsOnlyPlugin: (localeToCheck: LocalesValues
|
|
|
20
20
|
* { test2: t({ ar: 'Hello', en: 'Hello' }) } -> { test2: t({ ar: 'Hello', en: 'Hello' }) }
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
declare const getFilterMissingTranslationsContent: <T extends ContentNode, L extends LocalesValues = DeclaredLocales
|
|
23
|
+
declare const getFilterMissingTranslationsContent: <T extends ContentNode, L extends LocalesValues = DeclaredLocales>(node: T, localeToCheck: L, nodeProps: NodeProps) => any;
|
|
24
24
|
declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, localeToCheck: LocalesValues) => {
|
|
25
25
|
content: any;
|
|
26
26
|
$schema?: "https://intlayer.org/schema.json";
|
|
@@ -36,6 +36,9 @@ declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, l
|
|
|
36
36
|
version?: string;
|
|
37
37
|
filePath?: string;
|
|
38
38
|
tags?: string[];
|
|
39
|
+
item?: number;
|
|
40
|
+
variant?: string;
|
|
41
|
+
meta?: _$_intlayer_types0.DictionaryMeta;
|
|
39
42
|
locale?: LocalesValues;
|
|
40
43
|
contentAutoTransformation?: _$_intlayer_types0.ContentAutoTransformation;
|
|
41
44
|
fill?: _$_intlayer_types0.Fill;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"mappings":";;;;;;;cAoMa,mCAAA,GACX,aAAA,EAAe,aAAA,KACd,OAAA;;;AAFH;;;;;;;;;AA+LA;;;cAAa,mCAAA,aACD,WAAA,YACA,aAAA,GAAgB,
|
|
1
|
+
{"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"mappings":";;;;;;;cAoMa,mCAAA,GACX,aAAA,EAAe,aAAA,KACd,OAAA;;;AAFH;;;;;;;;;AA+LA;;;cAAa,mCAAA,aACD,WAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,IAAA,EAAM,CAAA,EACN,aAAA,EAAe,CAAA,EACf,SAAA,EAAW,SAAA;AAAA,cAoBA,sCAAA,GACX,UAAA,EAAY,UAAA,EACZ,aAAA,EAAe,aAAA;;;OAAa,kBAAA,CAAA,YAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeepTransformContent, NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
|
|
2
|
-
import * as _$_intlayer_types0 from "@intlayer/types";
|
|
3
2
|
import { ContentNode, Dictionary } from "@intlayer/types/dictionary";
|
|
4
|
-
import { DeclaredLocales
|
|
3
|
+
import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
4
|
+
import * as _$_intlayer_types0 from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts
|
|
7
7
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
@@ -12,7 +12,7 @@ declare const filterTranslationsOnlyPlugin: (locale: LocalesValues, fallback?: L
|
|
|
12
12
|
* @param node The node to transform.
|
|
13
13
|
* @param locale The locale to use if your transformers need it (e.g. for translations).
|
|
14
14
|
*/
|
|
15
|
-
declare const getFilterTranslationsOnlyContent: <T extends ContentNode, L extends LocalesValues = DeclaredLocales
|
|
15
|
+
declare const getFilterTranslationsOnlyContent: <T extends ContentNode, L extends LocalesValues = DeclaredLocales>(node: T, locale: L, nodeProps: NodeProps, fallback?: LocalesValues) => DeepTransformContent<T>;
|
|
16
16
|
declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, locale?: LocalesValues, fallback?: LocalesValues) => {
|
|
17
17
|
content: any;
|
|
18
18
|
$schema?: "https://intlayer.org/schema.json";
|
|
@@ -28,6 +28,9 @@ declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, loca
|
|
|
28
28
|
version?: string;
|
|
29
29
|
filePath?: string;
|
|
30
30
|
tags?: string[];
|
|
31
|
+
item?: number;
|
|
32
|
+
variant?: string;
|
|
33
|
+
meta?: _$_intlayer_types0.DictionaryMeta;
|
|
31
34
|
locale?: LocalesValues;
|
|
32
35
|
contentAutoTransformation?: _$_intlayer_types0.ContentAutoTransformation;
|
|
33
36
|
fill?: _$_intlayer_types0.Fill;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFilterTranslationsOnlyContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterTranslationsOnlyContent.ts"],"mappings":";;;;;;;cAqCa,4BAAA,GACX,MAAA,EAAQ,aAAA,EACR,QAAA,GAAW,aAAA,KACV,OAAA;;;AAHH;;;;cAuFa,gCAAA,aACD,WAAA,YACA,aAAA,GAAgB,
|
|
1
|
+
{"version":3,"file":"getFilterTranslationsOnlyContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterTranslationsOnlyContent.ts"],"mappings":";;;;;;;cAqCa,4BAAA,GACX,MAAA,EAAQ,aAAA,EACR,QAAA,GAAW,aAAA,KACV,OAAA;;;AAHH;;;;cAuFa,gCAAA,aACD,WAAA,YACA,aAAA,GAAgB,eAAA,EAE1B,IAAA,EAAM,CAAA,EACN,MAAA,EAAQ,CAAA,EAER,SAAA,EAAW,SAAA,EACX,QAAA,GAAW,aAAA,KAUL,oBAAA,CAAqB,CAAA;AAAA,cAGhB,mCAAA,GACX,UAAA,EAAY,UAAA,EACZ,MAAA,GAAQ,aAAA,EAER,QAAA,GAAW,aAAA;;;OAAa,kBAAA,CAAA,YAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NodeProps } from "../interpreter/getContent/plugins.js";
|
|
2
|
-
import * as _$_intlayer_types0 from "@intlayer/types";
|
|
3
2
|
import { ContentNode, Dictionary } from "@intlayer/types/dictionary";
|
|
4
3
|
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
4
|
+
import * as _$_intlayer_types0 from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilteredLocalesContent.d.ts
|
|
7
7
|
declare const getFilteredLocalesContent: (node: ContentNode, locales: LocalesValues | LocalesValues[], nodeProps: NodeProps) => any;
|
|
@@ -20,6 +20,9 @@ declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: Loc
|
|
|
20
20
|
version?: string;
|
|
21
21
|
filePath?: string;
|
|
22
22
|
tags?: string[];
|
|
23
|
+
item?: number;
|
|
24
|
+
variant?: string;
|
|
25
|
+
meta?: _$_intlayer_types0.DictionaryMeta;
|
|
23
26
|
locale?: LocalesValues;
|
|
24
27
|
contentAutoTransformation?: _$_intlayer_types0.ContentAutoTransformation;
|
|
25
28
|
fill?: _$_intlayer_types0.Fill;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getEditedContent, getEditedDictionary } from "./getEditedContent.js";
|
|
1
2
|
import { filterMissingTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary } from "./getFilterMissingTranslationsContent.js";
|
|
2
3
|
import { filterTranslationsOnlyPlugin, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary } from "./getFilterTranslationsOnlyContent.js";
|
|
3
4
|
import { getFilteredLocalesContent, getFilteredLocalesDictionary } from "./getFilteredLocalesContent.js";
|
|
@@ -8,4 +9,4 @@ import { getMultilingualDictionary } from "./getMultilingualDictionary.js";
|
|
|
8
9
|
import { getReplacedValuesContent } from "./getReplacedValuesContent.js";
|
|
9
10
|
import { getSplittedContent, getSplittedDictionaryContent } from "./getSplittedContent.js";
|
|
10
11
|
import { insertContentInDictionary } from "./insertContentInDictionary.js";
|
|
11
|
-
export { buildMaskPlugin, checkMissingLocalesPlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getLocalizedContent, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getPerLocaleDictionary, getReplacedValuesContent, getSplittedContent, getSplittedDictionaryContent, insertContentInDictionary };
|
|
12
|
+
export { buildMaskPlugin, checkMissingLocalesPlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, getEditedContent, getEditedDictionary, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getLocalizedContent, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getPerLocaleDictionary, getReplacedValuesContent, getSplittedContent, getSplittedDictionaryContent, insertContentInDictionary };
|
|
@@ -5,9 +5,11 @@ import { getEmptyNode } from "./getEmptyNode.js";
|
|
|
5
5
|
import { getNodeChildren } from "./getNodeChildren.js";
|
|
6
6
|
import { getNodeType } from "./getNodeType.js";
|
|
7
7
|
import { mergeDictionaries } from "./mergeDictionaries.js";
|
|
8
|
+
import { mergeQualifiedDictionaries } from "./mergeQualifiedDictionaries.js";
|
|
8
9
|
import { normalizeDictionaries, normalizeDictionary } from "./normalizeDictionary.js";
|
|
9
10
|
import { orderDictionaries } from "./orderDictionaries.js";
|
|
11
|
+
import { COMPOSITE_ID_SEPARATOR, DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, getDictionaryCompositeId, getDictionaryQualifierId, getDictionaryQualifierSegments, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, parseDictionarySelector, reconstructQualifiedEntry, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync } from "./qualifiedDictionary.js";
|
|
10
12
|
import { removeContentNodeByKeyPath } from "./removeContentNodeByKeyPath.js";
|
|
11
13
|
import { renameContentNodeByKeyPath } from "./renameContentNodeByKeyPath.js";
|
|
12
14
|
import { updateNodeChildren } from "./updateNodeChildren.js";
|
|
13
|
-
export { editDictionaryByKeyPath, getContentNodeByKeyPath, getDefaultNode, getEmptyNode, getNodeChildren, getNodeType, mergeDictionaries, normalizeDictionaries, normalizeDictionary, orderDictionaries, removeContentNodeByKeyPath, renameContentNodeByKeyPath, updateNodeChildren };
|
|
15
|
+
export { COMPOSITE_ID_SEPARATOR, DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, editDictionaryByKeyPath, getContentNodeByKeyPath, getDefaultNode, getDictionaryCompositeId, getDictionaryQualifierId, getDictionaryQualifierSegments, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getEmptyNode, getNodeChildren, getNodeType, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, mergeDictionaries, mergeQualifiedDictionaries, normalizeDictionaries, normalizeDictionary, orderDictionaries, parseDictionarySelector, reconstructQualifiedEntry, removeContentNodeByKeyPath, renameContentNodeByKeyPath, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, updateNodeChildren };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Dictionary, QualifiedDictionaryGroup } from "@intlayer/types/dictionary";
|
|
2
|
+
|
|
3
|
+
//#region src/dictionaryManipulator/mergeQualifiedDictionaries.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Merges sibling dictionaries sharing the same key, honouring qualifiers.
|
|
6
|
+
*
|
|
7
|
+
* - No dictionary declares a qualifier → behaves exactly like
|
|
8
|
+
* `mergeDictionaries` (single merged dictionary).
|
|
9
|
+
* - At least one dictionary declares a qualifier → the group's dimension set is
|
|
10
|
+
* the union of every declared dimension (in canonical order
|
|
11
|
+
* `variant → meta → item`). Dictionaries are grouped by their composite id
|
|
12
|
+
* (one segment per dimension), merged within each group (locale completion /
|
|
13
|
+
* priority overrides preserved), and a `QualifiedDictionaryGroup` is returned.
|
|
14
|
+
* Unqualified siblings act as shared base content merged into every entry.
|
|
15
|
+
*
|
|
16
|
+
* Every qualified entry must declare ALL dimensions of the group; an entry that
|
|
17
|
+
* declares only a subset is ambiguous and is rejected with an error log.
|
|
18
|
+
*/
|
|
19
|
+
declare const mergeQualifiedDictionaries: (dictionaries: Dictionary[]) => Dictionary | QualifiedDictionaryGroup;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { mergeQualifiedDictionaries };
|
|
22
|
+
//# sourceMappingURL=mergeQualifiedDictionaries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeQualifiedDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/mergeQualifiedDictionaries.ts"],"mappings":";;;;;AA8BA;;;;;;;;;;;;;cAAa,0BAAA,GACX,YAAA,EAAc,UAAA,OACb,UAAA,GAAa,wBAAA"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Dictionary, DictionaryQualifierType, DictionarySelector, QualifiedDictionaryGroup } from "@intlayer/types/dictionary";
|
|
2
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
|
+
|
|
4
|
+
//#region src/dictionaryManipulator/qualifiedDictionary.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Canonical order of qualifier dimensions. A key that declares several
|
|
7
|
+
* dimensions always nests them in this order, with `item` innermost so it can
|
|
8
|
+
* act as the collection (array) axis.
|
|
9
|
+
*/
|
|
10
|
+
declare const QUALIFIER_ORDER: readonly ["variant", "meta", "item"];
|
|
11
|
+
/**
|
|
12
|
+
* Separator joining per-dimension ids into a composite entry id. Also used as
|
|
13
|
+
* the chunk path separator in dynamic mode.
|
|
14
|
+
*/
|
|
15
|
+
declare const COMPOSITE_ID_SEPARATOR = "/";
|
|
16
|
+
/**
|
|
17
|
+
* Returns the qualifier dimensions declared on a dictionary, in canonical
|
|
18
|
+
* order (`variant → meta → item`). Empty when the dictionary is unqualified
|
|
19
|
+
* (plain dictionary or shared base content of a qualified group).
|
|
20
|
+
*/
|
|
21
|
+
declare const getDictionaryQualifierTypes: (dictionary: Dictionary) => DictionaryQualifierType[];
|
|
22
|
+
/**
|
|
23
|
+
* Returns the qualifier identifier of a dictionary for the given qualifier
|
|
24
|
+
* dimension — one segment of the composite entry id.
|
|
25
|
+
*
|
|
26
|
+
* - 'variant' → the variant name
|
|
27
|
+
* - 'meta' → the `meta.id` discriminator
|
|
28
|
+
* - 'item' → the item index as string
|
|
29
|
+
*/
|
|
30
|
+
declare const getDictionaryQualifierId: (dictionary: Dictionary, qualifierType: DictionaryQualifierType) => string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the per-dimension id segments of a dictionary for the given ordered
|
|
33
|
+
* dimension set, or `undefined` when the dictionary does not declare every
|
|
34
|
+
* dimension of the set.
|
|
35
|
+
*/
|
|
36
|
+
declare const getDictionaryQualifierSegments: (dictionary: Dictionary, qualifierTypes: DictionaryQualifierType[]) => string[] | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Builds the composite entry id of a dictionary — its per-dimension id segments
|
|
39
|
+
* joined in canonical order. `undefined` when a dimension is missing.
|
|
40
|
+
*/
|
|
41
|
+
declare const getDictionaryCompositeId: (dictionary: Dictionary, qualifierTypes: DictionaryQualifierType[]) => string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Type guard discriminating a `QualifiedDictionaryGroup` (merge output of a
|
|
44
|
+
* qualified key) from a plain `Dictionary`. Both carry a `content` field; only
|
|
45
|
+
* the group declares `qualifierTypes`, which is therefore the discriminator.
|
|
46
|
+
*/
|
|
47
|
+
declare const isQualifiedDictionaryGroup: (value: unknown) => value is QualifiedDictionaryGroup;
|
|
48
|
+
/**
|
|
49
|
+
* Reconstructs a resolvable {@link Dictionary} from a single entry of a
|
|
50
|
+
* qualified group: the content node stored under its composite id, plus the
|
|
51
|
+
* qualifier coordinates decoded from that id (`variant`, `item`) and the
|
|
52
|
+
* preserved `meta` object for the meta dimension.
|
|
53
|
+
*
|
|
54
|
+
* This keeps the resolver's matching/transform code unchanged: it still sees a
|
|
55
|
+
* `{ key, content, variant?, item?, meta? }` shape, even though the stored
|
|
56
|
+
* format no longer duplicates those fields per entry.
|
|
57
|
+
*/
|
|
58
|
+
declare const reconstructQualifiedEntry: (group: QualifiedDictionaryGroup, compositeId: string) => Dictionary;
|
|
59
|
+
/**
|
|
60
|
+
* Resolves a dictionary (or qualified dictionary group) against a selector,
|
|
61
|
+
* across every declared dimension.
|
|
62
|
+
*
|
|
63
|
+
* - Plain dictionary → returned as-is (selector ignored)
|
|
64
|
+
* - `item` declared but not selected → every matching entry ordered by index
|
|
65
|
+
* - `item` selected → the matching entry or null
|
|
66
|
+
* - `variant` defaults to the `default` entry when not selected
|
|
67
|
+
* - `meta` requires `{ id }` and every declared meta field to match
|
|
68
|
+
*
|
|
69
|
+
* Dimensions compose: e.g. a variant × item key with `{ variant: 'promo' }`
|
|
70
|
+
* returns every promo item as an array; adding `{ item: 2 }` narrows to one.
|
|
71
|
+
*/
|
|
72
|
+
declare const resolveQualifiedDictionary: (dictionaryOrGroup: Dictionary | QualifiedDictionaryGroup, selector?: DictionarySelector) => Dictionary | Dictionary[] | null;
|
|
73
|
+
/**
|
|
74
|
+
* Splits the second argument of `getIntlayer` / `getDictionary` into the
|
|
75
|
+
* effective locale and the selector object (if any).
|
|
76
|
+
*/
|
|
77
|
+
declare const parseDictionarySelector: <L extends LocalesValues>(localeOrSelector?: L | DictionarySelector) => {
|
|
78
|
+
locale?: L;
|
|
79
|
+
selector?: DictionarySelector;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Builds a stable string identity of a selector (excluding `locale`), suitable
|
|
83
|
+
* for cache keys and memoization dependencies.
|
|
84
|
+
*/
|
|
85
|
+
declare const getDictionarySelectorCacheKey: (selector?: DictionarySelector) => string;
|
|
86
|
+
/**
|
|
87
|
+
* Marker property carrying the ordered qualifier dimensions on a dynamic loader
|
|
88
|
+
* map. Its presence distinguishes a qualified group loader map (a nested tree
|
|
89
|
+
* of chunks) from a plain dynamic loader map (one chunk per `locale`). Prefixed
|
|
90
|
+
* and unlikely to collide with a real locale code.
|
|
91
|
+
*/
|
|
92
|
+
declare const QUALIFIER_DYNAMIC_TYPES_KEY = "__intlayerQualifierTypes";
|
|
93
|
+
/**
|
|
94
|
+
* A lazily-imported per-locale dictionary chunk loader.
|
|
95
|
+
*/
|
|
96
|
+
type DynamicDictionaryLoader = () => Promise<Dictionary>;
|
|
97
|
+
/**
|
|
98
|
+
* Nested tree of chunk loaders: one nesting level per declared dimension (in
|
|
99
|
+
* canonical order), leaves are loaders.
|
|
100
|
+
*/
|
|
101
|
+
type QualifiedDynamicLoaderTree = {
|
|
102
|
+
[segment: string]: QualifiedDynamicLoaderTree | DynamicDictionaryLoader;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Default export shape of a generated dynamic entry point for a qualified key.
|
|
106
|
+
* One nesting level per dimension under each locale, plus the dimension marker.
|
|
107
|
+
*
|
|
108
|
+
* ```ts
|
|
109
|
+
* {
|
|
110
|
+
* __intlayerQualifierTypes: ['variant', 'item'],
|
|
111
|
+
* en: { promo: { '1': () => import('./json/x/promo/1/en.json'), … }, … },
|
|
112
|
+
* fr: { … },
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
type QualifiedDynamicLoaderMap = {
|
|
117
|
+
[QUALIFIER_DYNAMIC_TYPES_KEY]: DictionaryQualifierType[];
|
|
118
|
+
[locale: string]: QualifiedDynamicLoaderTree | DictionaryQualifierType[];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Type guard discriminating a qualified dynamic loader map (collections /
|
|
122
|
+
* variants / meta records, possibly combined) from a plain dynamic loader map.
|
|
123
|
+
*/
|
|
124
|
+
declare const isQualifiedDynamicLoaderMap: (value: unknown) => value is QualifiedDynamicLoaderMap;
|
|
125
|
+
/**
|
|
126
|
+
* Resolves the content of a qualified dynamic loader map against a selector,
|
|
127
|
+
* loading only the chunk(s) the selector actually targets.
|
|
128
|
+
*
|
|
129
|
+
* Walks the nested loader tree one dimension at a time (canonical order
|
|
130
|
+
* `variant → meta → item`): `variant` defaults to `default`, `meta` descends by
|
|
131
|
+
* `id`, and `item` either narrows to the selected index or — when no item is
|
|
132
|
+
* given — expands into every sibling chunk (the collection axis). Meta-equality
|
|
133
|
+
* is verified on the loaded chunk. Semantics mirror
|
|
134
|
+
* {@link resolveQualifiedDictionary} so dynamic and static modes behave alike.
|
|
135
|
+
*
|
|
136
|
+
* The Suspense mechanism is injected through `loadChunk` so the same logic
|
|
137
|
+
* serves both the client (suspender cache) and the server (`react.use`). Every
|
|
138
|
+
* targeted loader is started before the first chunk is read, so sibling chunks
|
|
139
|
+
* load in parallel rather than waterfalling.
|
|
140
|
+
*
|
|
141
|
+
* @param loaderMap - The qualified dynamic loader map (entry point default export).
|
|
142
|
+
* @param key - The dictionary key (used to build stable chunk cache keys).
|
|
143
|
+
* @param locale - The resolved locale to load chunks for.
|
|
144
|
+
* @param selector - The selector splitting the qualifier dimensions.
|
|
145
|
+
* @param loadChunk - Reads a started chunk promise, suspending until it resolves.
|
|
146
|
+
* @param transform - Turns a resolved chunk dictionary into final content.
|
|
147
|
+
*/
|
|
148
|
+
declare const resolveQualifiedDynamicContent: <Content>(params: {
|
|
149
|
+
loaderMap: QualifiedDynamicLoaderMap;
|
|
150
|
+
key: string;
|
|
151
|
+
locale: string;
|
|
152
|
+
selector: DictionarySelector | undefined;
|
|
153
|
+
loadChunk: (cacheKey: string, promise: Promise<Dictionary>) => Dictionary;
|
|
154
|
+
transform: (dictionary: Dictionary) => Content;
|
|
155
|
+
}) => Content | Content[] | null;
|
|
156
|
+
/**
|
|
157
|
+
* Async counterpart of {@link resolveQualifiedDynamicContent} for frameworks
|
|
158
|
+
* that load dictionaries with `await` instead of Suspense (Vue, Svelte, Lit,
|
|
159
|
+
* vanilla). Awaits every targeted chunk in parallel, then resolves identically.
|
|
160
|
+
*
|
|
161
|
+
* @param loaderMap - The qualified dynamic loader map.
|
|
162
|
+
* @param key - The dictionary key (used to build stable chunk cache keys).
|
|
163
|
+
* @param locale - The resolved locale to load chunks for.
|
|
164
|
+
* @param selector - The selector splitting the qualifier dimensions.
|
|
165
|
+
* @param transform - Turns a resolved chunk dictionary into final content.
|
|
166
|
+
*/
|
|
167
|
+
declare const resolveQualifiedDynamicContentAsync: <Content>(params: {
|
|
168
|
+
loaderMap: QualifiedDynamicLoaderMap;
|
|
169
|
+
key: string;
|
|
170
|
+
locale: string;
|
|
171
|
+
selector: DictionarySelector | undefined;
|
|
172
|
+
transform: (dictionary: Dictionary) => Content;
|
|
173
|
+
}) => Promise<Content | Content[] | null>;
|
|
174
|
+
//#endregion
|
|
175
|
+
export { COMPOSITE_ID_SEPARATOR, DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, getDictionaryCompositeId, getDictionaryQualifierId, getDictionaryQualifierSegments, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, parseDictionarySelector, reconstructQualifiedEntry, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync };
|
|
176
|
+
//# sourceMappingURL=qualifiedDictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qualifiedDictionary.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/qualifiedDictionary.ts"],"mappings":";;;;;;AAmBA;;;cAAa,eAAA;;AAUb;;;cAAa,sBAAA;;AAOb;;;;cAAa,2BAAA,GACX,UAAA,EAAY,UAAA,KACX,uBAAA;;;;;AAmBH;;;;cAAa,wBAAA,GACX,UAAA,EAAY,UAAA,EACZ,aAAA,EAAe,uBAAA;;;;;;cAeJ,8BAAA,GACX,UAAA,EAAY,UAAA,EACZ,cAAA,EAAgB,uBAAA;;;;;cAiBL,wBAAA,GACX,UAAA,EAAY,UAAA,EACZ,cAAA,EAAgB,uBAAA;;;;;AAFlB;cAgEa,0BAAA,GACX,KAAA,cACC,KAAA,IAAS,wBAAA;;;;;;;;;AAFZ;;cAmBa,yBAAA,GACX,KAAA,EAAO,wBAAA,EACP,WAAA,aACC,UAAA;;;;;;;AAHH;;;;;;;cAwCa,0BAAA,GACX,iBAAA,EAAmB,UAAA,GAAa,wBAAA,EAChC,QAAA,GAAW,kBAAA,KACV,UAAA,GAAa,UAAA;;;AAHhB;;cAqCa,uBAAA,aAAqC,aAAA,EAChD,gBAAA,GAAmB,CAAA,GAAI,kBAAA;EACpB,MAAA,GAAS,CAAA;EAAG,QAAA,GAAW,kBAAA;AAAA;;;;;cAef,6BAAA,GACX,QAAA,GAAW,kBAAA;;;;;;;cAiBA,2BAAA;;AAnCb;;KAwCY,uBAAA,SAAgC,OAAA,CAAQ,UAAA;;;;;KAMxC,0BAAA;EAAA,CACT,OAAA,WAAkB,0BAAA,GAA6B,uBAAA;AAAA;;;;;;;;;;;;AA9BlD;KA6CY,yBAAA;EAAA,CACT,2BAAA,GAA8B,uBAAA;EAAA,CAC9B,MAAA,WAAiB,0BAAA,GAA6B,uBAAA;AAAA;AA7BjD;;;;AAAA,cAoCa,2BAAA,GACX,KAAA,cACC,KAAA,IAAS,yBAAA;AAjCZ;;;;;AAMA;;;;;;;;;AAgBA;;;;;;;;;AAtBA,cAuLa,8BAAA,YAA2C,MAAA;EACtD,SAAA,EAAW,yBAAA;EACX,GAAA;EACA,MAAA;EACA,QAAA,EAAU,kBAAA;EACV,SAAA,GAAY,QAAA,UAAkB,OAAA,EAAS,OAAA,CAAQ,UAAA,MAAgB,UAAA;EAC/D,SAAA,GAAY,UAAA,EAAY,UAAA,KAAe,OAAA;AAAA,MACrC,OAAA,GAAU,OAAA;;;;;;;;;AAPd;;;cAyCa,mCAAA,YAAsD,MAAA;EACjE,SAAA,EAAW,yBAAA;EACX,GAAA;EACA,MAAA;EACA,QAAA,EAAU,kBAAA;EACV,SAAA,GAAY,UAAA,EAAY,UAAA,KAAe,OAAA;AAAA,MACrC,OAAA,CAAQ,OAAA,GAAU,OAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getEditedContent, getEditedDictionary } from "./deepTransformPlugins/getEditedContent.js";
|
|
1
2
|
import { ConditionContent, ConditionContentStates, cond as condition } from "./transpiler/condition/condition.js";
|
|
2
3
|
import { EnterFormat, EnumerationContent, EnumerationContentState, enu as enumeration } from "./transpiler/enumeration/enumeration.js";
|
|
3
4
|
import { FileContent, FileContentConstructor, file, fileContent } from "./transpiler/file/file.js";
|
|
@@ -42,8 +43,10 @@ import { getEmptyNode } from "./dictionaryManipulator/getEmptyNode.js";
|
|
|
42
43
|
import { getNodeChildren } from "./dictionaryManipulator/getNodeChildren.js";
|
|
43
44
|
import { getNodeType } from "./dictionaryManipulator/getNodeType.js";
|
|
44
45
|
import { mergeDictionaries } from "./dictionaryManipulator/mergeDictionaries.js";
|
|
46
|
+
import { mergeQualifiedDictionaries } from "./dictionaryManipulator/mergeQualifiedDictionaries.js";
|
|
45
47
|
import { normalizeDictionaries, normalizeDictionary } from "./dictionaryManipulator/normalizeDictionary.js";
|
|
46
48
|
import { orderDictionaries } from "./dictionaryManipulator/orderDictionaries.js";
|
|
49
|
+
import { COMPOSITE_ID_SEPARATOR, DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, getDictionaryCompositeId, getDictionaryQualifierId, getDictionaryQualifierSegments, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, parseDictionarySelector, reconstructQualifiedEntry, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync } from "./dictionaryManipulator/qualifiedDictionary.js";
|
|
47
50
|
import { removeContentNodeByKeyPath } from "./dictionaryManipulator/removeContentNodeByKeyPath.js";
|
|
48
51
|
import { renameContentNodeByKeyPath } from "./dictionaryManipulator/renameContentNodeByKeyPath.js";
|
|
49
52
|
import { updateNodeChildren } from "./dictionaryManipulator/updateNodeChildren.js";
|
|
@@ -81,12 +84,13 @@ import { allowInline, anyScopeRegex, attributeValueToNodePropValue, blockRegex,
|
|
|
81
84
|
import { JsonValue, icuToIntlayerFormatter, intlayerToICUFormatter } from "./messageFormat/ICU.js";
|
|
82
85
|
import { i18nextToIntlayerFormatter, intlayerToI18nextFormatter } from "./messageFormat/i18next.js";
|
|
83
86
|
import { PortableObject, intlayerToPortableObjectFormatter, portableObjectToIntlayerFormatter } from "./messageFormat/po.js";
|
|
87
|
+
import { MessageFormatDialect, MessageValues, TaggedMessageToken, interpolateMessage, parseTaggedMessage, resolveMessage, resolveMessageNode } from "./messageFormat/resolveMessage.js";
|
|
84
88
|
import { intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter } from "./messageFormat/vue-i18n.js";
|
|
85
89
|
import { checkIsURLAbsolute } from "./utils/checkIsURLAbsolute.js";
|
|
86
90
|
import { getCookie } from "./utils/getCookie.js";
|
|
87
91
|
import { isSameKeyPath } from "./utils/isSameKeyPath.js";
|
|
88
92
|
import { isValidElement } from "./utils/isValidReactElement.js";
|
|
89
93
|
import { CookieBuildAttributes, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, localeStorageOptions, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer } from "./utils/localeStorage.js";
|
|
90
|
-
import { parseYaml } from "./utils/parseYaml.js";
|
|
94
|
+
import { YamlRecord, YamlValue, parseYaml } from "./utils/parseYaml.js";
|
|
91
95
|
import { stringifyYaml } from "./utils/stringifyYaml.js";
|
|
92
|
-
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, ParsedMarkdown, Parser, ParserResult, Plugins, PluralCategory, PluralCond, PluralContent, PluralContentState, PortableObject, 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_HTML_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, getPlural, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSplittedContent, getSplittedDictionaryContent, getTranslation, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, 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, parseMarkdown, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseYaml, parserFor, percentage, plural, pluralPlugin, portableObjectToIntlayerFormatter, presets, qualifies, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderMarkdownAst, renderNothing, sanitizer, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, stringifyYaml, translation as t, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
|
|
96
|
+
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, COMPOSITE_ID_SEPARATOR, 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, DynamicDictionaryLoader, 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, MessageFormatDialect, MessageValues, 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, ParsedMarkdown, Parser, ParserResult, Plugins, PluralCategory, PluralCond, PluralContent, PluralContentState, PortableObject, Priority, PriorityValue, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, 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, TaggedMessageToken, 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_HTML_ELEMENTS, ValidDotPathsFor, ValueAtKey, WrappedIntl, YamlRecord, YamlValue, 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, getDictionaryCompositeId, getDictionaryQualifierId, getDictionaryQualifierSegments, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getEditedContent, getEditedDictionary, 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, getPlural, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSplittedContent, getSplittedDictionaryContent, getTranslation, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, interpolateMessage, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, intlayerToVueI18nFormatter, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, mergeQualifiedDictionaries, nesting as nest, nestedPlugin, normalizeAttributeKey, normalizeDictionaries, normalizeDictionary, normalizeWhitespace, number, orderDictionaries, parseBlock, parseCaptureInline, parseDictionarySelector, parseInline, parseMarkdown, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseTaggedMessage, parseYaml, parserFor, percentage, plural, pluralPlugin, portableObjectToIntlayerFormatter, presets, qualifies, reconstructQualifiedEntry, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderMarkdownAst, renderNothing, resolveMessage, resolveMessageNode, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, sanitizer, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, stringifyYaml, translation as t, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/interpreter/getCollection.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Picks a single item from a resolved collection array, or returns the full
|
|
4
|
+
* array when no index is requested.
|
|
5
|
+
*
|
|
6
|
+
* @param items - The already-resolved collection items.
|
|
7
|
+
* @param itemIndex - Optional 0-based index of the item to retrieve.
|
|
8
|
+
* @returns The item at `itemIndex`, or the full array when no index is given.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const all = getCollection(['a', 'b', 'c']); // ['a', 'b', 'c']
|
|
13
|
+
* const one = getCollection(['a', 'b', 'c'], 1); // 'b'
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare const getCollection: <T>(items: T[], itemIndex?: number) => T | T[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { getCollection };
|
|
19
|
+
//# sourceMappingURL=getCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCollection.d.ts","names":[],"sources":["../../../src/interpreter/getCollection.ts"],"mappings":";;AAcA;;;;;;;;;;;;;cAAa,aAAA,MAAoB,KAAA,EAAO,CAAA,IAAK,SAAA,cAAqB,CAAA,GAAI,CAAA"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { DeepTransformContent, IInterpreterPluginState, Plugins } from "./getContent/plugins.js";
|
|
2
|
-
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
|
-
import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
|
+
import { Dictionary, DictionarySelector, QualifiedDictionaryGroup, ResolveQualifiedDictionaryContent } from "@intlayer/types/dictionary";
|
|
3
|
+
import { DeclaredLocales, ExtractSelectorLocale, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
4
4
|
|
|
5
5
|
//#region src/interpreter/getDictionary.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Transforms a dictionary in a single pass, applying each plugin as needed.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Also accepts a `QualifiedDictionaryGroup` (collections, variants, meta
|
|
10
|
+
* records) together with a selector as second argument — the group is resolved
|
|
11
|
+
* to a single entry (or an ordered array of entries for collections without an
|
|
12
|
+
* `item` selector) before transformation.
|
|
13
|
+
*
|
|
14
|
+
* @param dictionary The dictionary (or qualified dictionary group) to transform.
|
|
15
|
+
* @param localeOrSelector The locale, or a selector object (`{ item }`,
|
|
16
|
+
* `{ variant }`, `{ id, ...meta }`, optionally with `locale`).
|
|
17
|
+
* @param plugins An array of NodeTransformer that define how to transform recognized nodes.
|
|
18
|
+
* If omitted, we’ll use a default set of plugins.
|
|
13
19
|
*/
|
|
14
|
-
declare const getDictionary: <const T extends Dictionary, const
|
|
20
|
+
declare const getDictionary: <const T extends Dictionary | QualifiedDictionaryGroup, const A extends LocalesValues | DictionarySelector = DeclaredLocales>(dictionary: T, localeOrSelector?: A, plugins?: Plugins[]) => DeepTransformContent<ResolveQualifiedDictionaryContent<T, A>, IInterpreterPluginState, ExtractSelectorLocale<A>>;
|
|
15
21
|
//#endregion
|
|
16
22
|
export { getDictionary };
|
|
17
23
|
//# sourceMappingURL=getDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../../src/interpreter/getDictionary.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../../src/interpreter/getDictionary.ts"],"mappings":";;;;;;;;AAqCA;;;;;;;;;;;cAAa,aAAA,mBACK,UAAA,GAAa,wBAAA,kBACb,aAAA,GAAgB,kBAAA,GAAqB,eAAA,EAErD,UAAA,EAAY,CAAA,EACZ,gBAAA,GAAmB,CAAA,EACnB,OAAA,GAAU,OAAA,OACT,oBAAA,CACD,iCAAA,CAAkC,CAAA,EAAG,CAAA,GACrC,uBAAA,EACA,qBAAA,CAAsB,CAAA"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { DeepTransformContent, IInterpreterPluginState, Plugins } from "./getContent/plugins.js";
|
|
2
|
-
import {
|
|
2
|
+
import { DictionarySelector } from "@intlayer/types/dictionary";
|
|
3
|
+
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, ExtractSelectorLocale, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
4
|
|
|
4
5
|
//#region src/interpreter/getIntlayer.d.ts
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Picks one dictionary by its key and returns its content for the given
|
|
8
|
+
* locale or selector.
|
|
9
|
+
*
|
|
10
|
+
* The second argument is either a locale (`'fr'`) or a selector object:
|
|
11
|
+
* - `{ item: 2 }` — collection item (omit `item` to get every item as array)
|
|
12
|
+
* - `{ variant: 'black-friday' }` — named variant (omit for the `default` one)
|
|
13
|
+
* - `{ id: 'prod_abc', ...metaFields }` — meta record
|
|
14
|
+
* - `locale` can be combined with any selector: `{ item: 2, locale: 'fr' }`
|
|
15
|
+
*/
|
|
16
|
+
declare const getIntlayer: <const T extends DictionaryKeys, const A extends LocalesValues | DictionarySelector = DeclaredLocales>(key: T, localeOrSelector?: A, plugins?: Plugins[]) => DeepTransformContent<DictionaryRegistryResult<T, A>, IInterpreterPluginState, ExtractSelectorLocale<A>>;
|
|
6
17
|
//#endregion
|
|
7
18
|
export { getIntlayer };
|
|
8
19
|
//# sourceMappingURL=getIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIntlayer.d.ts","names":[],"sources":["../../../src/interpreter/getIntlayer.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getIntlayer.d.ts","names":[],"sources":["../../../src/interpreter/getIntlayer.ts"],"mappings":";;;;;;;;AAkEA;;;;;;;cAAa,WAAA,mBACK,cAAA,kBACA,aAAA,GAAgB,kBAAA,GAAqB,eAAA,EAErD,GAAA,EAAK,CAAA,EACL,gBAAA,GAAmB,CAAA,EACnB,OAAA,GAAU,OAAA,OACT,oBAAA,CACD,wBAAA,CAAyB,CAAA,EAAG,CAAA,GAC5B,uBAAA,EACA,qBAAA,CAAsB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PluralContentState } from "../transpiler/plural/plural.js";
|
|
2
|
+
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
2
3
|
import { DeclaredLocales } from "@intlayer/types";
|
|
3
|
-
import { LocalesValues } from "intlayer";
|
|
4
4
|
|
|
5
5
|
//#region src/interpreter/getPlural.d.ts
|
|
6
6
|
/**
|