@intlayer/core 9.1.3 → 9.3.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.
Files changed (69) hide show
  1. package/dist/cjs/deepTransformPlugins/getEditedContent.cjs +10 -6
  2. package/dist/cjs/deepTransformPlugins/getEditedContent.cjs.map +1 -1
  3. package/dist/cjs/dictionaryManipulator/getNestedDictionaryReferences.cjs +153 -0
  4. package/dist/cjs/dictionaryManipulator/getNestedDictionaryReferences.cjs.map +1 -0
  5. package/dist/cjs/dictionaryManipulator/index.cjs +16 -9
  6. package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs +4 -3
  7. package/dist/cjs/dictionaryManipulator/mergeQualifiedDictionaries.cjs.map +1 -1
  8. package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs +1 -170
  9. package/dist/cjs/dictionaryManipulator/qualifiedDictionary.cjs.map +1 -1
  10. package/dist/cjs/dictionaryManipulator/qualifiedDictionaryDeclaration.cjs +69 -0
  11. package/dist/cjs/dictionaryManipulator/qualifiedDictionaryDeclaration.cjs.map +1 -0
  12. package/dist/cjs/dictionaryManipulator/qualifiedDynamicLoader.cjs +115 -0
  13. package/dist/cjs/dictionaryManipulator/qualifiedDynamicLoader.cjs.map +1 -0
  14. package/dist/cjs/index.cjs +20 -9
  15. package/dist/cjs/interpreter/getContent/plugins.cjs +12 -1
  16. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  17. package/dist/cjs/interpreter/getDictionary.cjs +2 -1
  18. package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
  19. package/dist/cjs/interpreter/getNesting.optimized.cjs +59 -0
  20. package/dist/cjs/interpreter/getNesting.optimized.cjs.map +1 -0
  21. package/dist/cjs/localization/index.cjs +4 -0
  22. package/dist/cjs/localization/proxyMode.cjs +92 -0
  23. package/dist/cjs/localization/proxyMode.cjs.map +1 -0
  24. package/dist/esm/deepTransformPlugins/getEditedContent.mjs +10 -6
  25. package/dist/esm/deepTransformPlugins/getEditedContent.mjs.map +1 -1
  26. package/dist/esm/dictionaryManipulator/getNestedDictionaryReferences.mjs +150 -0
  27. package/dist/esm/dictionaryManipulator/getNestedDictionaryReferences.mjs.map +1 -0
  28. package/dist/esm/dictionaryManipulator/index.mjs +5 -2
  29. package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs +2 -1
  30. package/dist/esm/dictionaryManipulator/mergeQualifiedDictionaries.mjs.map +1 -1
  31. package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs +1 -162
  32. package/dist/esm/dictionaryManipulator/qualifiedDictionary.mjs.map +1 -1
  33. package/dist/esm/dictionaryManipulator/qualifiedDictionaryDeclaration.mjs +64 -0
  34. package/dist/esm/dictionaryManipulator/qualifiedDictionaryDeclaration.mjs.map +1 -0
  35. package/dist/esm/dictionaryManipulator/qualifiedDynamicLoader.mjs +111 -0
  36. package/dist/esm/dictionaryManipulator/qualifiedDynamicLoader.mjs.map +1 -0
  37. package/dist/esm/index.mjs +6 -2
  38. package/dist/esm/interpreter/getContent/plugins.mjs +12 -1
  39. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  40. package/dist/esm/interpreter/getDictionary.mjs +2 -1
  41. package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
  42. package/dist/esm/interpreter/getNesting.optimized.mjs +58 -0
  43. package/dist/esm/interpreter/getNesting.optimized.mjs.map +1 -0
  44. package/dist/esm/localization/index.mjs +2 -1
  45. package/dist/esm/localization/proxyMode.mjs +87 -0
  46. package/dist/esm/localization/proxyMode.mjs.map +1 -0
  47. package/dist/types/deepTransformPlugins/getEditedContent.d.ts.map +1 -1
  48. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +1 -0
  49. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +1 -0
  50. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +1 -0
  51. package/dist/types/dictionaryManipulator/getNestedDictionaryReferences.d.ts +62 -0
  52. package/dist/types/dictionaryManipulator/getNestedDictionaryReferences.d.ts.map +1 -0
  53. package/dist/types/dictionaryManipulator/index.d.ts +5 -2
  54. package/dist/types/dictionaryManipulator/mergeQualifiedDictionaries.d.ts.map +1 -1
  55. package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts +18 -126
  56. package/dist/types/dictionaryManipulator/qualifiedDictionary.d.ts.map +1 -1
  57. package/dist/types/dictionaryManipulator/qualifiedDictionaryDeclaration.d.ts +41 -0
  58. package/dist/types/dictionaryManipulator/qualifiedDictionaryDeclaration.d.ts.map +1 -0
  59. package/dist/types/dictionaryManipulator/qualifiedDynamicLoader.d.ts +93 -0
  60. package/dist/types/dictionaryManipulator/qualifiedDynamicLoader.d.ts.map +1 -0
  61. package/dist/types/index.d.ts +6 -2
  62. package/dist/types/interpreter/getContent/plugins.d.ts +10 -0
  63. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
  64. package/dist/types/interpreter/getNesting.optimized.d.ts +33 -0
  65. package/dist/types/interpreter/getNesting.optimized.d.ts.map +1 -0
  66. package/dist/types/localization/index.d.ts +2 -1
  67. package/dist/types/localization/proxyMode.d.ts +92 -0
  68. package/dist/types/localization/proxyMode.d.ts.map +1 -0
  69. package/package.json +7 -7
@@ -1,12 +1,6 @@
1
- import { Dictionary, DictionaryQualifierType, DictionarySelector, DictionaryVariantChain, DictionaryVariantValue, ProviderVariant, QualifiedDictionaryGroup } from "@intlayer/types/dictionary";
1
+ import { Dictionary, DictionarySelector, DictionaryVariantChain, DictionaryVariantValue, ProviderVariant, QualifiedDictionaryGroup } from "@intlayer/types/dictionary";
2
2
  import { LocalesValues } from "@intlayer/types/module_augmentation";
3
3
  //#region src/dictionaryManipulator/qualifiedDictionary.d.ts
4
- /**
5
- * Canonical order of qualifier dimensions. A key that declares both dimensions
6
- * always nests them in this order, with `item` innermost so it can act as the
7
- * collection (array) axis.
8
- */
9
- declare const QUALIFIER_ORDER: readonly ["variant", "item"];
10
4
  /**
11
5
  * Separator joining per-dimension ids into a composite entry id. Also used as
12
6
  * the chunk path separator in dynamic mode.
@@ -37,36 +31,6 @@ declare const DEFAULT_VARIANT_ID = "default";
37
31
  * an object variant in a selector must equal the one declared on the dictionary.
38
32
  */
39
33
  declare const serializeVariant: (variant: DictionaryVariantValue | undefined) => string;
