@intlayer/core 9.0.0-canary.10 → 9.0.0-canary.12
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/dictionaryManipulator/index.cjs +3 -3
- package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs +8 -6
- package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs.map +1 -1
- package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs +81 -40
- package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs.map +1 -1
- package/dist/cjs/index.cjs +5 -3
- package/dist/cjs/messageFormat/index.cjs +2 -0
- package/dist/cjs/messageFormat/navigatePath.cjs +38 -0
- package/dist/cjs/messageFormat/navigatePath.cjs.map +1 -0
- package/dist/esm/dictionaryManipulator/index.mjs +2 -2
- package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs +9 -7
- package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs.map +1 -1
- package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs +79 -38
- package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs.map +1 -1
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/messageFormat/index.mjs +2 -1
- package/dist/esm/messageFormat/navigatePath.mjs +36 -0
- package/dist/esm/messageFormat/navigatePath.mjs.map +1 -0
- 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/index.d.ts +1 -0
- package/dist/types/@intlayer/core/dist/types/localization/comparePaths.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/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/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/getFilterMissingTranslationsContent.d.ts +1 -1
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +1 -1
- package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +1 -1
- package/dist/types/dictionaryManipulator/index.d.ts +2 -2
- package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts +33 -22
- package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/intlayer/dist/types/index.d.ts +4 -0
- package/dist/types/messageFormat/index.d.ts +2 -1
- package/dist/types/messageFormat/navigatePath.d.ts +22 -0
- package/dist/types/messageFormat/navigatePath.d.ts.map +1 -0
- package/package.json +6 -6
|
@@ -11,21 +11,60 @@ const QUALIFIER_ORDER = ["variant", "item"];
|
|
|
11
11
|
*/
|
|
12
12
|
const COMPOSITE_ID_SEPARATOR = "/";
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Characters kept verbatim in an encoded qualifier segment. Everything else is
|
|
15
|
+
* percent-encoded so a segment can never contain the composite-id separator
|
|
16
|
+
* (`/`), path-hostile characters (`\` `:` `*` `?` `"` `<` `>` `|`, control
|
|
17
|
+
* chars), or characters that would break the generated loader modules (`'`).
|
|
18
|
+
*/
|
|
19
|
+
const SEGMENT_UNSAFE_CHARS = /[^A-Za-z0-9._&=-]/g;
|
|
20
|
+
/**
|
|
21
|
+
* Stricter set for the components of an object variant: also encodes `&` and
|
|
22
|
+
* `=` so the `field=value&field=value` serialization stays unambiguous.
|
|
23
|
+
*/
|
|
24
|
+
const COMPONENT_UNSAFE_CHARS = /[^A-Za-z0-9._-]/g;
|
|
25
|
+
/** Percent-encodes one UTF-16 code unit as a fixed-width `%XXXX` run. */
|
|
26
|
+
const percentEncodeChar = (char) => `%${char.charCodeAt(0).toString(16).toUpperCase().padStart(4, "0")}`;
|
|
27
|
+
const encodeSegmentText = (raw, unsafeChars) => {
|
|
28
|
+
if (raw === "") return "%";
|
|
29
|
+
const encoded = raw.replace(unsafeChars, percentEncodeChar);
|
|
30
|
+
if (encoded === "." || encoded === "..") return encoded.replace(/\./g, "%002E");
|
|
31
|
+
return encoded;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Canonical serialization of a single variant value into its identity string —
|
|
35
|
+
* the variant segment of a composite id, the chunk directory name in dynamic
|
|
36
|
+
* mode, and the runtime matching key.
|
|
16
37
|
*
|
|
17
38
|
* - `undefined` → `'default'` (the implicit fallback variant)
|
|
18
39
|
* - a string → the string itself (a named variant)
|
|
19
40
|
* - an object → its sorted `key=value` pairs joined by `&`
|
|
20
41
|
* (e.g. `{ userId: '123', id: 'abc' }` → `'id=abc&userId=123'`)
|
|
21
42
|
*
|
|
43
|
+
* Characters that are unsafe in file paths or generated code are
|
|
44
|
+
* percent-encoded (fixed-width `%XXXX` runs, injective). Common names —
|
|
45
|
+
* letters, digits, `-` `_` `.` — are left untouched. Both the declaration and
|
|
46
|
+
* the selector go through this function, so encoding never affects matching.
|
|
47
|
+
*
|
|
22
48
|
* Two variants resolve to the same entry iff their serializations are equal, so
|
|
23
49
|
* an object variant in a selector must equal the one declared on the dictionary.
|
|
24
50
|
*/
|
|
25
51
|
const serializeVariant = (variant) => {
|
|
26
52
|
if (variant === void 0) return "default";
|
|
27
|
-
if (typeof variant === "string") return variant;
|
|
28
|
-
return Object.keys(variant).sort().map((field) => `${field}=${variant[field]}`).join("&");
|
|
53
|
+
if (typeof variant === "string") return encodeSegmentText(variant, SEGMENT_UNSAFE_CHARS);
|
|
54
|
+
return Object.keys(variant).sort().map((field) => `${encodeSegmentText(field, COMPONENT_UNSAFE_CHARS)}=${encodeSegmentText(String(variant[field]), COMPONENT_UNSAFE_CHARS)}`).join("&");
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Normalizes the `variant` field of a dictionary into the list of variant ids
|
|
58
|
+
* the declaration registers under. A single value yields one id; an **array**
|
|
59
|
+
* fans out into one id per element (duplicates collapsed). Returns `undefined`
|
|
60
|
+
* when the dictionary does not declare the variant dimension (no `variant`
|
|
61
|
+
* field, or an empty array).
|
|
62
|
+
*/
|
|
63
|
+
const getVariantIds = (variant) => {
|
|
64
|
+
if (variant === void 0) return void 0;
|
|
65
|
+
const values = Array.isArray(variant) ? variant : [variant];
|
|
66
|
+
if (values.length === 0) return void 0;
|
|
67
|
+
return [...new Set(values.map(serializeVariant))];
|
|
29
68
|
};
|
|
30
69
|
/**
|
|
31
70
|
* Returns the qualifier dimensions declared on a dictionary, in canonical
|
|
@@ -34,49 +73,51 @@ const serializeVariant = (variant) => {
|
|
|
34
73
|
*/
|
|
35
74
|
const getDictionaryQualifierTypes = (dictionary) => {
|
|
36
75
|
const declaredQualifiers = [];
|
|
37
|
-
if (dictionary.variant !== void 0) declaredQualifiers.push("variant");
|
|
76
|
+
if (getVariantIds(dictionary.variant) !== void 0) declaredQualifiers.push("variant");
|
|
38
77
|
if (typeof dictionary.item === "number") declaredQualifiers.push("item");
|
|
39
78
|
return declaredQualifiers;
|
|
40
79
|
};
|
|
41
80
|
/**
|
|
42
|
-
* Returns the qualifier
|
|
43
|
-
* dimension —
|
|
81
|
+
* Returns the qualifier identifiers of a dictionary for the given qualifier
|
|
82
|
+
* dimension — the candidate segments of the composite entry ids.
|
|
44
83
|
*
|
|
45
|
-
* - 'variant' → the serialized variant (
|
|
46
|
-
* -
|
|
84
|
+
* - 'variant' → the serialized variant id(s); an array variant yields one id
|
|
85
|
+
* per element (declaration-side fan-out)
|
|
86
|
+
* - 'item' → the item index as a single-element list
|
|
47
87
|
*/
|
|
48
|
-
const
|
|
49
|
-
if (qualifierType === "variant") return
|
|
50
|
-
return dictionary.item === void 0 ? void 0 : String(dictionary.item);
|
|
88
|
+
const getDictionaryQualifierIds = (dictionary, qualifierType) => {
|
|
89
|
+
if (qualifierType === "variant") return getVariantIds(dictionary.variant);
|
|
90
|
+
return dictionary.item === void 0 ? void 0 : [String(dictionary.item)];
|
|
51
91
|
};
|
|
52
92
|
/**
|
|
53
|
-
*
|
|
54
|
-
* dimension
|
|
55
|
-
*
|
|
93
|
+
* Builds every composite entry id of a dictionary — the cartesian product of
|
|
94
|
+
* its per-dimension id lists, joined in canonical order. A dictionary with a
|
|
95
|
+
* plain (non-array) variant yields exactly one id; an array variant fans out
|
|
96
|
+
* into one id per element. `undefined` when a dimension of the set is missing.
|
|
56
97
|
*/
|
|
57
|
-
const
|
|
58
|
-
|
|
98
|
+
const getDictionaryCompositeIds = (dictionary, qualifierTypes) => {
|
|
99
|
+
let compositeIds = [""];
|
|
59
100
|
for (const qualifierType of qualifierTypes) {
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
101
|
+
const ids = getDictionaryQualifierIds(dictionary, qualifierType);
|
|
102
|
+
if (ids === void 0) return void 0;
|
|
103
|
+
compositeIds = compositeIds.flatMap((prefix) => ids.map((id) => prefix === "" ? id : `${prefix}${"/"}${id}`));
|
|
63
104
|
}
|
|
64
|
-
return
|
|
105
|
+
return compositeIds;
|
|
65
106
|
};
|
|
66
107
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* Tests whether a group entry matches a selector across every declared
|
|
73
|
-
* dimension. The `item` dimension matches any value when the selector does not
|
|
74
|
-
* provide one (open collection axis).
|
|
108
|
+
* Tests whether a composite entry id matches a selector across every declared
|
|
109
|
+
* dimension. Segments are compared in their encoded form (both the stored id
|
|
110
|
+
* and the selector go through {@link serializeVariant}). The `item` dimension
|
|
111
|
+
* matches any value when the selector does not provide one (open collection
|
|
112
|
+
* axis).
|
|
75
113
|
*/
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
|
|
114
|
+
const compositeIdMatchesSelector = (compositeId, qualifierTypes, selector) => {
|
|
115
|
+
const segments = compositeId.split("/");
|
|
116
|
+
return qualifierTypes.every((qualifierType, index) => {
|
|
117
|
+
if (qualifierType === "variant") return segments[index] === serializeVariant(selector?.variant);
|
|
118
|
+
return selector?.item === void 0 || segments[index] === String(selector.item);
|
|
119
|
+
});
|
|
120
|
+
};
|
|
80
121
|
/**
|
|
81
122
|
* Type guard discriminating a `QualifiedDictionaryGroup` (merge output of a
|
|
82
123
|
* qualified key) from a plain `Dictionary`. Both carry a `content` field; only
|
|
@@ -88,11 +129,11 @@ const isQualifiedDictionaryGroup = (value) => typeof value === "object" && value
|
|
|
88
129
|
* qualified group: the content node stored under its composite id, plus the
|
|
89
130
|
* qualifier coordinates decoded from that id (`variant`, `item`).
|
|
90
131
|
*
|
|
91
|
-
* This keeps the resolver's
|
|
132
|
+
* This keeps the resolver's transform code unchanged: it still sees a
|
|
92
133
|
* `{ key, content, variant?, item? }` shape, even though the stored format no
|
|
93
134
|
* longer duplicates those fields per entry. The `variant` coordinate stays in
|
|
94
|
-
* its serialized form
|
|
95
|
-
*
|
|
135
|
+
* its serialized (encoded) form, e.g. `'id=abc&userId=123'` — matching happens
|
|
136
|
+
* on the composite id segments, never on this reconstructed field.
|
|
96
137
|
*/
|
|
97
138
|
const reconstructQualifiedEntry = (group, compositeId) => {
|
|
98
139
|
const segments = compositeId.split("/");
|
|
@@ -123,7 +164,7 @@ const resolveQualifiedDictionary = (dictionaryOrGroup, selector) => {
|
|
|
123
164
|
if (!isQualifiedDictionaryGroup(dictionaryOrGroup)) return dictionaryOrGroup;
|
|
124
165
|
const { qualifierTypes, content } = dictionaryOrGroup;
|
|
125
166
|
const itemAxisOpen = qualifierTypes.includes("item") && selector?.item === void 0;
|
|
126
|
-
const matchedEntries = Object.keys(content).
|
|
167
|
+
const matchedEntries = Object.keys(content).filter((compositeId) => compositeIdMatchesSelector(compositeId, qualifierTypes, selector)).map((compositeId) => reconstructQualifiedEntry(dictionaryOrGroup, compositeId));
|
|
127
168
|
if (itemAxisOpen) return matchedEntries.sort((left, right) => (left.item ?? 0) - (right.item ?? 0));
|
|
128
169
|
return matchedEntries[0] ?? null;
|
|
129
170
|
};
|
|
@@ -255,5 +296,5 @@ const resolveQualifiedDynamicContentAsync = async (params) => {
|
|
|
255
296
|
};
|
|
256
297
|
|
|
257
298
|
//#endregion
|
|
258
|
-
export { COMPOSITE_ID_SEPARATOR, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER,
|
|
299
|
+
export { COMPOSITE_ID_SEPARATOR, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getVariantIds, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, parseDictionarySelector, reconstructQualifiedEntry, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, serializeVariant };
|
|
259
300
|
//# sourceMappingURL=qualifiedDictionary.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qualifiedDictionary.mjs","names":[],"sources":["../../../src/dictionaryManipulator/qualifiedDictionary.ts"],"sourcesContent":["import type {\n Dictionary,\n DictionaryQualifierType,\n DictionarySelector,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\n/**\n * Canonical order of qualifier dimensions. A key that declares both dimensions\n * always nests them in this order, with `item` innermost so it can act as the\n * collection (array) axis.\n */\nexport const QUALIFIER_ORDER = [\n 'variant',\n 'item',\n] as const satisfies readonly DictionaryQualifierType[];\n\n/**\n * Separator joining per-dimension ids into a composite entry id. Also used as\n * the chunk path separator in dynamic mode.\n */\nexport const COMPOSITE_ID_SEPARATOR = '/';\n\n/**\n * Canonical serialization of a variant value into its identity string — the\n * variant segment of a composite id and the runtime matching key.\n *\n * - `undefined` → `'default'` (the implicit fallback variant)\n * - a string → the string itself (a named variant)\n * - an object → its sorted `key=value` pairs joined by `&`\n * (e.g. `{ userId: '123', id: 'abc' }` → `'id=abc&userId=123'`)\n *\n * Two variants resolve to the same entry iff their serializations are equal, so\n * an object variant in a selector must equal the one declared on the dictionary.\n */\nexport const serializeVariant = (\n variant: string | Record<string, string | number> | undefined\n): string => {\n if (variant === undefined) return 'default';\n if (typeof variant === 'string') return variant;\n\n return Object.keys(variant)\n .sort()\n .map((field) => `${field}=${variant[field]}`)\n .join('&');\n};\n\n/**\n * Returns the qualifier dimensions declared on a dictionary, in canonical\n * order (`variant → item`). Empty when the dictionary is unqualified\n * (plain dictionary or shared base content of a qualified group).\n */\nexport const getDictionaryQualifierTypes = (\n dictionary: Dictionary\n): DictionaryQualifierType[] => {\n const declaredQualifiers: DictionaryQualifierType[] = [];\n\n if (dictionary.variant !== undefined) declaredQualifiers.push('variant');\n if (typeof dictionary.item === 'number') declaredQualifiers.push('item');\n\n return declaredQualifiers;\n};\n\n/**\n * Returns the qualifier identifier of a dictionary for the given qualifier\n * dimension — one segment of the composite entry id.\n *\n * - 'variant' → the serialized variant (named string or object identity)\n * - 'item' → the item index as string\n */\nexport const getDictionaryQualifierId = (\n dictionary: Dictionary,\n qualifierType: DictionaryQualifierType\n): string | undefined => {\n if (qualifierType === 'variant') {\n return dictionary.variant === undefined\n ? undefined\n : serializeVariant(dictionary.variant);\n }\n return dictionary.item === undefined ? undefined : String(dictionary.item);\n};\n\n/**\n * Returns the per-dimension id segments of a dictionary for the given ordered\n * dimension set, or `undefined` when the dictionary does not declare every\n * dimension of the set.\n */\nexport const getDictionaryQualifierSegments = (\n dictionary: Dictionary,\n qualifierTypes: DictionaryQualifierType[]\n): string[] | undefined => {\n const segments: string[] = [];\n\n for (const qualifierType of qualifierTypes) {\n const id = getDictionaryQualifierId(dictionary, qualifierType);\n if (id === undefined) return undefined;\n segments.push(id);\n }\n\n return segments;\n};\n\n/**\n * Builds the composite entry id of a dictionary — its per-dimension id segments\n * joined in canonical order. `undefined` when a dimension is missing.\n */\nexport const getDictionaryCompositeId = (\n dictionary: Dictionary,\n qualifierTypes: DictionaryQualifierType[]\n): string | undefined =>\n getDictionaryQualifierSegments(dictionary, qualifierTypes)?.join(\n COMPOSITE_ID_SEPARATOR\n );\n\n/**\n * Tests whether a group entry matches a selector across every declared\n * dimension. The `item` dimension matches any value when the selector does not\n * provide one (open collection axis).\n */\nconst entryMatchesSelector = (\n entry: Dictionary,\n qualifierTypes: DictionaryQualifierType[],\n selector: DictionarySelector | undefined\n): boolean =>\n qualifierTypes.every((qualifierType) => {\n if (qualifierType === 'variant') {\n return (\n serializeVariant(entry.variant) === serializeVariant(selector?.variant)\n );\n }\n\n // qualifierType === 'item'\n return (\n selector?.item === undefined ||\n String(entry.item) === String(selector.item)\n );\n });\n\n/**\n * Type guard discriminating a `QualifiedDictionaryGroup` (merge output of a\n * qualified key) from a plain `Dictionary`. Both carry a `content` field; only\n * the group declares `qualifierTypes`, which is therefore the discriminator.\n */\nexport const isQualifiedDictionaryGroup = (\n value: unknown\n): value is QualifiedDictionaryGroup =>\n typeof value === 'object' &&\n value !== null &&\n 'qualifierTypes' in value &&\n Array.isArray((value as { qualifierTypes: unknown }).qualifierTypes) &&\n 'content' in value;\n\n/**\n * Reconstructs a resolvable {@link Dictionary} from a single entry of a\n * qualified group: the content node stored under its composite id, plus the\n * qualifier coordinates decoded from that id (`variant`, `item`).\n *\n * This keeps the resolver's matching/transform code unchanged: it still sees a\n * `{ key, content, variant?, item? }` shape, even though the stored format no\n * longer duplicates those fields per entry. The `variant` coordinate stays in\n * its serialized form (e.g. `'id=abc&userId=123'`), which round-trips through\n * {@link serializeVariant} during matching.\n */\nexport const reconstructQualifiedEntry = (\n group: QualifiedDictionaryGroup,\n compositeId: string\n): Dictionary => {\n const segments = compositeId.split(COMPOSITE_ID_SEPARATOR);\n\n const entry = {\n key: group.key,\n content: group.content[compositeId],\n } as Dictionary;\n\n group.qualifierTypes.forEach((qualifierType, index) => {\n if (qualifierType === 'variant') {\n entry.variant = segments[index];\n } else if (qualifierType === 'item') {\n entry.item = Number(segments[index]);\n }\n });\n\n return entry;\n};\n\n/**\n * Resolves a dictionary (or qualified dictionary group) against a selector,\n * across every declared dimension.\n *\n * - Plain dictionary → returned as-is (selector ignored)\n * - `item` declared but not selected → every matching entry ordered by index\n * - `item` selected → the matching entry or null\n * - `variant` defaults to the `default` entry when not selected; an object\n * variant resolves only when the selector provides an equal object\n *\n * Dimensions compose: e.g. a variant × item key with `{ variant: 'promo' }`\n * returns every promo item as an array; adding `{ item: 2 }` narrows to one.\n */\nexport const resolveQualifiedDictionary = (\n dictionaryOrGroup: Dictionary | QualifiedDictionaryGroup,\n selector?: DictionarySelector\n): Dictionary | Dictionary[] | null => {\n if (!isQualifiedDictionaryGroup(dictionaryOrGroup)) {\n return dictionaryOrGroup;\n }\n\n const { qualifierTypes, content } = dictionaryOrGroup;\n\n const itemAxisOpen =\n qualifierTypes.includes('item') && selector?.item === undefined;\n\n const matchedEntries = Object.keys(content)\n .map((compositeId) =>\n reconstructQualifiedEntry(dictionaryOrGroup, compositeId)\n )\n .filter((entry) => entryMatchesSelector(entry, qualifierTypes, selector));\n\n if (itemAxisOpen) {\n return matchedEntries.sort(\n (left, right) => (left.item ?? 0) - (right.item ?? 0)\n );\n }\n\n return matchedEntries[0] ?? null;\n};\n\n/**\n * Splits the second argument of `getIntlayer` / `getDictionary` into the\n * effective locale and the selector object (if any).\n */\nexport const parseDictionarySelector = <L extends LocalesValues>(\n localeOrSelector?: L | DictionarySelector\n): { locale?: L; selector?: DictionarySelector } => {\n if (typeof localeOrSelector === 'object' && localeOrSelector !== null) {\n return {\n locale: localeOrSelector.locale as L | undefined,\n selector: localeOrSelector,\n };\n }\n\n return { locale: localeOrSelector };\n};\n\n/**\n * Builds a stable string identity of a selector (excluding `locale`), suitable\n * for cache keys and memoization dependencies.\n */\nexport const getDictionarySelectorCacheKey = (\n selector?: DictionarySelector\n): string => {\n if (!selector) return '';\n\n return Object.keys(selector)\n .filter((selectorKey) => selectorKey !== 'locale')\n .sort()\n .map((selectorKey) => {\n const value = selector[selectorKey as keyof DictionarySelector];\n const serialized =\n selectorKey === 'variant'\n ? serializeVariant(value as Parameters<typeof serializeVariant>[0])\n : String(value);\n return `${selectorKey}:${serialized}`;\n })\n .join('|');\n};\n\n/**\n * Marker property carrying the ordered qualifier dimensions on a dynamic loader\n * map. Its presence distinguishes a qualified group loader map (a nested tree\n * of chunks) from a plain dynamic loader map (one chunk per `locale`). Prefixed\n * and unlikely to collide with a real locale code.\n */\nexport const QUALIFIER_DYNAMIC_TYPES_KEY = '__intlayerQualifierTypes';\n\n/**\n * A lazily-imported per-locale dictionary chunk loader.\n */\nexport type DynamicDictionaryLoader = () => Promise<Dictionary>;\n\n/**\n * Nested tree of chunk loaders: one nesting level per declared dimension (in\n * canonical order), leaves are loaders.\n */\nexport type QualifiedDynamicLoaderTree = {\n [segment: string]: QualifiedDynamicLoaderTree | DynamicDictionaryLoader;\n};\n\n/**\n * Default export shape of a generated dynamic entry point for a qualified key.\n * One nesting level per dimension under each locale, plus the dimension marker.\n *\n * ```ts\n * {\n * __intlayerQualifierTypes: ['variant', 'item'],\n * en: { promo: { '1': () => import('./json/x/promo/1/en.json'), … }, … },\n * fr: { … },\n * }\n * ```\n */\nexport type QualifiedDynamicLoaderMap = {\n [QUALIFIER_DYNAMIC_TYPES_KEY]: DictionaryQualifierType[];\n [locale: string]: QualifiedDynamicLoaderTree | DictionaryQualifierType[];\n};\n\n/**\n * Type guard discriminating a qualified dynamic loader map (collections /\n * variants, possibly combined) from a plain dynamic loader map.\n */\nexport const isQualifiedDynamicLoaderMap = (\n value: unknown\n): value is QualifiedDynamicLoaderMap =>\n typeof value === 'object' &&\n value !== null &&\n QUALIFIER_DYNAMIC_TYPES_KEY in value;\n\n/**\n/** One targeted chunk: its stable cache key and lazy loader. */\ntype CollectedChunk = {\n cacheKey: string;\n loader: DynamicDictionaryLoader;\n};\n\ntype CollectedChunks = {\n /** True when the `item` axis is open (collection result → array). */\n itemAxisOpen: boolean;\n /** True when a required coordinate is absent (result → [] or null). */\n missed: boolean;\n /** The chunks the selector targets (in collection order for the item axis). */\n chunks: CollectedChunk[];\n};\n\n/**\n * Walks the loader tree following the selector and collects the chunk loaders\n * it targets — shared by the sync ({@link resolveQualifiedDynamicContent}) and\n * async ({@link resolveQualifiedDynamicContentAsync}) resolvers.\n */\nconst collectQualifiedChunks = (\n loaderMap: QualifiedDynamicLoaderMap,\n key: string,\n locale: string,\n selector: DictionarySelector | undefined\n): CollectedChunks => {\n const qualifierTypes = loaderMap[QUALIFIER_DYNAMIC_TYPES_KEY];\n const localeTree = loaderMap[locale] as\n | QualifiedDynamicLoaderTree\n | undefined;\n\n const itemAxisOpen =\n qualifierTypes.includes('item') && selector?.item === undefined;\n\n if (!localeTree) return { itemAxisOpen, missed: true, chunks: [] };\n\n const chunks: CollectedChunk[] = [];\n\n const walk = (\n node: QualifiedDynamicLoaderTree | DynamicDictionaryLoader,\n dimensions: DictionaryQualifierType[],\n segments: string[]\n ): boolean => {\n if (dimensions.length === 0) {\n chunks.push({\n cacheKey: `${key}.${locale}.${segments.join(COMPOSITE_ID_SEPARATOR)}`,\n loader: node as DynamicDictionaryLoader,\n });\n return true;\n }\n\n const [dimension, ...rest] = dimensions;\n const tree = node as QualifiedDynamicLoaderTree;\n\n if (dimension === 'item' && selector?.item === undefined) {\n // Open collection axis: fan out into every sibling chunk, ordered.\n for (const segment of Object.keys(tree).sort(\n (left, right) => Number(left) - Number(right)\n )) {\n walk(tree[segment]!, rest, [...segments, segment]);\n }\n return true;\n }\n\n const segment =\n dimension === 'variant'\n ? serializeVariant(selector?.variant)\n : String(selector?.item);\n\n const child = tree[segment];\n if (!child) return false;\n\n return walk(child, rest, [...segments, segment]);\n };\n\n const found = walk(localeTree, qualifierTypes, []);\n\n return { itemAxisOpen, missed: !found, chunks };\n};\n\n/**\n * Resolves the content of a qualified dynamic loader map against a selector,\n * loading only the chunk(s) the selector actually targets.\n *\n * Walks the nested loader tree one dimension at a time (canonical order\n * `variant → item`): `variant` defaults to `default` (or descends by the\n * serialized object identity), and `item` either narrows to the selected index\n * or — when no item is given — expands into every sibling chunk (the collection\n * axis). Semantics mirror {@link resolveQualifiedDictionary} so dynamic and\n * static modes behave alike.\n *\n * The Suspense mechanism is injected through `loadChunk` so the same logic\n * serves both the client (suspender cache) and the server (`react.use`). Every\n * targeted loader is started before the first chunk is read, so sibling chunks\n * load in parallel rather than waterfalling.\n *\n * @param loaderMap - The qualified dynamic loader map (entry point default export).\n * @param key - The dictionary key (used to build stable chunk cache keys).\n * @param locale - The resolved locale to load chunks for.\n * @param selector - The selector splitting the qualifier dimensions.\n * @param loadChunk - Reads a started chunk promise, suspending until it resolves.\n * @param transform - Turns a resolved chunk dictionary into final content.\n */\nexport const resolveQualifiedDynamicContent = <Content>(params: {\n loaderMap: QualifiedDynamicLoaderMap;\n key: string;\n locale: string;\n selector: DictionarySelector | undefined;\n loadChunk: (cacheKey: string, promise: Promise<Dictionary>) => Dictionary;\n transform: (dictionary: Dictionary) => Content;\n}): Content | Content[] | null => {\n const { loaderMap, key, locale, selector, loadChunk, transform } = params;\n\n const { itemAxisOpen, missed, chunks } = collectQualifiedChunks(\n loaderMap,\n key,\n locale,\n selector\n );\n\n if (missed) return itemAxisOpen ? [] : null;\n\n // Start every loader before reading, so siblings load in parallel.\n const dictionaries = chunks.map(({ cacheKey, loader }) =>\n loadChunk(cacheKey, loader())\n );\n\n if (itemAxisOpen) return dictionaries.map(transform);\n\n const [dictionary] = dictionaries;\n return dictionary ? transform(dictionary) : null;\n};\n\n/**\n * Async counterpart of {@link resolveQualifiedDynamicContent} for frameworks\n * that load dictionaries with `await` instead of Suspense (Vue, Svelte, Lit,\n * vanilla). Awaits every targeted chunk in parallel, then resolves identically.\n *\n * @param loaderMap - The qualified dynamic loader map.\n * @param key - The dictionary key (used to build stable chunk cache keys).\n * @param locale - The resolved locale to load chunks for.\n * @param selector - The selector splitting the qualifier dimensions.\n * @param transform - Turns a resolved chunk dictionary into final content.\n */\nexport const resolveQualifiedDynamicContentAsync = async <Content>(params: {\n loaderMap: QualifiedDynamicLoaderMap;\n key: string;\n locale: string;\n selector: DictionarySelector | undefined;\n transform: (dictionary: Dictionary) => Content;\n}): Promise<Content | Content[] | null> => {\n const { loaderMap, key, locale, selector, transform } = params;\n\n const { itemAxisOpen, missed, chunks } = collectQualifiedChunks(\n loaderMap,\n key,\n locale,\n selector\n );\n\n if (missed) return itemAxisOpen ? [] : null;\n\n const dictionaries = await Promise.all(chunks.map(({ loader }) => loader()));\n\n if (itemAxisOpen) return dictionaries.map(transform);\n\n const [dictionary] = dictionaries;\n return dictionary ? transform(dictionary) : null;\n};\n"],"mappings":";;;;;;AAaA,MAAa,kBAAkB,CAC7B,WACA,OACD;;;;;AAMD,MAAa,yBAAyB;;;;;;;;;;;;;AActC,MAAa,oBACX,YACW;AACX,KAAI,YAAY,OAAW,QAAO;AAClC,KAAI,OAAO,YAAY,SAAU,QAAO;AAExC,QAAO,OAAO,KAAK,QAAQ,CACxB,MAAM,CACN,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,SAAS,CAC5C,KAAK,IAAI;;;;;;;AAQd,MAAa,+BACX,eAC8B;CAC9B,MAAM,qBAAgD,EAAE;AAExD,KAAI,WAAW,YAAY,OAAW,oBAAmB,KAAK,UAAU;AACxE,KAAI,OAAO,WAAW,SAAS,SAAU,oBAAmB,KAAK,OAAO;AAExE,QAAO;;;;;;;;;AAUT,MAAa,4BACX,YACA,kBACuB;AACvB,KAAI,kBAAkB,UACpB,QAAO,WAAW,YAAY,SAC1B,SACA,iBAAiB,WAAW,QAAQ;AAE1C,QAAO,WAAW,SAAS,SAAY,SAAY,OAAO,WAAW,KAAK;;;;;;;AAQ5E,MAAa,kCACX,YACA,mBACyB;CACzB,MAAM,WAAqB,EAAE;AAE7B,MAAK,MAAM,iBAAiB,gBAAgB;EAC1C,MAAM,KAAK,yBAAyB,YAAY,cAAc;AAC9D,MAAI,OAAO,OAAW,QAAO;AAC7B,WAAS,KAAK,GAAG;;AAGnB,QAAO;;;;;;AAOT,MAAa,4BACX,YACA,mBAEA,+BAA+B,YAAY,eAAe,EAAE,SAE3D;;;;;;AAOH,MAAM,wBACJ,OACA,gBACA,aAEA,eAAe,OAAO,kBAAkB;AACtC,KAAI,kBAAkB,UACpB,QACE,iBAAiB,MAAM,QAAQ,KAAK,iBAAiB,UAAU,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;;;;;;;;;AA0BjD,MAAa,kCAA2C,WAOtB;CAChC,MAAM,EAAE,WAAW,KAAK,QAAQ,UAAU,WAAW,cAAc;CAEnE,MAAM,EAAE,cAAc,QAAQ,WAAW,uBACvC,WACA,KACA,QACA,SACD;AAED,KAAI,OAAQ,QAAO,eAAe,EAAE,GAAG;CAGvC,MAAM,eAAe,OAAO,KAAK,EAAE,UAAU,aAC3C,UAAU,UAAU,QAAQ,CAAC,CAC9B;AAED,KAAI,aAAc,QAAO,aAAa,IAAI,UAAU;CAEpD,MAAM,CAAC,cAAc;AACrB,QAAO,aAAa,UAAU,WAAW,GAAG;;;;;;;;;;;;;AAc9C,MAAa,sCAAsC,OAAgB,WAMxB;CACzC,MAAM,EAAE,WAAW,KAAK,QAAQ,UAAU,cAAc;CAExD,MAAM,EAAE,cAAc,QAAQ,WAAW,uBACvC,WACA,KACA,QACA,SACD;AAED,KAAI,OAAQ,QAAO,eAAe,EAAE,GAAG;CAEvC,MAAM,eAAe,MAAM,QAAQ,IAAI,OAAO,KAAK,EAAE,aAAa,QAAQ,CAAC,CAAC;AAE5E,KAAI,aAAc,QAAO,aAAa,IAAI,UAAU;CAEpD,MAAM,CAAC,cAAc;AACrB,QAAO,aAAa,UAAU,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"file":"qualifiedDictionary.mjs","names":[],"sources":["../../../src/dictionaryManipulator/qualifiedDictionary.ts"],"sourcesContent":["import type {\n Dictionary,\n DictionaryQualifierType,\n DictionarySelector,\n DictionaryVariantValue,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\n/**\n * Canonical order of qualifier dimensions. A key that declares both dimensions\n * always nests them in this order, with `item` innermost so it can act as the\n * collection (array) axis.\n */\nexport const QUALIFIER_ORDER = [\n 'variant',\n 'item',\n] as const satisfies readonly DictionaryQualifierType[];\n\n/**\n * Separator joining per-dimension ids into a composite entry id. Also used as\n * the chunk path separator in dynamic mode.\n */\nexport const COMPOSITE_ID_SEPARATOR = '/';\n\n/**\n * Characters kept verbatim in an encoded qualifier segment. Everything else is\n * percent-encoded so a segment can never contain the composite-id separator\n * (`/`), path-hostile characters (`\\` `:` `*` `?` `\"` `<` `>` `|`, control\n * chars), or characters that would break the generated loader modules (`'`).\n */\nconst SEGMENT_UNSAFE_CHARS = /[^A-Za-z0-9._&=-]/g;\n\n/**\n * Stricter set for the components of an object variant: also encodes `&` and\n * `=` so the `field=value&field=value` serialization stays unambiguous.\n */\nconst COMPONENT_UNSAFE_CHARS = /[^A-Za-z0-9._-]/g;\n\n/** Percent-encodes one UTF-16 code unit as a fixed-width `%XXXX` run. */\nconst percentEncodeChar = (char: string): string =>\n `%${char.charCodeAt(0).toString(16).toUpperCase().padStart(4, '0')}`;\n\nconst encodeSegmentText = (raw: string, unsafeChars: RegExp): string => {\n // Bare '%' cannot be produced by encoding (every encoded run is %XXXX),\n // so it is a safe stand-in for the empty string.\n if (raw === '') return '%';\n\n const encoded = raw.replace(unsafeChars, percentEncodeChar);\n\n // '.' and '..' are path navigation on every filesystem — encode the dots.\n if (encoded === '.' || encoded === '..') {\n return encoded.replace(/\\./g, '%002E');\n }\n\n return encoded;\n};\n\n/**\n * Canonical serialization of a single variant value into its identity string —\n * the variant segment of a composite id, the chunk directory name in dynamic\n * mode, and the runtime matching key.\n *\n * - `undefined` → `'default'` (the implicit fallback variant)\n * - a string → the string itself (a named variant)\n * - an object → its sorted `key=value` pairs joined by `&`\n * (e.g. `{ userId: '123', id: 'abc' }` → `'id=abc&userId=123'`)\n *\n * Characters that are unsafe in file paths or generated code are\n * percent-encoded (fixed-width `%XXXX` runs, injective). Common names —\n * letters, digits, `-` `_` `.` — are left untouched. Both the declaration and\n * the selector go through this function, so encoding never affects matching.\n *\n * Two variants resolve to the same entry iff their serializations are equal, so\n * an object variant in a selector must equal the one declared on the dictionary.\n */\nexport const serializeVariant = (\n variant: DictionaryVariantValue | undefined\n): string => {\n if (variant === undefined) return 'default';\n if (typeof variant === 'string') {\n return encodeSegmentText(variant, SEGMENT_UNSAFE_CHARS);\n }\n\n return Object.keys(variant)\n .sort()\n .map(\n (field) =>\n `${encodeSegmentText(field, COMPONENT_UNSAFE_CHARS)}=${encodeSegmentText(String(variant[field]), COMPONENT_UNSAFE_CHARS)}`\n )\n .join('&');\n};\n\n/**\n * Normalizes the `variant` field of a dictionary into the list of variant ids\n * the declaration registers under. A single value yields one id; an **array**\n * fans out into one id per element (duplicates collapsed). Returns `undefined`\n * when the dictionary does not declare the variant dimension (no `variant`\n * field, or an empty array).\n */\nexport const getVariantIds = (\n variant: Dictionary['variant']\n): string[] | undefined => {\n if (variant === undefined) return undefined;\n\n const values = Array.isArray(variant) ? variant : [variant];\n if (values.length === 0) return undefined;\n\n return [...new Set(values.map(serializeVariant))];\n};\n\n/**\n * Returns the qualifier dimensions declared on a dictionary, in canonical\n * order (`variant → item`). Empty when the dictionary is unqualified\n * (plain dictionary or shared base content of a qualified group).\n */\nexport const getDictionaryQualifierTypes = (\n dictionary: Dictionary\n): DictionaryQualifierType[] => {\n const declaredQualifiers: DictionaryQualifierType[] = [];\n\n if (getVariantIds(dictionary.variant) !== undefined) {\n declaredQualifiers.push('variant');\n }\n if (typeof dictionary.item === 'number') declaredQualifiers.push('item');\n\n return declaredQualifiers;\n};\n\n/**\n * Returns the qualifier identifiers of a dictionary for the given qualifier\n * dimension — the candidate segments of the composite entry ids.\n *\n * - 'variant' → the serialized variant id(s); an array variant yields one id\n * per element (declaration-side fan-out)\n * - 'item' → the item index as a single-element list\n */\nexport const getDictionaryQualifierIds = (\n dictionary: Dictionary,\n qualifierType: DictionaryQualifierType\n): string[] | undefined => {\n if (qualifierType === 'variant') {\n return getVariantIds(dictionary.variant);\n }\n return dictionary.item === undefined ? undefined : [String(dictionary.item)];\n};\n\n/**\n * Builds every composite entry id of a dictionary — the cartesian product of\n * its per-dimension id lists, joined in canonical order. A dictionary with a\n * plain (non-array) variant yields exactly one id; an array variant fans out\n * into one id per element. `undefined` when a dimension of the set is missing.\n */\nexport const getDictionaryCompositeIds = (\n dictionary: Dictionary,\n qualifierTypes: DictionaryQualifierType[]\n): string[] | undefined => {\n let compositeIds: string[] = [''];\n\n for (const qualifierType of qualifierTypes) {\n const ids = getDictionaryQualifierIds(dictionary, qualifierType);\n if (ids === undefined) return undefined;\n\n compositeIds = compositeIds.flatMap((prefix) =>\n ids.map((id) =>\n prefix === '' ? id : `${prefix}${COMPOSITE_ID_SEPARATOR}${id}`\n )\n );\n }\n\n return compositeIds;\n};\n\n/**\n * Tests whether a composite entry id matches a selector across every declared\n * dimension. Segments are compared in their encoded form (both the stored id\n * and the selector go through {@link serializeVariant}). The `item` dimension\n * matches any value when the selector does not provide one (open collection\n * axis).\n */\nconst compositeIdMatchesSelector = (\n compositeId: string,\n qualifierTypes: DictionaryQualifierType[],\n selector: DictionarySelector | undefined\n): boolean => {\n const segments = compositeId.split(COMPOSITE_ID_SEPARATOR);\n\n return qualifierTypes.every((qualifierType, index) => {\n if (qualifierType === 'variant') {\n return segments[index] === serializeVariant(selector?.variant);\n }\n\n // qualifierType === 'item'\n return (\n selector?.item === undefined || segments[index] === String(selector.item)\n );\n });\n};\n\n/**\n * Type guard discriminating a `QualifiedDictionaryGroup` (merge output of a\n * qualified key) from a plain `Dictionary`. Both carry a `content` field; only\n * the group declares `qualifierTypes`, which is therefore the discriminator.\n */\nexport const isQualifiedDictionaryGroup = (\n value: unknown\n): value is QualifiedDictionaryGroup =>\n typeof value === 'object' &&\n value !== null &&\n 'qualifierTypes' in value &&\n Array.isArray((value as { qualifierTypes: unknown }).qualifierTypes) &&\n 'content' in value;\n\n/**\n * Reconstructs a resolvable {@link Dictionary} from a single entry of a\n * qualified group: the content node stored under its composite id, plus the\n * qualifier coordinates decoded from that id (`variant`, `item`).\n *\n * This keeps the resolver's transform code unchanged: it still sees a\n * `{ key, content, variant?, item? }` shape, even though the stored format no\n * longer duplicates those fields per entry. The `variant` coordinate stays in\n * its serialized (encoded) form, e.g. `'id=abc&userId=123'` — matching happens\n * on the composite id segments, never on this reconstructed field.\n */\nexport const reconstructQualifiedEntry = (\n group: QualifiedDictionaryGroup,\n compositeId: string\n): Dictionary => {\n const segments = compositeId.split(COMPOSITE_ID_SEPARATOR);\n\n const entry = {\n key: group.key,\n content: group.content[compositeId],\n } as Dictionary;\n\n group.qualifierTypes.forEach((qualifierType, index) => {\n if (qualifierType === 'variant') {\n entry.variant = segments[index];\n } else if (qualifierType === 'item') {\n entry.item = Number(segments[index]);\n }\n });\n\n return entry;\n};\n\n/**\n * Resolves a dictionary (or qualified dictionary group) against a selector,\n * across every declared dimension.\n *\n * - Plain dictionary → returned as-is (selector ignored)\n * - `item` declared but not selected → every matching entry ordered by index\n * - `item` selected → the matching entry or null\n * - `variant` defaults to the `default` entry when not selected; an object\n * variant resolves only when the selector provides an equal object\n *\n * Dimensions compose: e.g. a variant × item key with `{ variant: 'promo' }`\n * returns every promo item as an array; adding `{ item: 2 }` narrows to one.\n */\nexport const resolveQualifiedDictionary = (\n dictionaryOrGroup: Dictionary | QualifiedDictionaryGroup,\n selector?: DictionarySelector\n): Dictionary | Dictionary[] | null => {\n if (!isQualifiedDictionaryGroup(dictionaryOrGroup)) {\n return dictionaryOrGroup;\n }\n\n const { qualifierTypes, content } = dictionaryOrGroup;\n\n const itemAxisOpen =\n qualifierTypes.includes('item') && selector?.item === undefined;\n\n const matchedEntries = Object.keys(content)\n .filter((compositeId) =>\n compositeIdMatchesSelector(compositeId, qualifierTypes, selector)\n )\n .map((compositeId) =>\n reconstructQualifiedEntry(dictionaryOrGroup, compositeId)\n );\n\n if (itemAxisOpen) {\n return matchedEntries.sort(\n (left, right) => (left.item ?? 0) - (right.item ?? 0)\n );\n }\n\n return matchedEntries[0] ?? null;\n};\n\n/**\n * Splits the second argument of `getIntlayer` / `getDictionary` into the\n * effective locale and the selector object (if any).\n */\nexport const parseDictionarySelector = <L extends LocalesValues>(\n localeOrSelector?: L | DictionarySelector\n): { locale?: L; selector?: DictionarySelector } => {\n if (typeof localeOrSelector === 'object' && localeOrSelector !== null) {\n return {\n locale: localeOrSelector.locale as L | undefined,\n selector: localeOrSelector,\n };\n }\n\n return { locale: localeOrSelector };\n};\n\n/**\n * Builds a stable string identity of a selector (excluding `locale`), suitable\n * for cache keys and memoization dependencies.\n */\nexport const getDictionarySelectorCacheKey = (\n selector?: DictionarySelector\n): string => {\n if (!selector) return '';\n\n return Object.keys(selector)\n .filter((selectorKey) => selectorKey !== 'locale')\n .sort()\n .map((selectorKey) => {\n const value = selector[selectorKey as keyof DictionarySelector];\n const serialized =\n selectorKey === 'variant'\n ? serializeVariant(value as Parameters<typeof serializeVariant>[0])\n : String(value);\n return `${selectorKey}:${serialized}`;\n })\n .join('|');\n};\n\n/**\n * Marker property carrying the ordered qualifier dimensions on a dynamic loader\n * map. Its presence distinguishes a qualified group loader map (a nested tree\n * of chunks) from a plain dynamic loader map (one chunk per `locale`). Prefixed\n * and unlikely to collide with a real locale code.\n */\nexport const QUALIFIER_DYNAMIC_TYPES_KEY = '__intlayerQualifierTypes';\n\n/**\n * A lazily-imported per-locale dictionary chunk loader.\n */\nexport type DynamicDictionaryLoader = () => Promise<Dictionary>;\n\n/**\n * Nested tree of chunk loaders: one nesting level per declared dimension (in\n * canonical order), leaves are loaders.\n */\nexport type QualifiedDynamicLoaderTree = {\n [segment: string]: QualifiedDynamicLoaderTree | DynamicDictionaryLoader;\n};\n\n/**\n * Default export shape of a generated dynamic entry point for a qualified key.\n * One nesting level per dimension under each locale, plus the dimension marker.\n *\n * ```ts\n * {\n * __intlayerQualifierTypes: ['variant', 'item'],\n * en: { promo: { '1': () => import('./json/x/promo/1/en.json'), … }, … },\n * fr: { … },\n * }\n * ```\n */\nexport type QualifiedDynamicLoaderMap = {\n [QUALIFIER_DYNAMIC_TYPES_KEY]: DictionaryQualifierType[];\n [locale: string]: QualifiedDynamicLoaderTree | DictionaryQualifierType[];\n};\n\n/**\n * Type guard discriminating a qualified dynamic loader map (collections /\n * variants, possibly combined) from a plain dynamic loader map.\n */\nexport const isQualifiedDynamicLoaderMap = (\n value: unknown\n): value is QualifiedDynamicLoaderMap =>\n typeof value === 'object' &&\n value !== null &&\n QUALIFIER_DYNAMIC_TYPES_KEY in value;\n\n/**\n/** One targeted chunk: its stable cache key and lazy loader. */\ntype CollectedChunk = {\n cacheKey: string;\n loader: DynamicDictionaryLoader;\n};\n\ntype CollectedChunks = {\n /** True when the `item` axis is open (collection result → array). */\n itemAxisOpen: boolean;\n /** True when a required coordinate is absent (result → [] or null). */\n missed: boolean;\n /** The chunks the selector targets (in collection order for the item axis). */\n chunks: CollectedChunk[];\n};\n\n/**\n * Walks the loader tree following the selector and collects the chunk loaders\n * it targets — shared by the sync ({@link resolveQualifiedDynamicContent}) and\n * async ({@link resolveQualifiedDynamicContentAsync}) resolvers.\n */\nconst collectQualifiedChunks = (\n loaderMap: QualifiedDynamicLoaderMap,\n key: string,\n locale: string,\n selector: DictionarySelector | undefined\n): CollectedChunks => {\n const qualifierTypes = loaderMap[QUALIFIER_DYNAMIC_TYPES_KEY];\n const localeTree = loaderMap[locale] as\n | QualifiedDynamicLoaderTree\n | undefined;\n\n const itemAxisOpen =\n qualifierTypes.includes('item') && selector?.item === undefined;\n\n if (!localeTree) return { itemAxisOpen, missed: true, chunks: [] };\n\n const chunks: CollectedChunk[] = [];\n\n const walk = (\n node: QualifiedDynamicLoaderTree | DynamicDictionaryLoader,\n dimensions: DictionaryQualifierType[],\n segments: string[]\n ): boolean => {\n if (dimensions.length === 0) {\n chunks.push({\n cacheKey: `${key}.${locale}.${segments.join(COMPOSITE_ID_SEPARATOR)}`,\n loader: node as DynamicDictionaryLoader,\n });\n return true;\n }\n\n const [dimension, ...rest] = dimensions;\n const tree = node as QualifiedDynamicLoaderTree;\n\n if (dimension === 'item' && selector?.item === undefined) {\n // Open collection axis: fan out into every sibling chunk, ordered.\n for (const segment of Object.keys(tree).sort(\n (left, right) => Number(left) - Number(right)\n )) {\n walk(tree[segment]!, rest, [...segments, segment]);\n }\n return true;\n }\n\n const segment =\n dimension === 'variant'\n ? serializeVariant(selector?.variant)\n : String(selector?.item);\n\n const child = tree[segment];\n if (!child) return false;\n\n return walk(child, rest, [...segments, segment]);\n };\n\n const found = walk(localeTree, qualifierTypes, []);\n\n return { itemAxisOpen, missed: !found, chunks };\n};\n\n/**\n * Resolves the content of a qualified dynamic loader map against a selector,\n * loading only the chunk(s) the selector actually targets.\n *\n * Walks the nested loader tree one dimension at a time (canonical order\n * `variant → item`): `variant` defaults to `default` (or descends by the\n * serialized object identity), and `item` either narrows to the selected index\n * or — when no item is given — expands into every sibling chunk (the collection\n * axis). Semantics mirror {@link resolveQualifiedDictionary} so dynamic and\n * static modes behave alike.\n *\n * The Suspense mechanism is injected through `loadChunk` so the same logic\n * serves both the client (suspender cache) and the server (`react.use`). Every\n * targeted loader is started before the first chunk is read, so sibling chunks\n * load in parallel rather than waterfalling.\n *\n * @param loaderMap - The qualified dynamic loader map (entry point default export).\n * @param key - The dictionary key (used to build stable chunk cache keys).\n * @param locale - The resolved locale to load chunks for.\n * @param selector - The selector splitting the qualifier dimensions.\n * @param loadChunk - Reads a started chunk promise, suspending until it resolves.\n * @param transform - Turns a resolved chunk dictionary into final content.\n */\nexport const resolveQualifiedDynamicContent = <Content>(params: {\n loaderMap: QualifiedDynamicLoaderMap;\n key: string;\n locale: string;\n selector: DictionarySelector | undefined;\n loadChunk: (cacheKey: string, promise: Promise<Dictionary>) => Dictionary;\n transform: (dictionary: Dictionary) => Content;\n}): Content | Content[] | null => {\n const { loaderMap, key, locale, selector, loadChunk, transform } = params;\n\n const { itemAxisOpen, missed, chunks } = collectQualifiedChunks(\n loaderMap,\n key,\n locale,\n selector\n );\n\n if (missed) return itemAxisOpen ? [] : null;\n\n // Start every loader before reading, so siblings load in parallel.\n const dictionaries = chunks.map(({ cacheKey, loader }) =>\n loadChunk(cacheKey, loader())\n );\n\n if (itemAxisOpen) return dictionaries.map(transform);\n\n const [dictionary] = dictionaries;\n return dictionary ? transform(dictionary) : null;\n};\n\n/**\n * Async counterpart of {@link resolveQualifiedDynamicContent} for frameworks\n * that load dictionaries with `await` instead of Suspense (Vue, Svelte, Lit,\n * vanilla). Awaits every targeted chunk in parallel, then resolves identically.\n *\n * @param loaderMap - The qualified dynamic loader map.\n * @param key - The dictionary key (used to build stable chunk cache keys).\n * @param locale - The resolved locale to load chunks for.\n * @param selector - The selector splitting the qualifier dimensions.\n * @param transform - Turns a resolved chunk dictionary into final content.\n */\nexport const resolveQualifiedDynamicContentAsync = async <Content>(params: {\n loaderMap: QualifiedDynamicLoaderMap;\n key: string;\n locale: string;\n selector: DictionarySelector | undefined;\n transform: (dictionary: Dictionary) => Content;\n}): Promise<Content | Content[] | null> => {\n const { loaderMap, key, locale, selector, transform } = params;\n\n const { itemAxisOpen, missed, chunks } = collectQualifiedChunks(\n loaderMap,\n key,\n locale,\n selector\n );\n\n if (missed) return itemAxisOpen ? [] : null;\n\n const dictionaries = await Promise.all(chunks.map(({ loader }) => loader()));\n\n if (itemAxisOpen) return dictionaries.map(transform);\n\n const [dictionary] = dictionaries;\n return dictionary ? transform(dictionary) : null;\n};\n"],"mappings":";;;;;;AAcA,MAAa,kBAAkB,CAC7B,WACA,OACD;;;;;AAMD,MAAa,yBAAyB;;;;;;;AAQtC,MAAM,uBAAuB;;;;;AAM7B,MAAM,yBAAyB;;AAG/B,MAAM,qBAAqB,SACzB,IAAI,KAAK,WAAW,EAAE,CAAC,SAAS,GAAG,CAAC,aAAa,CAAC,SAAS,GAAG,IAAI;AAEpE,MAAM,qBAAqB,KAAa,gBAAgC;AAGtE,KAAI,QAAQ,GAAI,QAAO;CAEvB,MAAM,UAAU,IAAI,QAAQ,aAAa,kBAAkB;AAG3D,KAAI,YAAY,OAAO,YAAY,KACjC,QAAO,QAAQ,QAAQ,OAAO,QAAQ;AAGxC,QAAO;;;;;;;;;;;;;;;;;;;;AAqBT,MAAa,oBACX,YACW;AACX,KAAI,YAAY,OAAW,QA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AAE;EAAQ;;;;;;;;;;;;;;;;;;;;;;;;;AA0BjD,MAAa,kCAA2C,WAOtB;CAChC,MAAM,EAAE,WAAW,KAAK,QAAQ,UAAU,WAAW,cAAc;CAEnE,MAAM,EAAE,cAAc,QAAQ,WAAW,uBACvC,WACA,KACA,QACA,SACD;AAED,KAAI,OAAQ,QAAO,eAAe,EAAE,GAAG;CAGvC,MAAM,eAAe,OAAO,KAAK,EAAE,UAAU,aAC3C,UAAU,UAAU,QAAQ,CAAC,CAC9B;AAED,KAAI,aAAc,QAAO,aAAa,IAAI,UAAU;CAEpD,MAAM,CAAC,cAAc;AACrB,QAAO,aAAa,UAAU,WAAW,GAAG;;;;;;;;;;;;;AAc9C,MAAa,sCAAsC,OAAgB,WAMxB;CACzC,MAAM,EAAE,WAAW,KAAK,QAAQ,UAAU,cAAc;CAExD,MAAM,EAAE,cAAc,QAAQ,WAAW,uBACvC,WACA,KACA,QACA,SACD;AAED,KAAI,OAAQ,QAAO,eAAe,EAAE,GAAG;CAEvC,MAAM,eAAe,MAAM,QAAQ,IAAI,OAAO,KAAK,EAAE,aAAa,QAAQ,CAAC,CAAC;AAE5E,KAAI,aAAc,QAAO,aAAa,IAAI,UAAU;CAEpD,MAAM,CAAC,cAAc;AACrB,QAAO,aAAa,UAAU,WAAW,GAAG"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { getEditedContent, getEditedDictionary } from "./deepTransformPlugins/ge
|
|
|
2
2
|
import { getCondition } from "./interpreter/getCondition.mjs";
|
|
3
3
|
import { deepTransformNode } from "./interpreter/getContent/deepTransform.mjs";
|
|
4
4
|
import { findMatchingCondition, getEnumeration } from "./interpreter/getEnumeration.mjs";
|
|
5
|
-
import { COMPOSITE_ID_SEPARATOR, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER,
|
|
5
|
+
import { COMPOSITE_ID_SEPARATOR, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getVariantIds, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, parseDictionarySelector, reconstructQualifiedEntry, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, serializeVariant } from "./dictionaryManipulator/qualifiedDictionary.mjs";
|
|
6
6
|
import { getDictionary } from "./interpreter/getDictionary.mjs";
|
|
7
7
|
import { getIntlayer } from "./interpreter/getIntlayer.mjs";
|
|
8
8
|
import { getNesting } from "./interpreter/getNesting.mjs";
|
|
@@ -87,10 +87,11 @@ import { createRenderer, renderFor } from "./markdown/renderer.mjs";
|
|
|
87
87
|
import { compile, compileWithOptions, createCompiler, parseMarkdown, renderMarkdownAst } from "./markdown/compiler.mjs";
|
|
88
88
|
import { icuToIntlayerFormatter, intlayerToICUFormatter } from "./messageFormat/ICU.mjs";
|
|
89
89
|
import { i18nextToIntlayerFormatter, intlayerToI18nextFormatter } from "./messageFormat/i18next.mjs";
|
|
90
|
+
import { navigatePath } from "./messageFormat/navigatePath.mjs";
|
|
90
91
|
import { intlayerToPortableObjectFormatter, portableObjectToIntlayerFormatter } from "./messageFormat/po.mjs";
|
|
91
92
|
import { intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter } from "./messageFormat/vue-i18n.mjs";
|
|
92
93
|
import { interpolateMessage, parseTaggedMessage, resolveMessage, resolveMessageNode } from "./messageFormat/resolveMessage.mjs";
|
|
93
94
|
import { isSameKeyPath } from "./utils/isSameKeyPath.mjs";
|
|
94
95
|
import { stringifyYaml } from "./utils/stringifyYaml.mjs";
|
|
95
96
|
|
|
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, 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, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, GFM_TASK_R, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, 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, INLINE_SKIP_R, INTERPOLATION_R, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, LocaleStorage, LocaleStorageClient, LocaleStorageServer, NAMED_CODES_TO_UNICODE, NP_TABLE_R, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, PARAGRAPH_R, Priority, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, RuleType, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, 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, UNESCAPE_R, UNORDERED, UNORDERED_LIST_BULLET, UNORDERED_LIST_ITEM_PREFIX, UNORDERED_LIST_ITEM_PREFIX_R, UNORDERED_LIST_ITEM_R, UNORDERED_LIST_R, VOID_HTML_ELEMENTS, 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, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, generateSitemap, generateSitemapUrl, get, getBasePlugins, getBrowserLocale, getCachedIntl, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary,
|
|
97
|
+
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, 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, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, GFM_TASK_R, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, 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, INLINE_SKIP_R, INTERPOLATION_R, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, LocaleStorage, LocaleStorageClient, LocaleStorageServer, NAMED_CODES_TO_UNICODE, NP_TABLE_R, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, PARAGRAPH_R, Priority, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, RuleType, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, 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, UNESCAPE_R, UNORDERED, UNORDERED_LIST_BULLET, UNORDERED_LIST_ITEM_PREFIX, UNORDERED_LIST_ITEM_PREFIX_R, UNORDERED_LIST_ITEM_R, UNORDERED_LIST_R, VOID_HTML_ELEMENTS, 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, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, generateSitemap, generateSitemapUrl, get, getBasePlugins, getBrowserLocale, getCachedIntl, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary, getDictionaryCompositeIds, getDictionaryQualifierIds, 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, getVariantIds, 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, 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, reconstructQualifiedEntry, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderMarkdownAst, renderNothing, resolveMessage, resolveMessageNode, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, sanitizer, serializeVariant, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, stringifyYaml, translation as t, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { icuToIntlayerFormatter, intlayerToICUFormatter } from "./ICU.mjs";
|
|
2
2
|
import { i18nextToIntlayerFormatter, intlayerToI18nextFormatter } from "./i18next.mjs";
|
|
3
|
+
import { navigatePath } from "./navigatePath.mjs";
|
|
3
4
|
import { intlayerToPortableObjectFormatter, portableObjectToIntlayerFormatter } from "./po.mjs";
|
|
4
5
|
import { intlayerToVueI18nFormatter, vueI18nToIntlayerFormatter } from "./vue-i18n.mjs";
|
|
5
6
|
import { interpolateMessage, parseTaggedMessage, resolveMessage, resolveMessageNode } from "./resolveMessage.mjs";
|
|
6
7
|
|
|
7
|
-
export { i18nextToIntlayerFormatter, icuToIntlayerFormatter, interpolateMessage, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, intlayerToVueI18nFormatter, parseTaggedMessage, portableObjectToIntlayerFormatter, resolveMessage, resolveMessageNode, vueI18nToIntlayerFormatter };
|
|
8
|
+
export { i18nextToIntlayerFormatter, icuToIntlayerFormatter, interpolateMessage, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, intlayerToVueI18nFormatter, navigatePath, parseTaggedMessage, portableObjectToIntlayerFormatter, resolveMessage, resolveMessageNode, vueI18nToIntlayerFormatter };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/messageFormat/navigatePath.ts
|
|
2
|
+
/**
|
|
3
|
+
* Reads a dotted `path` (e.g. `counter.label`) out of a nested content value.
|
|
4
|
+
*
|
|
5
|
+
* The full path is first tried as a *flat* property, supporting catalogs that
|
|
6
|
+
* use dotted keys as literal field names (i18next flat JSON files, lingui
|
|
7
|
+
* catalogs: `{ "section.title": "value" }`). When that misses, the path is
|
|
8
|
+
* split on `keySeparator` and walked segment by segment.
|
|
9
|
+
*
|
|
10
|
+
* Shared by every compat adapter's translation lookup — do not re-implement
|
|
11
|
+
* it locally.
|
|
12
|
+
*
|
|
13
|
+
* @param contentValue - The object (dictionary content) to read from.
|
|
14
|
+
* @param path - Separator-delimited path. An empty path returns `contentValue`.
|
|
15
|
+
* @param keySeparator - Segment separator; `false` disables nested traversal
|
|
16
|
+
* (flat lookup only), mirroring i18next's `keySeparator: false`.
|
|
17
|
+
* @returns The value found at `path`, or `undefined` when any segment is absent.
|
|
18
|
+
*/
|
|
19
|
+
const navigatePath = (contentValue, path, keySeparator = ".") => {
|
|
20
|
+
if (!path) return contentValue;
|
|
21
|
+
if (contentValue !== null && contentValue !== void 0 && typeof contentValue === "object") {
|
|
22
|
+
const flatValue = contentValue[path];
|
|
23
|
+
if (flatValue !== void 0) return flatValue;
|
|
24
|
+
}
|
|
25
|
+
if (keySeparator === false || !path.includes(keySeparator)) return;
|
|
26
|
+
let current = contentValue;
|
|
27
|
+
for (const part of path.split(keySeparator)) {
|
|
28
|
+
if (current === null || current === void 0 || typeof current !== "object") return;
|
|
29
|
+
current = current[part];
|
|
30
|
+
}
|
|
31
|
+
return current;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { navigatePath };
|
|
36
|
+
//# sourceMappingURL=navigatePath.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigatePath.mjs","names":[],"sources":["../../../src/messageFormat/navigatePath.ts"],"sourcesContent":["/**\n * Reads a dotted `path` (e.g. `counter.label`) out of a nested content value.\n *\n * The full path is first tried as a *flat* property, supporting catalogs that\n * use dotted keys as literal field names (i18next flat JSON files, lingui\n * catalogs: `{ \"section.title\": \"value\" }`). When that misses, the path is\n * split on `keySeparator` and walked segment by segment.\n *\n * Shared by every compat adapter's translation lookup — do not re-implement\n * it locally.\n *\n * @param contentValue - The object (dictionary content) to read from.\n * @param path - Separator-delimited path. An empty path returns `contentValue`.\n * @param keySeparator - Segment separator; `false` disables nested traversal\n * (flat lookup only), mirroring i18next's `keySeparator: false`.\n * @returns The value found at `path`, or `undefined` when any segment is absent.\n */\nexport const navigatePath = (\n contentValue: unknown,\n path: string,\n keySeparator: string | false = '.'\n): unknown => {\n if (!path) return contentValue;\n\n if (\n contentValue !== null &&\n contentValue !== undefined &&\n typeof contentValue === 'object'\n ) {\n const flatValue = (contentValue as Record<string, unknown>)[path];\n if (flatValue !== undefined) return flatValue;\n }\n\n if (keySeparator === false || !path.includes(keySeparator)) {\n return undefined;\n }\n\n let current: unknown = contentValue;\n for (const part of path.split(keySeparator)) {\n if (\n current === null ||\n current === undefined ||\n typeof current !== 'object'\n ) {\n return undefined;\n }\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAa,gBACX,cACA,MACA,eAA+B,QACnB;AACZ,KAAI,CAAC,KAAM,QAAO;AAElB,KACE,iBAAiB,QACjB,iBAAiB,UACjB,OAAO,iBAAiB,UACxB;EACA,MAAM,YAAa,aAAyC;AAC5D,MAAI,cAAc,OAAW,QAAO;;AAGtC,KAAI,iBAAiB,SAAS,CAAC,KAAK,SAAS,aAAa,CACxD;CAGF,IAAI,UAAmB;AACvB,MAAK,MAAM,QAAQ,KAAK,MAAM,aAAa,EAAE;AAC3C,MACE,YAAY,QACZ,YAAY,UACZ,OAAO,YAAY,SAEnB;AAEF,YAAW,QAAoC;;AAEjD,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -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
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { DeclaredLocales } from "@intlayer/types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Locale } from "@intlayer/types/allLocales";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Locale } from "@intlayer/types/allLocales";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Locale } from "@intlayer/types/allLocales";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { GetLocaleLang, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues, LocalizedUrl, ResolvedDefaultLocale } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { DeclaredLocales, LocalesValues, PathWithoutLocale } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Locale } from "@intlayer/types/allLocales";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -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
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { KeyPath } from "@intlayer/types/keyPath";
|