40
- /**
41
- * Normalizes the `variant` field of a dictionary into the list of variant ids
42
- * the declaration registers under. A single value yields one id; an **array**
43
- * fans out into one id per element (duplicates collapsed). Returns `undefined`
44
- * when the dictionary does not declare the variant dimension (no `variant`
45
- * field, or an empty array).
46
- */
47
- declare const getVariantIds: (variant: Dictionary['variant']) => string[] | undefined;
48
- /**
49
- * Returns the qualifier dimensions declared on a dictionary, in canonical
50
- * order (`variant → item`). Empty when the dictionary is unqualified
51
- * (plain dictionary or shared base content of a qualified group).
52
- */
53
- declare const getDictionaryQualifierTypes: (dictionary: Dictionary) => DictionaryQualifierType[];
54
- /**
55
- * Returns the qualifier identifiers of a dictionary for the given qualifier
56
- * dimension — the candidate segments of the composite entry ids.
57
- *
58
- * - 'variant' → the serialized variant id(s); an array variant yields one id
59
- * per element (declaration-side fan-out)
60
- * - 'item' → the item index as a single-element list
61
- */
62
- declare const getDictionaryQualifierIds: (dictionary: Dictionary, qualifierType: DictionaryQualifierType) => string[] | undefined;
63
- /**
64
- * Builds every composite entry id of a dictionary — the cartesian product of
65
- * its per-dimension id lists, joined in canonical order. A dictionary with a
66
- * plain (non-array) variant yields exactly one id; an array variant fans out
67
- * into one id per element. `undefined` when a dimension of the set is missing.
68
- */
69
- declare const getDictionaryCompositeIds: (dictionary: Dictionary, qualifierTypes: DictionaryQualifierType[]) => string[] | undefined;
70
34
  /**
71
35
  * Serializes the variant coordinate of a selector into the ordered list of
72
36
  * candidate ids to try, so a single value and a preference chain share one code
@@ -80,6 +44,22 @@ declare const getDictionaryCompositeIds: (dictionary: Dictionary, qualifierTypes
80
44
  * as an unsatisfiable request.
81
45
  */
82
46
  declare const serializeVariantChain: (variant: DictionaryVariantChain | undefined) => string[];
47
+ /**
48
+ * Resolves the variant id a selector actually targets among the ids a key
49
+ * declares — the sparse-override fallback.
50
+ *
51
+ * Candidates are tried in order and the first one the key declares wins.
52
+ * Otherwise the key falls back to its `default` entry, so a variant only has to
53
+ * be declared where its wording differs. When the key declares no `default`
54
+ * either, the first candidate is returned unchanged and the caller resolves to
55
+ * `null` / `[]`.
56
+ *
57
+ * @param requestedVariantIds - The serialized ids the selector asks for, in
58
+ * preference order (a single value is a 1-element
59
+ * list).
60
+ * @param isVariantIdDeclared - Whether the key declares an entry for an id.
61
+ */
62
+ declare const resolveEffectiveVariantId: (requestedVariantIds: string[], isVariantIdDeclared: (variantId: string) => boolean) => string;
83
63
  /**
84
64
  * Type guard discriminating a `QualifiedDictionaryGroup` (merge output of a
85
65
  * qualified key) from a plain `Dictionary`. Both carry a `content` field; only
@@ -163,94 +143,6 @@ declare const resolveDictionaryArgument: (params: {
163
143
  * for cache keys and memoization dependencies.
164
144
  */
165
145
  declare const getDictionarySelectorCacheKey: (selector?: DictionarySelector) => string;
166
- /**
167
- * Marker property carrying the ordered qualifier dimensions on a dynamic loader
168
- * map. Its presence distinguishes a qualified group loader map (a nested tree
169
- * of chunks) from a plain dynamic loader map (one chunk per `locale`). Prefixed
170
- * and unlikely to collide with a real locale code.
171
- */
172
- declare const QUALIFIER_DYNAMIC_TYPES_KEY = "__intlayerQualifierTypes";
173
- /**
174
- * A lazily-imported per-locale dictionary chunk loader.
175
- */
176
- type DynamicDictionaryLoader = () => Promise<Dictionary>;
177
- /**
178
- * Nested tree of chunk loaders: one nesting level per declared dimension (in
179
- * canonical order), leaves are loaders.
180
- */
181
- type QualifiedDynamicLoaderTree = {
182
- [segment: string]: QualifiedDynamicLoaderTree | DynamicDictionaryLoader;
183
- };
184
- /**
185
- * Default export shape of a generated dynamic entry point for a qualified key.
186
- * One nesting level per dimension under each locale, plus the dimension marker.
187
- *
188
- * ```ts
189
- * {
190
- * __intlayerQualifierTypes: ['variant', 'item'],
191
- * en: { promo: { '1': () => import('./json/x/promo/1/en.json'), … }, … },
192
- * fr: { … },
193
- * }
194
- * ```
195
- */
196
- type QualifiedDynamicLoaderMap = {
197
- [QUALIFIER_DYNAMIC_TYPES_KEY]: DictionaryQualifierType[];
198
- [locale: string]: QualifiedDynamicLoaderTree | DictionaryQualifierType[];
199
- };
200
- /**
201
- * Type guard discriminating a qualified dynamic loader map (collections /
202
- * variants, possibly combined) from a plain dynamic loader map.
203
- */
204
- declare const isQualifiedDynamicLoaderMap: (value: unknown) => value is QualifiedDynamicLoaderMap;
205
- /**
206
- * Resolves the content of a qualified dynamic loader map against a selector,
207
- * loading only the chunk(s) the selector actually targets.
208
- *
209
- * Walks the nested loader tree one dimension at a time (canonical order
210
- * `variant → item`): `variant` descends by the serialized id, falling back to
211
- * `default` when the selected variant has no chunk of its own, and `item`
212
- * either narrows to the selected index or — when no item is given — expands
213
- * into every sibling chunk (the collection axis). Semantics mirror
214
- * {@link resolveQualifiedDictionary} so dynamic and static modes behave alike.
215
- *
216
- * The Suspense mechanism is injected through `loadChunk` so the same logic
217
- * serves both the client (suspender cache) and the server (`react.use`). Every
218
- * targeted loader is started before the first chunk is read, so sibling chunks
219
- * load in parallel rather than waterfalling.
220
- *
221
- * @param loaderMap - The qualified dynamic loader map (entry point default export).
222
- * @param key - The dictionary key (used to build stable chunk cache keys).
223
- * @param locale - The resolved locale to load chunks for.
224
- * @param selector - The selector splitting the qualifier dimensions.
225
- * @param loadChunk - Reads a started chunk promise, suspending until it resolves.
226
- * @param transform - Turns a resolved chunk dictionary into final content.
227
- */
228
- declare const resolveQualifiedDynamicContent: <Content>(params: {
229
- loaderMap: QualifiedDynamicLoaderMap;
230
- key: string;
231
- locale: string;
232
- selector: DictionarySelector | undefined;
233
- loadChunk: (cacheKey: string, promise: Promise<Dictionary>) => Dictionary;
234
- transform: (dictionary: Dictionary) => Content;
235
- }) => Content | Content[] | null;
236
- /**
237
- * Async counterpart of {@link resolveQualifiedDynamicContent} for frameworks
238
- * that load dictionaries with `await` instead of Suspense (Vue, Svelte, Lit,
239
- * vanilla). Awaits every targeted chunk in parallel, then resolves identically.
240
- *
241
- * @param loaderMap - The qualified dynamic loader map.
242
- * @param key - The dictionary key (used to build stable chunk cache keys).
243
- * @param locale - The resolved locale to load chunks for.
244
- * @param selector - The selector splitting the qualifier dimensions.
245
- * @param transform - Turns a resolved chunk dictionary into final content.
246
- */
247
- declare const resolveQualifiedDynamicContentAsync: <Content>(params: {
248
- loaderMap: QualifiedDynamicLoaderMap;
249
- key: string;
250
- locale: string;
251
- selector: DictionarySelector | undefined;
252
- transform: (dictionary: Dictionary) => Content;
253
- }) => Promise<Content | Content[] | null>;
254
146
  //#endregion
255
- export { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID, DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getVariantIds, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, parseDictionarySelector, reconstructQualifiedEntry, resolveDictionaryArgument, resolveProviderVariant, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, serializeVariant, serializeVariantChain };
147
+ export { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, parseDictionarySelector, reconstructQualifiedEntry, resolveDictionaryArgument, resolveEffectiveVariantId, resolveProviderVariant, resolveQualifiedDictionary, serializeVariant, serializeVariantChain };
256
148
  //# sourceMappingURL=qualifiedDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"qualifiedDictionary.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/qualifiedDictionary.ts"],"mappings":";;;;;;;;cAiBa;;;;;cASA;;;;;;cAOA;;;;;;;;;;;;;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;;;;;;;;;;;;cA4BE,wBAAqB,SACvB;;;;;;;;;;;;;;;;cA0BE,4BAAyB,+BACP,sBACP;;;;;;cA4CX,6BAA0B,mBAEpC,SAAS;;;;;;;;;;;;cAkBC,4BAAyB,OAC7B,0BAAwB,wBAE9B;;;;;;;;;;;;;;;;cAkCU,6BAA0B,mBAClB,aAAa,0BAAwB,WAC7C,uBACV,aAAa;;;;;cAoDH,0BAA2B,UAAU,eAAa,mBAC1C,IAAI;EACpB,SAAS;EAAG,WAAW;;;;;;;;;;;;;;;;;cA0Bf,yBAAsB,iBAChB,6BAA2B,0BAE3C;;;;;;;;;;;;;;;cA0BU,4BAAyB;EACpC,mBAAmB,gBAAgB;EACnC,gBAAgB;EAChB,iBAAiB;EACjB;MACE,gBAAgB;;;;;cAqCP,gCAA6B,WAC7B"}
@@ -0,0 +1,41 @@
1
+ import { Dictionary, DictionaryQualifierType } from "@intlayer/types/dictionary";
2
+ //#region src/dictionaryManipulator/qualifiedDictionaryDeclaration.d.ts
3
+ /**
4
+ * Canonical order of qualifier dimensions. A key that declares both dimensions
5
+ * always nests them in this order, with `item` innermost so it can act as the
6
+ * collection (array) axis.
7
+ */
8
+ declare const QUALIFIER_ORDER: readonly ["variant", "item"];
9
+ /**
10
+ * Normalizes the `variant` field of a dictionary into the list of variant ids
11
+ * the declaration registers under. A single value yields one id; an **array**
12
+ * fans out into one id per element (duplicates collapsed). Returns `undefined`
13
+ * when the dictionary does not declare the variant dimension (no `variant`
14
+ * field, or an empty array).
15
+ */
16
+ declare const getVariantIds: (variant: Dictionary['variant']) => string[] | undefined;
17
+ /**
18
+ * Returns the qualifier dimensions declared on a dictionary, in canonical
19
+ * order (`variant → item`). Empty when the dictionary is unqualified
20
+ * (plain dictionary or shared base content of a qualified group).
21
+ */
22
+ declare const getDictionaryQualifierTypes: (dictionary: Dictionary) => DictionaryQualifierType[];
23
+ /**
24
+ * Returns the qualifier identifiers of a dictionary for the given qualifier
25
+ * dimension — the candidate segments of the composite entry ids.
26
+ *
27
+ * - 'variant' → the serialized variant id(s); an array variant yields one id
28
+ * per element (declaration-side fan-out)
29
+ * - 'item' → the item index as a single-element list
30
+ */
31
+ declare const getDictionaryQualifierIds: (dictionary: Dictionary, qualifierType: DictionaryQualifierType) => string[] | undefined;
32
+ /**
33
+ * Builds every composite entry id of a dictionary — the cartesian product of
34
+ * its per-dimension id lists, joined in canonical order. A dictionary with a
35
+ * plain (non-array) variant yields exactly one id; an array variant fans out
36
+ * into one id per element. `undefined` when a dimension of the set is missing.
37
+ */
38
+ declare const getDictionaryCompositeIds: (dictionary: Dictionary, qualifierTypes: DictionaryQualifierType[]) => string[] | undefined;
39
+ //#endregion
40
+ export { QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getVariantIds };
41
+ //# sourceMappingURL=qualifiedDictionaryDeclaration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifiedDictionaryDeclaration.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/qualifiedDictionaryDeclaration.ts"],"mappings":";;;;;;;cAca;;;;;;;;cAYA,gBAAa,SACf;;;;;;cAeE,8BAA2B,YAC1B,eACX;;;;;;;;;cAmBU,4BAAyB,YACxB,YAAU,eACP;;;;;;;cAcJ,4BAAyB,YACxB,YAAU,gBACN"}
@@ -0,0 +1,93 @@
1
+ import { Dictionary, DictionaryQualifierType, DictionarySelector } from "@intlayer/types/dictionary";
2
+ //#region src/dictionaryManipulator/qualifiedDynamicLoader.d.ts
3
+ /**
4
+ * Marker property carrying the ordered qualifier dimensions on a dynamic loader
5
+ * map. Its presence distinguishes a qualified group loader map (a nested tree
6
+ * of chunks) from a plain dynamic loader map (one chunk per `locale`). Prefixed
7
+ * and unlikely to collide with a real locale code.
8
+ */
9
+ declare const QUALIFIER_DYNAMIC_TYPES_KEY = "__intlayerQualifierTypes";
10
+ /**
11
+ * A lazily-imported per-locale dictionary chunk loader.
12
+ */
13
+ type DynamicDictionaryLoader = () => Promise<Dictionary>;
14
+ /**
15
+ * Nested tree of chunk loaders: one nesting level per declared dimension (in
16
+ * canonical order), leaves are loaders.
17
+ */
18
+ type QualifiedDynamicLoaderTree = {
19
+ [segment: string]: QualifiedDynamicLoaderTree | DynamicDictionaryLoader;
20
+ };
21
+ /**
22
+ * Default export shape of a generated dynamic entry point for a qualified key.
23
+ * One nesting level per dimension under each locale, plus the dimension marker.
24
+ *
25
+ * ```ts
26
+ * {
27
+ * __intlayerQualifierTypes: ['variant', 'item'],
28
+ * en: { promo: { '1': () => import('./json/x/promo/1/en.json'), … }, … },
29
+ * fr: { … },
30
+ * }
31
+ * ```
32
+ */
33
+ type QualifiedDynamicLoaderMap = {
34
+ [QUALIFIER_DYNAMIC_TYPES_KEY]: DictionaryQualifierType[];
35
+ [locale: string]: QualifiedDynamicLoaderTree | DictionaryQualifierType[];
36
+ };
37
+ /**
38
+ * Type guard discriminating a qualified dynamic loader map (collections /
39
+ * variants, possibly combined) from a plain dynamic loader map.
40
+ */
41
+ declare const isQualifiedDynamicLoaderMap: (value: unknown) => value is QualifiedDynamicLoaderMap;
42
+ /**
43
+ * Resolves the content of a qualified dynamic loader map against a selector,
44
+ * loading only the chunk(s) the selector actually targets.
45
+ *
46
+ * Walks the nested loader tree one dimension at a time (canonical order
47
+ * `variant → item`): `variant` descends by the serialized id, falling back to
48
+ * `default` when the selected variant has no chunk of its own, and `item`
49
+ * either narrows to the selected index or — when no item is given — expands
50
+ * into every sibling chunk (the collection axis). Semantics mirror
51
+ * `resolveQualifiedDictionary` so dynamic and static modes behave alike.
52
+ *
53
+ * The Suspense mechanism is injected through `loadChunk` so the same logic
54
+ * serves both the client (suspender cache) and the server (`react.use`). Every
55
+ * targeted loader is started before the first chunk is read, so sibling chunks
56
+ * load in parallel rather than waterfalling.
57
+ *
58
+ * @param loaderMap - The qualified dynamic loader map (entry point default export).
59
+ * @param key - The dictionary key (used to build stable chunk cache keys).
60
+ * @param locale - The resolved locale to load chunks for.
61
+ * @param selector - The selector splitting the qualifier dimensions.
62
+ * @param loadChunk - Reads a started chunk promise, suspending until it resolves.
63
+ * @param transform - Turns a resolved chunk dictionary into final content.
64
+ */
65
+ declare const resolveQualifiedDynamicContent: <Content>(params: {
66
+ loaderMap: QualifiedDynamicLoaderMap;
67
+ key: string;
68
+ locale: string;
69
+ selector: DictionarySelector | undefined;
70
+ loadChunk: (cacheKey: string, promise: Promise<Dictionary>) => Dictionary;
71
+ transform: (dictionary: Dictionary) => Content;
72
+ }) => Content | Content[] | null;
73
+ /**
74
+ * Async counterpart of {@link resolveQualifiedDynamicContent} for frameworks
75
+ * that load dictionaries with `await` instead of Suspense (Vue, Svelte, Lit,
76
+ * vanilla). Awaits every targeted chunk in parallel, then resolves identically.
77
+ *
78
+ * @param loaderMap - The qualified dynamic loader map.
79
+ * @param key - The dictionary key (used to build stable chunk cache keys).
80
+ * @param locale - The resolved locale to load chunks for.
81
+ * @param selector - The selector splitting the qualifier dimensions.
82
+ * @param transform - Turns a resolved chunk dictionary into final content.
83
+ */
84
+ declare const resolveQualifiedDynamicContentAsync: <Content>(params: {
85
+ loaderMap: QualifiedDynamicLoaderMap;
86
+ key: string;
87
+ locale: string;
88
+ selector: DictionarySelector | undefined;
89
+ transform: (dictionary: Dictionary) => Content;
90
+ }) => Promise<Content | Content[] | null>;
91
+ //#endregion
92
+ export { DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, isQualifiedDynamicLoaderMap, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync };
93
+ //# sourceMappingURL=qualifiedDynamicLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifiedDynamicLoader.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/qualifiedDynamicLoader.ts"],"mappings":";;;;;;;;cAiBa;;;;KAKD,gCAAgC,QAAQ;;;;;KAMxC;GACT,kBAAkB,6BAA6B;;;;;;;;;;;;;;KAetC;GACT,8BAA8B;GAC9B,iBAAiB,6BAA6B;;;;;;cAOpC,8BAA2B,mBAErC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;cAiHC,iCAAkC,SAAO;EACpD,WAAW;EACX;EACA;EACA,UAAU;EACV,YAAY,kBAAkB,SAAS,QAAQ,gBAAgB;EAC/D,YAAY,YAAY,eAAe;MACrC,UAAU;;;;;;;;;;;;cAkCD,sCAA6C,SAAO;EAC/D,WAAW;EACX;EACA;EACA,UAAU;EACV,YAAY,YAAY,eAAe;MACrC,QAAQ,UAAU"}
@@ -48,13 +48,16 @@ import { editDictionaryByKeyPath } from "./dictionaryManipulator/editDictionaryB
48
48
  import { getContentNodeByKeyPath } from "./dictionaryManipulator/getContentNodeByKeyPath.js";
49
49
  import { getDefaultNode } from "./dictionaryManipulator/getDefaultNode.js";
50
50
  import { getEmptyNode } from "./dictionaryManipulator/getEmptyNode.js";
51
+ import { NestedFieldReferences, getNestedDictionaryGraph, getNestedDictionaryKeys, getNestedDictionaryReferences } from "./dictionaryManipulator/getNestedDictionaryReferences.js";
51
52
  import { getNodeChildren } from "./dictionaryManipulator/getNodeChildren.js";
52
53
  import { getNodeType } from "./dictionaryManipulator/getNodeType.js";
53
54
  import { mergeDictionaries } from "./dictionaryManipulator/mergeDictionaries.js";
54
55
  import { mergeQualifiedDictionaries } from "./dictionaryManipulator/mergeQualifiedDictionaries.js";
55
56
  import { normalizeDictionaries, normalizeDictionary } from "./dictionaryManipulator/normalizeDictionary.js";
56
57
  import { orderDictionaries } from "./dictionaryManipulator/orderDictionaries.js";
57
- import { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID, DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getVariantIds, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, parseDictionarySelector, reconstructQualifiedEntry, resolveDictionaryArgument, resolveProviderVariant, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, serializeVariant, serializeVariantChain } from "./dictionaryManipulator/qualifiedDictionary.js";
58
+ import { COMPOSITE_ID_SEPARATOR, DEFAULT_VARIANT_ID, getDictionarySelectorCacheKey, isQualifiedDictionaryGroup, parseDictionarySelector, reconstructQualifiedEntry, resolveDictionaryArgument, resolveEffectiveVariantId, resolveProviderVariant, resolveQualifiedDictionary, serializeVariant, serializeVariantChain } from "./dictionaryManipulator/qualifiedDictionary.js";
59
+ import { QUALIFIER_ORDER, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getVariantIds } from "./dictionaryManipulator/qualifiedDictionaryDeclaration.js";
60
+ import { DynamicDictionaryLoader, QUALIFIER_DYNAMIC_TYPES_KEY, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, isQualifiedDynamicLoaderMap, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync } from "./dictionaryManipulator/qualifiedDynamicLoader.js";
58
61
  import { removeContentNodeByKeyPath } from "./dictionaryManipulator/removeContentNodeByKeyPath.js";
59
62
  import { renameContentNodeByKeyPath } from "./dictionaryManipulator/renameContentNodeByKeyPath.js";
60
63
  import { updateNodeChildren } from "./dictionaryManipulator/updateNodeChildren.js";
@@ -85,6 +88,7 @@ import { getPathWithoutLocale } from "./localization/getPathWithoutLocale.js";
85
88
  import { localeDetector } from "./localization/localeDetector.js";
86
89
  import { localeFlatMap, localeMap, localeRecord } from "./localization/localeMapper.js";
87
90
  import { localeResolver } from "./localization/localeResolver.js";
91
+ import { ProxyMode, formatProxyEnabledMessage, isProxyStorageLocaleEnabled, resolveProxyMode } from "./localization/proxyMode.js";
88
92
  import { LocalizedPathResult, getCanonicalPath, getInternalPath, getLocalizedPath, getRewritePath, getRewriteRules } from "./localization/rewriteUtils.js";
89
93
  import { validatePrefix } from "./localization/validatePrefix.js";
90
94
  import "./localization/index.js";
@@ -110,4 +114,4 @@ import { CookieBuildAttributes, LocaleStorage, LocaleStorageClient, LocaleStorag
110
114
  import { YamlRecord, YamlValue, parseYaml } from "./utils/parseYaml.js";
111
115
  import { stringifyYaml } from "./utils/stringifyYaml.js";
112
116
  import "./utils/index.js";
113
- export { ATTRIBUTES_TO_SANITIZE, ATTRIBUTE_TO_NODE_PROP_MAP, ATTR_EXTRACTOR_R, BLOCKQUOTE_ALERT_R, BLOCKQUOTE_R, BLOCKQUOTE_TRIM_LEFT_MULTILINE_R, BLOCK_END_R, BREAK_LINE_R, BREAK_THEMATIC_R, type BlockQuoteNode, type BoldTextNode, type BreakLineNode, type BreakThematicNode, CAPTURE_LETTER_AFTER_HYPHEN, CODE_BLOCK_FENCED_R, CODE_BLOCK_R, CODE_INLINE_R, COMPOSITE_ID_SEPARATOR, CONSECUTIVE_NEWLINE_R, CR_NEWLINE_R, CUSTOM_COMPONENT_R, CachedIntl, CachedIntl as Intl, type CodeBlockNode, type CodeFencedNode, type CodeInlineNode, type CompileOptions, type ComponentOverrides, ConditionCond, ConditionContent, ConditionContentStates, CookieBuildAttributes, type CustomComponentNode, DEFAULT_VARIANT_ID, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, DateTimePreset, DeepTransformContent, DotPath, DynamicDictionaryLoader, type ElementType, EnterFormat, EnumerationCond, EnumerationContent, EnumerationContentState, type EscapedTextNode, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, FileCond, type FileContent, type FileContentConstructor, type FootnoteNode, type FootnoteReferenceNode, type GFMTaskNode, GFM_TASK_R, Gender, GenderCond, GenderContent, GenderContentStates, type GenerateSitemapOptions, GetNestingResult, type GetPrefixOptions, type GetPrefixResult, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, type HTMLCommentNode, HTMLContent, HTMLContentConstructor, type HTMLNode, type HTMLSelfClosingNode, type HTMLTag, HTMLTagsType, HTMLValidationIssue, HTMLValidationResult, HTML_BLOCK_ELEMENT_R, HTML_CHAR_CODE_R, HTML_COMMENT_R, HTML_CUSTOM_ATTR_R, HTML_LEFT_TRIM_AMOUNT_R, HTML_SELF_CLOSING_ELEMENT_R, HTML_TAGS, type HeadingNode, type HeadingSetextNode, IInterpreterPlugin, IInterpreterPluginState, INLINE_SKIP_R, INTERPOLATION_R, type ImageNode, InsertionCond, InsertionContent, InsertionContentConstructor, InterpolableNode, IntlConstructorName, IsAny, type ItalicTextNode, JsonValue, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, type LinkAngleBraceNode, type LinkBareURLNode, type LinkNode, ListType, type LocaleDomainMap, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, type LocalizedPathResult, MarkdownContent, MarkdownContentConstructor, type MarkdownContext, type MarkdownOptions, type MarkdownRuntime, type HTMLValidationIssue as MarkdownValidationIssue, MarkdownValidationResult, type MarkedTextNode, MessageFormatDialect, MessageValues, NAMED_CODES_TO_UNICODE, NP_TABLE_R, NestedCond, NestedContent, NestedContentState, type NestedParser, type NewlineNode, NodeProps, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, type OrderedListNode, PARAGRAPH_R, type ParagraphNode, type ParseState, ParsedMarkdown, type Parser, type ParserResult, Plugins, PluralCategory, PluralCond, PluralContent, PluralContentState, PortableObject, Priority, PriorityValue, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, type ReferenceImageNode, type ReferenceLinkNode, type ReferenceNode, type RenderRuleHook, type Rule, type RuleOutput, RuleType, RuleTypeValue, type Rules, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, SelectCond, SelectContent, SelectContentStates, SelectSelector, type SitemapUrlEntry, type StrikethroughTextNode, TABLE_CENTER_ALIGN, TABLE_LEFT_ALIGN, TABLE_RIGHT_ALIGN, TABLE_TRIM_PIPES, TAB_R, TEXT_BOLD_R, TEXT_EMPHASIZED_R, TEXT_ESCAPED_R, TEXT_MARKED_R, TEXT_PLAIN_R, TEXT_STRIKETHROUGHED_R, TRIM_STARTING_NEWLINES, type TableNode, type TableSeparatorNode, TaggedMessageToken, type TextNode, TranslationCond, TranslationContent, UNESCAPE_R, UNORDERED, UNORDERED_LIST_BULLET, UNORDERED_LIST_ITEM_PREFIX, UNORDERED_LIST_ITEM_PREFIX_R, UNORDERED_LIST_ITEM_R, UNORDERED_LIST_R, UnionKeys, type UnorderedListNode, VOID_HTML_ELEMENTS, ValidDotPathsFor, ValueAtKey, WrappedIntl, YamlRecord, YamlValue, allowInline, anyScopeRegex, attributeValueToNodePropValue, bindIntl, blockRegex, buildMaskPlugin, captureNothing, checkIsURLAbsolute, checkMissingLocalesPlugin, compact, comparePaths, compile, compileWithOptions, condition as cond, conditionPlugin, createCompiler, createRenderer, currency, cx, date, deepTransformNode, editDictionaryByKeyPath, enumeration as enu, enumerationPlugin, fallbackPlugin, type file, type fileContent, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, generateSitemap, generateSitemapUrl, get, getBasePlugins, getBrowserLocale, getCachedIntl, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getDomainHostname, getDomainOrigin, getEditedContent, getEditedDictionary, getEmptyNode, getEnumeration, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getGender, getHTML, getHTMLTextDir, getInsertion, getInsertionValues, getInternalPath, getInterpolableContent, getIntlayer, getLocale, getLocaleFromDomain, getLocaleFromPath, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, getLocaleLang, getLocaleName, getLocalizedContent, getLocalizedPath, getLocalizedUrl, getMarkdownMetadata, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getMultilingualUrls, getNesting, getNodeChildren, getNodeType, getPathWithoutLocale, getPerLocaleDictionary, getPlural, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSelect, getSplittedContent, getSplittedDictionaryContent, getTranslation, getVariantIds, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, interpolateMessage, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, intlayerToVueI18nFormatter, isInterpolableWrapperNode, isLocaleExclusiveOnDomain, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, mergeQualifiedDictionaries, navigatePath, nesting as nest, nestedPlugin, normalizeAttributeKey, normalizeDictionaries, normalizeDictionary, normalizePath, normalizeWhitespace, number, orderDictionaries, parseBlock, parseCaptureInline, parseDictionarySelector, parseInline, parseMarkdown, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseTaggedMessage, parseYaml, parserFor, percentage, plural, pluralPlugin, portableObjectToIntlayerFormatter, presets, qualifies, rebuildInterpolableContent, reconstructQualifiedEntry, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderMarkdownAst, renderNothing, resolveDictionaryArgument, resolveMessage, resolveMessageNode, resolveProviderVariant, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, sanitizer, select, selectPlugin, serializeVariant, serializeVariantChain, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, stringifyYaml, translation as t, transformInterpolableNode, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
117
+ export { ATTRIBUTES_TO_SANITIZE, ATTRIBUTE_TO_NODE_PROP_MAP, ATTR_EXTRACTOR_R, BLOCKQUOTE_ALERT_R, BLOCKQUOTE_R, BLOCKQUOTE_TRIM_LEFT_MULTILINE_R, BLOCK_END_R, BREAK_LINE_R, BREAK_THEMATIC_R, type BlockQuoteNode, type BoldTextNode, type BreakLineNode, type BreakThematicNode, CAPTURE_LETTER_AFTER_HYPHEN, CODE_BLOCK_FENCED_R, CODE_BLOCK_R, CODE_INLINE_R, COMPOSITE_ID_SEPARATOR, CONSECUTIVE_NEWLINE_R, CR_NEWLINE_R, CUSTOM_COMPONENT_R, CachedIntl, CachedIntl as Intl, type CodeBlockNode, type CodeFencedNode, type CodeInlineNode, type CompileOptions, type ComponentOverrides, ConditionCond, ConditionContent, ConditionContentStates, CookieBuildAttributes, type CustomComponentNode, DEFAULT_VARIANT_ID, DO_NOT_PROCESS_HTML_ELEMENTS, DURATION_DELAY_TRIGGER, DateTimePreset, DeepTransformContent, DotPath, DynamicDictionaryLoader, type ElementType, EnterFormat, EnumerationCond, EnumerationContent, EnumerationContentState, type EscapedTextNode, FOOTNOTE_R, FOOTNOTE_REFERENCE_R, FORMFEED_R, FRONT_MATTER_R, FileCond, type FileContent, type FileContentConstructor, type FootnoteNode, type FootnoteReferenceNode, type GFMTaskNode, GFM_TASK_R, Gender, GenderCond, GenderContent, GenderContentStates, type GenerateSitemapOptions, GetNestingResult, type GetPrefixOptions, type GetPrefixResult, HEADING_ATX_COMPLIANT_R, HEADING_R, HEADING_SETEXT_R, type HTMLCommentNode, HTMLContent, HTMLContentConstructor, type HTMLNode, type HTMLSelfClosingNode, type HTMLTag, HTMLTagsType, HTMLValidationIssue, HTMLValidationResult, HTML_BLOCK_ELEMENT_R, HTML_CHAR_CODE_R, HTML_COMMENT_R, HTML_CUSTOM_ATTR_R, HTML_LEFT_TRIM_AMOUNT_R, HTML_SELF_CLOSING_ELEMENT_R, HTML_TAGS, type HeadingNode, type HeadingSetextNode, IInterpreterPlugin, IInterpreterPluginState, INLINE_SKIP_R, INTERPOLATION_R, type ImageNode, InsertionCond, InsertionContent, InsertionContentConstructor, InterpolableNode, IntlConstructorName, IsAny, type ItalicTextNode, JsonValue, LINK_AUTOLINK_BARE_URL_R, LINK_AUTOLINK_R, LIST_LOOKBEHIND_R, LOOKAHEAD, type LinkAngleBraceNode, type LinkBareURLNode, type LinkNode, ListType, type LocaleDomainMap, LocaleStorage, LocaleStorageClient, LocaleStorageClientOptions, LocaleStorageOptions, LocaleStorageServer, LocaleStorageServerOptions, type LocalizedPathResult, MarkdownContent, MarkdownContentConstructor, type MarkdownContext, type MarkdownOptions, type MarkdownRuntime, type HTMLValidationIssue as MarkdownValidationIssue, MarkdownValidationResult, type MarkedTextNode, MessageFormatDialect, MessageValues, NAMED_CODES_TO_UNICODE, NP_TABLE_R, NestedCond, NestedContent, NestedContentState, NestedFieldReferences, type NestedParser, type NewlineNode, NodeProps, ORDERED, ORDERED_LIST_BULLET, ORDERED_LIST_ITEM_PREFIX, ORDERED_LIST_ITEM_PREFIX_R, ORDERED_LIST_ITEM_R, ORDERED_LIST_R, type OrderedListNode, PARAGRAPH_R, type ParagraphNode, type ParseState, ParsedMarkdown, type Parser, type ParserResult, Plugins, PluralCategory, PluralCond, PluralContent, PluralContentState, PortableObject, Priority, PriorityValue, type ProxyMode, QUALIFIER_DYNAMIC_TYPES_KEY, QUALIFIER_ORDER, QualifiedDynamicLoaderMap, QualifiedDynamicLoaderTree, REFERENCE_IMAGE_OR_LINK, REFERENCE_IMAGE_R, REFERENCE_LINK_R, type ReferenceImageNode, type ReferenceLinkNode, type ReferenceNode, type RenderRuleHook, type Rule, type RuleOutput, RuleType, RuleTypeValue, type Rules, SHORTCODE_R, SHOULD_RENDER_AS_BLOCK_R, SelectCond, SelectContent, SelectContentStates, SelectSelector, type SitemapUrlEntry, type StrikethroughTextNode, TABLE_CENTER_ALIGN, TABLE_LEFT_ALIGN, TABLE_RIGHT_ALIGN, TABLE_TRIM_PIPES, TAB_R, TEXT_BOLD_R, TEXT_EMPHASIZED_R, TEXT_ESCAPED_R, TEXT_MARKED_R, TEXT_PLAIN_R, TEXT_STRIKETHROUGHED_R, TRIM_STARTING_NEWLINES, type TableNode, type TableSeparatorNode, TaggedMessageToken, type TextNode, TranslationCond, TranslationContent, UNESCAPE_R, UNORDERED, UNORDERED_LIST_BULLET, UNORDERED_LIST_ITEM_PREFIX, UNORDERED_LIST_ITEM_PREFIX_R, UNORDERED_LIST_ITEM_R, UNORDERED_LIST_R, UnionKeys, type UnorderedListNode, VOID_HTML_ELEMENTS, ValidDotPathsFor, ValueAtKey, WrappedIntl, YamlRecord, YamlValue, allowInline, anyScopeRegex, attributeValueToNodePropValue, bindIntl, blockRegex, buildMaskPlugin, captureNothing, checkIsURLAbsolute, checkMissingLocalesPlugin, compact, comparePaths, compile, compileWithOptions, condition as cond, conditionPlugin, createCompiler, createRenderer, currency, cx, date, deepTransformNode, editDictionaryByKeyPath, enumeration as enu, enumerationPlugin, fallbackPlugin, type file, type fileContent, filePlugin, filterMissingTranslationsOnlyPlugin, filterTranslationsOnlyPlugin, findMatchingCondition, formatProxyEnabledMessage, gender, genderPlugin, generateListItemPrefix, generateListItemPrefixRegex, generateListItemRegex, generateListRegex, generateSitemap, generateSitemapUrl, get, getBasePlugins, getBrowserLocale, getCachedIntl, getCanonicalPath, getCondition, getContent, getContentNodeByKeyPath, getCookie, getDefaultNode, getDictionary, getDictionaryCompositeIds, getDictionaryQualifierIds, getDictionaryQualifierTypes, getDictionarySelectorCacheKey, getDomainHostname, getDomainOrigin, getEditedContent, getEditedDictionary, getEmptyNode, getEnumeration, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary, getFilteredLocalesContent, getFilteredLocalesDictionary, getGender, getHTML, getHTMLTextDir, getInsertion, getInsertionValues, getInternalPath, getInterpolableContent, getIntlayer, getLocale, getLocaleFromDomain, getLocaleFromPath, getLocaleFromStorage, getLocaleFromStorageClient, getLocaleFromStorageServer, getLocaleLang, getLocaleName, getLocalizedContent, getLocalizedPath, getLocalizedUrl, getMarkdownMetadata, getMaskContent, getMissingLocalesContent, getMissingLocalesContentFromDictionary, getMultilingualDictionary, getMultilingualUrls, getNestedDictionaryGraph, getNestedDictionaryKeys, getNestedDictionaryReferences, getNesting, getNodeChildren, getNodeType, getPathWithoutLocale, getPerLocaleDictionary, getPlural, getPrefix, getReplacedValuesContent, getRewritePath, getRewriteRules, getSelect, getSplittedContent, getSplittedDictionaryContent, getTranslation, getVariantIds, html, i18nextToIntlayerFormatter, icuToIntlayerFormatter, inlineRegex, insertion as insert, insertContentInDictionary, insertionPlugin, interpolateMessage, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, intlayerToVueI18nFormatter, isInterpolableWrapperNode, isLocaleExclusiveOnDomain, isProxyStorageLocaleEnabled, isQualifiedDictionaryGroup, isQualifiedDynamicLoaderMap, isSameKeyPath, isValidElement, list, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, localeStorageOptions, markdown as md, mergeDictionaries, mergeQualifiedDictionaries, navigatePath, nesting as nest, nestedPlugin, normalizeAttributeKey, normalizeDictionaries, normalizeDictionary, normalizePath, normalizeWhitespace, number, orderDictionaries, parseBlock, parseCaptureInline, parseDictionarySelector, parseInline, parseMarkdown, parseSimpleInline, parseStyleAttribute, parseTableAlign, parseTableAlignCapture, parseTableCells, parseTableRow, parseTaggedMessage, parseYaml, parserFor, percentage, plural, pluralPlugin, portableObjectToIntlayerFormatter, presets, qualifies, rebuildInterpolableContent, reconstructQualifiedEntry, relativeTime, removeContentNodeByKeyPath, renameContentNodeByKeyPath, renderFor, renderMarkdownAst, renderNothing, resolveDictionaryArgument, resolveEffectiveVariantId, resolveMessage, resolveMessageNode, resolveProviderVariant, resolveProxyMode, resolveQualifiedDictionary, resolveQualifiedDynamicContent, resolveQualifiedDynamicContentAsync, sanitizer, select, selectPlugin, serializeVariant, serializeVariantChain, setLocaleInStorage, setLocaleInStorageClient, setLocaleInStorageServer, simpleInlineRegex, slugify, some, splitInsertionTemplate, startsWith, stringifyYaml, translation as t, transformInterpolableNode, translationPlugin, trimEnd, trimLeadingWhitespaceOutsideFences, unescapeString, units, unquote, updateNodeChildren, validateHTML, validateMarkdown, validatePrefix, vueI18nToIntlayerFormatter };
@@ -149,6 +149,16 @@ interface NodeProps {
149
149
  locale?: Locale;
150
150
  dictionaryPath?: string;
151
151
  children?: any;
152
+ /**
153
+ * Dictionaries referenced through `nest()`, attached to the consuming
154
+ * dictionary by the build optimization and threaded down by
155
+ * `deepTransformNode`.
156
+ *
157
+ * Present only in optimized builds, where the global dictionary registry is
158
+ * stripped and `getNesting` resolves from this map instead. See
159
+ * `getNesting.optimized.ts`.
160
+ */
161
+ nestedDictionaries?: Record<string, unknown>;
152
162
  /**
153
163
  * Forces eager traversal of plain objects in `deepTransformNode`. By default
154
164
  * traversal is lazy (property getters), so callers that discard the returned
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"mappings":";;;;;;;;;;;;;;;;;;;KAkDY;EACV;EACA,YAAY;EACZ,YACE,WACA,OAAO,WACP,cAAc,WAAW,OAAO;;;;;;;cAUvB,gBAAgB;;;;KAUjB,UAAU,KAAK,0BAA0B;KACzC,WAAW,GAAG,KAAK,oBAC3B,gBAAgB,IACd,EAAE;KAII,gBAAgB,GAAG,GAAG,U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GACA,UAAU,gBAAgB,mBACxB,gBAAgB,IAEhB,EAAE,kBAEA,mBAAmB,GAAG,GAAG,GAAG,2BAG1B,mBAAmB,GAAG,GAAG,GAAG;;;;KAO/B,SAAS,GAAG,GAAG,UAAU,gBAAgB,mBAC5C,UAAU,oBAAoB,KAC1B,MAAM,qBAAqB,GAAG,GAAG,MACjC,sBACK,WAAW,IAAI,qBAAqB,EAAE,IAAI,GAAG,QAChD;KAEI,MAAM,mBAAmB;;;;KAKzB,qBACV,GACA,IAAI,yBACJ,UAAU,gBAAgB,mBAE1B,MAAM,kBACF,IACA,iBAAiB,SAAS,mBAAmB,GAAG,GAAG,IAAI,GAAG,mBAExD,SAAS,GAAG,GAAG,KAEf,iBAAiB,SAAS,mBAAmB,GAAG,GAAG,IAAI,GAAG"}
@@ -0,0 +1,33 @@
1
+ import { ValidDotPathsFor } from "../transpiler/nesting/nesting.js";
2
+ import "../transpiler/index.js";
3
+ import { GetNestingResult } from "./getNesting.js";
4
+ import { NodeProps } from "./getContent/plugins.js";
5
+ import "./getContent/index.js";
6
+ import { DictionaryKeys } from "@intlayer/types/module_augmentation";
7
+ //#region src/interpreter/getNesting.optimized.d.ts
8
+ /**
9
+ * Optimized-build replacement for `getNesting`.
10
+ *
11
+ * Resolves a `nest()` reference from the dictionaries the compiler attached to
12
+ * the consuming dictionary (`props.nestedDictionaries`) instead of looking the
13
+ * key up in the global registry exposed by `@intlayer/dictionaries-entry`.
14
+ *
15
+ * That is what lets the build optimization erase the registry entirely: this
16
+ * module never imports `getIntlayer`, so no dictionary reaches the bundle
17
+ * except through the static import injected at the call site. The nest target
18
+ * then lands in the same chunk as the dictionary referencing it — and, in
19
+ * `dynamic` / `fetch` mode, is loaded by the same lazy per-locale loader.
20
+ *
21
+ * The compiler guarantees the attachment for every dictionary holding a nested
22
+ * node, so a missing entry means the dictionary was not produced by the
23
+ * optimized pipeline; the reference then resolves to `undefined`.
24
+ *
25
+ * @param dictionaryKey - The key of the dictionary to nest.
26
+ * @param path - Optional dot-separated path within the nested dictionary.
27
+ * @param props - Interpreter node props, carrying the attached dictionaries.
28
+ * @returns The nested content.
29
+ */
30
+ declare const getNesting: <const K extends DictionaryKeys, const P>(dictionaryKey: K, path?: P extends ValidDotPathsFor<K> ? P : never, props?: NodeProps) => GetNestingResult<K, P>;
31
+ //#endregion
32
+ export { getNesting };
33
+ //# sourceMappingURL=getNesting.optimized.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNesting.optimized.d.ts","names":[],"sources":["../../../src/interpreter/getNesting.optimized.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa,mBAAoB,UAAU,sBAAsB,GAAC,eACjD,GAAC,OACT,UAAU,iBAAiB,KAAK,WAAS,QACxC,cACP,iBAAiB,GAAG"}
@@ -14,6 +14,7 @@ import { getPathWithoutLocale } from "./getPathWithoutLocale.js";
14
14
  import { localeDetector } from "./localeDetector.js";
15
15
  import { localeFlatMap, localeMap, localeRecord } from "./localeMapper.js";
16
16
  import { localeResolver } from "./localeResolver.js";
17
+ import { ProxyMode, formatProxyEnabledMessage, isProxyStorageLocaleEnabled, resolveProxyMode } from "./proxyMode.js";
17
18
  import { LocalizedPathResult, getCanonicalPath, getInternalPath, getLocalizedPath, getRewritePath, getRewriteRules } from "./rewriteUtils.js";
18
19
  import { validatePrefix } from "./validatePrefix.js";
19
- export { type GenerateSitemapOptions, type GetPrefixOptions, type GetPrefixResult, type LocaleDomainMap, type LocalizedPathResult, type SitemapUrlEntry, comparePaths, generateSitemap, generateSitemapUrl, getBrowserLocale, getCanonicalPath, getDomainHostname, getDomainOrigin, getHTMLTextDir, getInternalPath, getLocale, getLocaleFromDomain, getLocaleFromPath, getLocaleLang, getLocaleName, getLocalizedPath, getLocalizedUrl, getMultilingualUrls, getPathWithoutLocale, getPrefix, getRewritePath, getRewriteRules, isLocaleExclusiveOnDomain, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, normalizePath, validatePrefix };
20
+ export { type GenerateSitemapOptions, type GetPrefixOptions, type GetPrefixResult, type LocaleDomainMap, type LocalizedPathResult, type ProxyMode, type SitemapUrlEntry, comparePaths, formatProxyEnabledMessage, generateSitemap, generateSitemapUrl, getBrowserLocale, getCanonicalPath, getDomainHostname, getDomainOrigin, getHTMLTextDir, getInternalPath, getLocale, getLocaleFromDomain, getLocaleFromPath, getLocaleLang, getLocaleName, getLocalizedPath, getLocalizedUrl, getMultilingualUrls, getPathWithoutLocale, getPrefix, getRewritePath, getRewriteRules, isLocaleExclusiveOnDomain, isProxyStorageLocaleEnabled, localeDetector, localeFlatMap, localeMap, localeRecord, localeResolver, normalizePath, resolveProxyMode, validatePrefix };
@@ -0,0 +1,92 @@
1
+ //#region src/localization/proxyMode.d.ts
2
+ /**
3
+ * Effective mode of the Intlayer locale-routing proxy, resolved from the
4
+ * `routing.enableProxy` configuration option.
5
+ *
6
+ * - `'auto'` — the option was left unset. The proxy is registered, but it stays
7
+ * URL-driven while a development or preview server is serving the app: the
8
+ * stored locale (cookie / header) is not used as a redirect source, so a
9
+ * stale cookie cannot silently pull every navigation to another locale. In
10
+ * production the mode behaves exactly like `'forced'`.
11
+ * - `'forced'` — the option was explicitly set to `true`. Full proxy behaviour
12
+ * in every environment, storage-driven redirects included.
13
+ * - `'disabled'` — the option was explicitly set to `false`. The proxy is not
14
+ * registered at all (Vite) or becomes a pass-through (Next.js).
15
+ */
16
+ type ProxyMode = 'auto' | 'forced' | 'disabled';
17
+ /**
18
+ * Resolves the effective {@link ProxyMode} from the `routing.enableProxy`
19
+ * configuration value.
20
+ *
21
+ * `process.env.INTLAYER_ROUTING_ENABLE_PROXY` is injected at build time by
22
+ * `getConfigEnvVars` and takes precedence, so bundlers can dead-code-eliminate
23
+ * the branches guarded by the resolved mode. The variable is only emitted for
24
+ * the two explicit states; its absence means `'auto'` and defers to the
25
+ * configuration value read at runtime.
26
+ *
27
+ * @param enableProxy - The `routing.enableProxy` value; `undefined` means auto.
28
+ * @returns The resolved proxy mode.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * resolveProxyMode(undefined); // 'auto'
33
+ * resolveProxyMode(true); // 'forced'
34
+ * resolveProxyMode(false); // 'disabled'
35
+ * ```
36
+ */
37
+ declare const resolveProxyMode: (enableProxy?: boolean) => ProxyMode;
38
+ /**
39
+ * Indicates whether the proxy may use the locale held in storage (cookie or
40
+ * header) as a source when deciding which locale a request resolves to.
41
+ *
42
+ * Auto mode suppresses it on development and preview servers only. Every other
43
+ * combination keeps the stored locale active, which notably preserves the
44
+ * behaviour of `createIntlayerProxyHandler` when it is mounted manually in a
45
+ * production Nitro server.
46
+ *
47
+ * Suppressing the read affects redirect *sources* only — the locale is still
48
+ * persisted onto responses, the URL locale prefix still wins over everything,
49
+ * and `Accept-Language` detection still applies as the fallback.
50
+ *
51
+ * @param proxyMode - The resolved proxy mode.
52
+ * @param isDevServer - Whether a development or preview server is serving the app.
53
+ * @returns `true` when the stored locale may drive locale resolution.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * isProxyStorageLocaleEnabled('auto', true); // false — dev server, URL-driven only
58
+ * isProxyStorageLocaleEnabled('auto', false); // true — production
59
+ * isProxyStorageLocaleEnabled('forced', true); // true — explicitly opted in
60
+ * ```
61
+ */
62
+ declare const isProxyStorageLocaleEnabled: (proxyMode: ProxyMode, isDevServer: boolean) => boolean;
63
+ /**
64
+ * Builds the line announcing that a server has mounted the locale-routing
65
+ * proxy.
66
+ *
67
+ * Shared by every integration (Vite plugin, Next.js middleware) so the reported
68
+ * state cannot drift between them: when the stored locale is suppressed the
69
+ * message says so, which would otherwise look like a broken proxy to anyone
70
+ * testing locale switching with a cookie already set.
71
+ *
72
+ * Takes the suppression flag rather than the {@link ProxyMode} on purpose. Auto
73
+ * mode only suppresses storage on a dev server, so a mode-based signature would
74
+ * let a production caller — such as the Nitro production handler — announce a
75
+ * suppression that is not actually in effect.
76
+ *
77
+ * @param isStorageLocaleSuppressed - Whether the stored locale is barred from
78
+ * driving redirects, i.e. the negation of {@link isProxyStorageLocaleEnabled}.
79
+ * @returns An ANSI-coloured, ready-to-log message.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * formatProxyEnabledMessage(true);
84
+ * // Intlayer proxy enabled - storage redirection disabled for dev purpose
85
+ * formatProxyEnabledMessage(false);
86
+ * // Intlayer proxy enabled
87
+ * ```
88
+ */
89
+ declare const formatProxyEnabledMessage: (isStorageLocaleSuppressed: boolean) => string;
90
+ //#endregion
91
+ export { ProxyMode, formatProxyEnabledMessage, isProxyStorageLocaleEnabled, resolveProxyMode };
92
+ //# sourceMappingURL=proxyMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxyMode.d.ts","names":[],"sources":["../../../src/localization/proxyMode.ts"],"mappings":";;;;;;;;;;;;;;;KAiBY;;;;;;;;;;;;;;;;;;;;;cAsBC,mBAAgB,0BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;cAkC5C,8BAA2B,WAC3B,WAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8BT,4BAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "9.1.3",
3
+ "version": "9.3.0",
4
4
  "private": false,
5
5
  "description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
6
6
  "keywords": [
@@ -172,15 +172,15 @@
172
172
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
173
173
  },
174
174
  "dependencies": {
175
- "@intlayer/api": "9.1.3",
176
- "@intlayer/config": "9.1.3",
177
- "@intlayer/dictionaries-entry": "9.1.3",
178
- "@intlayer/types": "9.1.3",
179
- "@intlayer/unmerged-dictionaries-entry": "9.1.3",
175
+ "@intlayer/api": "9.3.0",
176
+ "@intlayer/config": "9.3.0",
177
+ "@intlayer/dictionaries-entry": "9.3.0",
178
+ "@intlayer/types": "9.3.0",
179
+ "@intlayer/unmerged-dictionaries-entry": "9.3.0",
180
180
  "defu": "6.1.7"
181
181
  },
182
182
  "devDependencies": {
183
- "@types/node": "26.1.2",
183
+ "@types/node": "26.2.0",
184
184
  "@utils/ts-config": "1.0.4",
185
185
  "@utils/ts-config-types": "1.0.4",
186
186
  "@utils/tsdown-config": "1.0.4",