@intlayer/core 7.3.9 → 7.3.11
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/interpreter/getTranslation.cjs +26 -11
- package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
- package/dist/esm/interpreter/getTranslation.mjs +26 -10
- package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
- package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +7 -7
- package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +7 -7
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +2 -2
- package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -1
- package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
- package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
- package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -1
- package/dist/types/transpiler/translation/translation.d.ts +1 -1
- package/dist/types/transpiler/translation/translation.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let deepmerge = require("deepmerge");
|
|
3
|
-
deepmerge = require_rolldown_runtime.__toESM(deepmerge);
|
|
4
1
|
|
|
5
2
|
//#region src/interpreter/getTranslation.ts
|
|
6
3
|
/**
|
|
7
|
-
* Check if a value is a plain object that can be safely
|
|
4
|
+
* Check if a value is a plain object that can be safely processed.
|
|
8
5
|
* Returns false for Promises, React elements, class instances, etc.
|
|
9
6
|
*/
|
|
10
|
-
const
|
|
7
|
+
const isPlainObject = (value) => {
|
|
11
8
|
if (value === null || typeof value !== "object") return false;
|
|
12
9
|
if (value instanceof Promise || typeof value.then === "function") return false;
|
|
13
10
|
if (value.$$typeof !== void 0) return false;
|
|
@@ -15,6 +12,26 @@ const isMergeableObject = (value) => {
|
|
|
15
12
|
return proto === Object.prototype || proto === null || Array.isArray(value);
|
|
16
13
|
};
|
|
17
14
|
/**
|
|
15
|
+
* Recursively merges two objects.
|
|
16
|
+
* Resembles the behavior of `defu` but respects `isPlainObject` to avoid merging React elements.
|
|
17
|
+
* Arrays are replaced, not merged.
|
|
18
|
+
*/
|
|
19
|
+
const deepMergeObjects = (target, source) => {
|
|
20
|
+
if (target === void 0) return source;
|
|
21
|
+
if (source === void 0) return target;
|
|
22
|
+
if (Array.isArray(target)) return target;
|
|
23
|
+
if (isPlainObject(target) && isPlainObject(source)) {
|
|
24
|
+
const result = { ...target };
|
|
25
|
+
for (const key of Object.keys(source)) {
|
|
26
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
27
|
+
if (Object.hasOwn(target, key)) result[key] = deepMergeObjects(target[key], source[key]);
|
|
28
|
+
else result[key] = source[key];
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
18
35
|
* Recursively removes undefined values from an object.
|
|
19
36
|
* Handles circular references by tracking visited objects.
|
|
20
37
|
*/
|
|
@@ -22,7 +39,7 @@ const removeUndefinedValues = (object, visited = /* @__PURE__ */ new WeakSet())
|
|
|
22
39
|
if (typeof object !== "object" || object === null) return object;
|
|
23
40
|
if (visited.has(object)) return object;
|
|
24
41
|
visited.add(object);
|
|
25
|
-
if (!
|
|
42
|
+
if (!isPlainObject(object)) return object;
|
|
26
43
|
if (Array.isArray(object)) return object.map((item) => removeUndefinedValues(item, visited));
|
|
27
44
|
const result = {};
|
|
28
45
|
for (const [key, value] of Object.entries(object)) if (value !== void 0) result[key] = removeUndefinedValues(value, visited);
|
|
@@ -82,12 +99,10 @@ const getTranslation = (languageContent, locale, fallback) => {
|
|
|
82
99
|
}
|
|
83
100
|
}
|
|
84
101
|
if (results.length === 0) return;
|
|
85
|
-
results.reverse();
|
|
86
102
|
const cleanResults = results.map((item) => removeUndefinedValues(item));
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
});
|
|
103
|
+
if (cleanResults.length === 1) return cleanResults[0];
|
|
104
|
+
if (Array.isArray(cleanResults[0])) return cleanResults[0];
|
|
105
|
+
return cleanResults.reduce((acc, curr) => deepMergeObjects(acc, curr));
|
|
91
106
|
};
|
|
92
107
|
|
|
93
108
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTranslation.cjs","names":["result: Record<string, unknown>","results: Content[]"
|
|
1
|
+
{"version":3,"file":"getTranslation.cjs","names":["result: Record<string, unknown>","results: Content[]"],"sources":["../../../src/interpreter/getTranslation.ts"],"sourcesContent":["import type { LocalesValues, StrictModeLocaleMap } from '@intlayer/types';\n\n/**\n * Check if a value is a plain object that can be safely processed.\n * Returns false for Promises, React elements, class instances, etc.\n */\nconst isPlainObject = (value: unknown): boolean => {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n\n // Don't process Promises (e.g., Next.js 15+ params)\n if (value instanceof Promise || typeof (value as any).then === 'function') {\n return false;\n }\n\n // Don't process React elements\n if ((value as any).$$typeof !== undefined) {\n return false;\n }\n\n // Only process plain objects and arrays\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null || Array.isArray(value);\n};\n\n/**\n * Recursively merges two objects.\n * Resembles the behavior of `defu` but respects `isPlainObject` to avoid merging React elements.\n * Arrays are replaced, not merged.\n */\nconst deepMergeObjects = (target: any, source: any): any => {\n if (target === undefined) return source;\n if (source === undefined) return target;\n\n if (Array.isArray(target)) return target;\n\n if (isPlainObject(target) && isPlainObject(source)) {\n const result = { ...target };\n for (const key of Object.keys(source)) {\n if (key === '__proto__' || key === 'constructor') continue;\n\n if (Object.hasOwn(target, key)) {\n result[key] = deepMergeObjects(target[key], source[key]);\n } else {\n result[key] = source[key];\n }\n }\n return result;\n }\n\n return target;\n};\n\n/**\n * Recursively removes undefined values from an object.\n * Handles circular references by tracking visited objects.\n */\nconst removeUndefinedValues = <T>(\n object: T,\n visited = new WeakSet<object>()\n): T => {\n if (typeof object !== 'object' || object === null) {\n return object;\n }\n\n // Handle circular references - return original to avoid infinite recursion\n if (visited.has(object)) {\n return object;\n }\n visited.add(object);\n\n // Don't process non-plain objects (Promises, React elements, etc.)\n if (!isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((item) => removeUndefinedValues(item, visited)) as T;\n }\n\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(object)) {\n if (value !== undefined) {\n result[key] = removeUndefinedValues(value, visited);\n }\n }\n return result as T;\n};\n\n/**\n *\n * Allow to pick a content based on a locale.\n * If not locale found, it will return the content related to the default locale.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * ```ts\n * const content = getTranslation<string>({\n * en: 'Hello',\n * fr: 'Bonjour',\n * }, 'fr');\n * // 'Bonjour'\n * ```\n *\n * Using TypeScript:\n * - this function will require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nexport const getTranslation = <Content = string>(\n languageContent: StrictModeLocaleMap<Content>,\n locale: LocalesValues,\n fallback?: LocalesValues\n): Content => {\n const results: Content[] = [];\n\n const getContent = (loc: string) =>\n languageContent[loc as keyof typeof languageContent];\n\n // 1. Get Target Content\n const content = getContent(locale);\n if (typeof content === 'string') {\n return content;\n } else if (content !== undefined) {\n results.push(content);\n }\n\n // 2. Get Target Generic Content (e.g. 'en' from 'en-US')\n if (locale.includes('-')) {\n const genericLocale = locale.split('-')[0];\n if (genericLocale in languageContent) {\n const genericContent = getContent(genericLocale);\n\n if (typeof genericContent === 'string') {\n // If we haven't found specific content yet, return generic string\n if (results.length === 0) return genericContent;\n } else if (genericContent !== undefined) {\n results.push(genericContent);\n }\n }\n }\n\n // 3. Get Fallback Content\n if (fallback !== undefined && fallback !== locale) {\n // 3a. Fallback Specific\n if (fallback in languageContent) {\n const fallbackContent = getContent(fallback);\n\n if (typeof fallbackContent === 'string') {\n if (results.length === 0) return fallbackContent;\n } else if (fallbackContent !== undefined) {\n results.push(fallbackContent);\n }\n }\n\n // 3b. Fallback Generic (The missing piece: e.g. 'en' from 'en-GB' fallback)\n if (fallback.includes('-')) {\n const genericFallback = fallback.split('-')[0];\n const genericLocale = locale.split('-')[0];\n\n // Only add if it's different from the target generic (to avoid duplication)\n // and exists in the dictionary\n if (\n genericFallback !== genericLocale &&\n genericFallback in languageContent\n ) {\n const genericFallbackContent = getContent(genericFallback);\n\n if (typeof genericFallbackContent === 'string') {\n if (results.length === 0) return genericFallbackContent;\n } else if (genericFallbackContent !== undefined) {\n results.push(genericFallbackContent);\n }\n }\n }\n }\n\n if (results.length === 0) {\n return undefined as Content;\n }\n\n // Clean undefined values so they don't overwrite fallbacks\n // Order: [Target, Generic, Fallback, FallbackGeneric]\n // defu first argument takes precedence, so Target wins\n const cleanResults = results.map((item) => removeUndefinedValues(item));\n\n // If only one result, return it directly (no merging needed)\n if (cleanResults.length === 1) {\n return cleanResults[0];\n }\n\n // If the first result is an array, return it directly (arrays replace, don't merge)\n // defu would incorrectly convert arrays to objects with numeric keys\n if (Array.isArray(cleanResults[0])) {\n return cleanResults[0];\n }\n\n // Merge objects with custom merge - first argument takes precedence\n // Cast to object[] since by this point we've already returned early for strings, arrays, and single results\n return (cleanResults as object[]).reduce((acc, curr) =>\n deepMergeObjects(acc, curr)\n ) as Content;\n};\n"],"mappings":";;;;;;AAMA,MAAM,iBAAiB,UAA4B;AACjD,KAAI,UAAU,QAAQ,OAAO,UAAU,SACrC,QAAO;AAIT,KAAI,iBAAiB,WAAW,OAAQ,MAAc,SAAS,WAC7D,QAAO;AAIT,KAAK,MAAc,aAAa,OAC9B,QAAO;CAIT,MAAM,QAAQ,OAAO,eAAe,MAAM;AAC1C,QAAO,UAAU,OAAO,aAAa,UAAU,QAAQ,MAAM,QAAQ,MAAM;;;;;;;AAQ7E,MAAM,oBAAoB,QAAa,WAAqB;AAC1D,KAAI,WAAW,OAAW,QAAO;AACjC,KAAI,WAAW,OAAW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AAI,QAAQ,WAAW,EAAG,QAAO;cACxB,mBAAmB,OAC5B,SAAQ,KAAK,eAAe;;;AAMlC,KAAI,aAAa,UAAa,aAAa,QAAQ;AAEjD,MAAI,YAAY,iBAAiB;GAC/B,MAAM,kBAAkB,WAAW,SAAS;AAE5C,OAAI,OAAO,oBAAoB,UAC7B;QAAI,QAAQ,WAAW,EAAG,QAAO;cACxB,oBAAoB,OAC7B,SAAQ,KAAK,gBAAgB;;AAKjC,MAAI,SAAS,SAAS,IAAI,EAAE;GAC1B,MAAM,kBAAkB,SAAS,MAAM,IAAI,CAAC;AAK5C,OACE,oBALoB,OAAO,MAAM,IAAI,CAAC,MAMtC,mBAAmB,iBACnB;IACA,MAAM,yBAAyB,WAAW,gBAAgB;AAE1D,QAAI,OAAO,2BAA2B,UACpC;SAAI,QAAQ,WAAW,EAAG,QAAO;eACxB,2BAA2B,OACpC,SAAQ,KAAK,uBAAuB;;;;AAM5C,KAAI,QAAQ,WAAW,EACrB;CAMF,MAAM,eAAe,QAAQ,KAAK,SAAS,sBAAsB,KAAK,CAAC;AAGvE,KAAI,aAAa,WAAW,EAC1B,QAAO,aAAa;AAKtB,KAAI,MAAM,QAAQ,aAAa,GAAG,CAChC,QAAO,aAAa;AAKtB,QAAQ,aAA0B,QAAQ,KAAK,SAC7C,iBAAiB,KAAK,KAAK,CAC5B"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import deepMerge from "deepmerge";
|
|
2
|
-
|
|
3
1
|
//#region src/interpreter/getTranslation.ts
|
|
4
2
|
/**
|
|
5
|
-
* Check if a value is a plain object that can be safely
|
|
3
|
+
* Check if a value is a plain object that can be safely processed.
|
|
6
4
|
* Returns false for Promises, React elements, class instances, etc.
|
|
7
5
|
*/
|
|
8
|
-
const
|
|
6
|
+
const isPlainObject = (value) => {
|
|
9
7
|
if (value === null || typeof value !== "object") return false;
|
|
10
8
|
if (value instanceof Promise || typeof value.then === "function") return false;
|
|
11
9
|
if (value.$$typeof !== void 0) return false;
|
|
@@ -13,6 +11,26 @@ const isMergeableObject = (value) => {
|
|
|
13
11
|
return proto === Object.prototype || proto === null || Array.isArray(value);
|
|
14
12
|
};
|
|
15
13
|
/**
|
|
14
|
+
* Recursively merges two objects.
|
|
15
|
+
* Resembles the behavior of `defu` but respects `isPlainObject` to avoid merging React elements.
|
|
16
|
+
* Arrays are replaced, not merged.
|
|
17
|
+
*/
|
|
18
|
+
const deepMergeObjects = (target, source) => {
|
|
19
|
+
if (target === void 0) return source;
|
|
20
|
+
if (source === void 0) return target;
|
|
21
|
+
if (Array.isArray(target)) return target;
|
|
22
|
+
if (isPlainObject(target) && isPlainObject(source)) {
|
|
23
|
+
const result = { ...target };
|
|
24
|
+
for (const key of Object.keys(source)) {
|
|
25
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
26
|
+
if (Object.hasOwn(target, key)) result[key] = deepMergeObjects(target[key], source[key]);
|
|
27
|
+
else result[key] = source[key];
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
16
34
|
* Recursively removes undefined values from an object.
|
|
17
35
|
* Handles circular references by tracking visited objects.
|
|
18
36
|
*/
|
|
@@ -20,7 +38,7 @@ const removeUndefinedValues = (object, visited = /* @__PURE__ */ new WeakSet())
|
|
|
20
38
|
if (typeof object !== "object" || object === null) return object;
|
|
21
39
|
if (visited.has(object)) return object;
|
|
22
40
|
visited.add(object);
|
|
23
|
-
if (!
|
|
41
|
+
if (!isPlainObject(object)) return object;
|
|
24
42
|
if (Array.isArray(object)) return object.map((item) => removeUndefinedValues(item, visited));
|
|
25
43
|
const result = {};
|
|
26
44
|
for (const [key, value] of Object.entries(object)) if (value !== void 0) result[key] = removeUndefinedValues(value, visited);
|
|
@@ -80,12 +98,10 @@ const getTranslation = (languageContent, locale, fallback) => {
|
|
|
80
98
|
}
|
|
81
99
|
}
|
|
82
100
|
if (results.length === 0) return;
|
|
83
|
-
results.reverse();
|
|
84
101
|
const cleanResults = results.map((item) => removeUndefinedValues(item));
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
102
|
+
if (cleanResults.length === 1) return cleanResults[0];
|
|
103
|
+
if (Array.isArray(cleanResults[0])) return cleanResults[0];
|
|
104
|
+
return cleanResults.reduce((acc, curr) => deepMergeObjects(acc, curr));
|
|
89
105
|
};
|
|
90
106
|
|
|
91
107
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTranslation.mjs","names":["result: Record<string, unknown>","results: Content[]"],"sources":["../../../src/interpreter/getTranslation.ts"],"sourcesContent":["import type { LocalesValues, StrictModeLocaleMap } from '@intlayer/types';\
|
|
1
|
+
{"version":3,"file":"getTranslation.mjs","names":["result: Record<string, unknown>","results: Content[]"],"sources":["../../../src/interpreter/getTranslation.ts"],"sourcesContent":["import type { LocalesValues, StrictModeLocaleMap } from '@intlayer/types';\n\n/**\n * Check if a value is a plain object that can be safely processed.\n * Returns false for Promises, React elements, class instances, etc.\n */\nconst isPlainObject = (value: unknown): boolean => {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n\n // Don't process Promises (e.g., Next.js 15+ params)\n if (value instanceof Promise || typeof (value as any).then === 'function') {\n return false;\n }\n\n // Don't process React elements\n if ((value as any).$$typeof !== undefined) {\n return false;\n }\n\n // Only process plain objects and arrays\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null || Array.isArray(value);\n};\n\n/**\n * Recursively merges two objects.\n * Resembles the behavior of `defu` but respects `isPlainObject` to avoid merging React elements.\n * Arrays are replaced, not merged.\n */\nconst deepMergeObjects = (target: any, source: any): any => {\n if (target === undefined) return source;\n if (source === undefined) return target;\n\n if (Array.isArray(target)) return target;\n\n if (isPlainObject(target) && isPlainObject(source)) {\n const result = { ...target };\n for (const key of Object.keys(source)) {\n if (key === '__proto__' || key === 'constructor') continue;\n\n if (Object.hasOwn(target, key)) {\n result[key] = deepMergeObjects(target[key], source[key]);\n } else {\n result[key] = source[key];\n }\n }\n return result;\n }\n\n return target;\n};\n\n/**\n * Recursively removes undefined values from an object.\n * Handles circular references by tracking visited objects.\n */\nconst removeUndefinedValues = <T>(\n object: T,\n visited = new WeakSet<object>()\n): T => {\n if (typeof object !== 'object' || object === null) {\n return object;\n }\n\n // Handle circular references - return original to avoid infinite recursion\n if (visited.has(object)) {\n return object;\n }\n visited.add(object);\n\n // Don't process non-plain objects (Promises, React elements, etc.)\n if (!isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((item) => removeUndefinedValues(item, visited)) as T;\n }\n\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(object)) {\n if (value !== undefined) {\n result[key] = removeUndefinedValues(value, visited);\n }\n }\n return result as T;\n};\n\n/**\n *\n * Allow to pick a content based on a locale.\n * If not locale found, it will return the content related to the default locale.\n *\n * Return either the content editor, or the content itself depending on the configuration.\n *\n * Usage:\n *\n * ```ts\n * const content = getTranslation<string>({\n * en: 'Hello',\n * fr: 'Bonjour',\n * }, 'fr');\n * // 'Bonjour'\n * ```\n *\n * Using TypeScript:\n * - this function will require each locale to be defined if defined in the project configuration.\n * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.\n */\nexport const getTranslation = <Content = string>(\n languageContent: StrictModeLocaleMap<Content>,\n locale: LocalesValues,\n fallback?: LocalesValues\n): Content => {\n const results: Content[] = [];\n\n const getContent = (loc: string) =>\n languageContent[loc as keyof typeof languageContent];\n\n // 1. Get Target Content\n const content = getContent(locale);\n if (typeof content === 'string') {\n return content;\n } else if (content !== undefined) {\n results.push(content);\n }\n\n // 2. Get Target Generic Content (e.g. 'en' from 'en-US')\n if (locale.includes('-')) {\n const genericLocale = locale.split('-')[0];\n if (genericLocale in languageContent) {\n const genericContent = getContent(genericLocale);\n\n if (typeof genericContent === 'string') {\n // If we haven't found specific content yet, return generic string\n if (results.length === 0) return genericContent;\n } else if (genericContent !== undefined) {\n results.push(genericContent);\n }\n }\n }\n\n // 3. Get Fallback Content\n if (fallback !== undefined && fallback !== locale) {\n // 3a. Fallback Specific\n if (fallback in languageContent) {\n const fallbackContent = getContent(fallback);\n\n if (typeof fallbackContent === 'string') {\n if (results.length === 0) return fallbackContent;\n } else if (fallbackContent !== undefined) {\n results.push(fallbackContent);\n }\n }\n\n // 3b. Fallback Generic (The missing piece: e.g. 'en' from 'en-GB' fallback)\n if (fallback.includes('-')) {\n const genericFallback = fallback.split('-')[0];\n const genericLocale = locale.split('-')[0];\n\n // Only add if it's different from the target generic (to avoid duplication)\n // and exists in the dictionary\n if (\n genericFallback !== genericLocale &&\n genericFallback in languageContent\n ) {\n const genericFallbackContent = getContent(genericFallback);\n\n if (typeof genericFallbackContent === 'string') {\n if (results.length === 0) return genericFallbackContent;\n } else if (genericFallbackContent !== undefined) {\n results.push(genericFallbackContent);\n }\n }\n }\n }\n\n if (results.length === 0) {\n return undefined as Content;\n }\n\n // Clean undefined values so they don't overwrite fallbacks\n // Order: [Target, Generic, Fallback, FallbackGeneric]\n // defu first argument takes precedence, so Target wins\n const cleanResults = results.map((item) => removeUndefinedValues(item));\n\n // If only one result, return it directly (no merging needed)\n if (cleanResults.length === 1) {\n return cleanResults[0];\n }\n\n // If the first result is an array, return it directly (arrays replace, don't merge)\n // defu would incorrectly convert arrays to objects with numeric keys\n if (Array.isArray(cleanResults[0])) {\n return cleanResults[0];\n }\n\n // Merge objects with custom merge - first argument takes precedence\n // Cast to object[] since by this point we've already returned early for strings, arrays, and single results\n return (cleanResults as object[]).reduce((acc, curr) =>\n deepMergeObjects(acc, curr)\n ) as Content;\n};\n"],"mappings":";;;;;AAMA,MAAM,iBAAiB,UAA4B;AACjD,KAAI,UAAU,QAAQ,OAAO,UAAU,SACrC,QAAO;AAIT,KAAI,iBAAiB,WAAW,OAAQ,MAAc,SAAS,WAC7D,QAAO;AAIT,KAAK,MAAc,aAAa,OAC9B,QAAO;CAIT,MAAM,QAAQ,OAAO,eAAe,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,OAAO,SAAS,IAAI,EAAE;EACxB,MAAM,gBAAgB,OAAO,MAAM,IAAI,CAAC;AACxC,MAAI,iBAAiB,iBAAiB;GACpC,MAAM,iBAAiB,WAAW,cAAc;AAEhD,OAAI,OAAO,mBAAmB,UAE5B;QAAI,QAAQ,WAAW,EAAG,QAAO;cACxB,mBAAmB,OAC5B,SAAQ,KAAK,eAAe;;;AAMlC,KAAI,aAAa,UAAa,aAAa,QAAQ;AAEjD,MAAI,YAAY,iBAAiB;GAC/B,MAAM,kBAAkB,WAAW,SAAS;AAE5C,OAAI,OAAO,oBAAoB,UAC7B;QAAI,QAAQ,WAAW,EAAG,QAAO;cACxB,oBAAoB,OAC7B,SAAQ,KAAK,gBAAgB;;AAKjC,MAAI,SAAS,SAAS,IAAI,EAAE;GAC1B,MAAM,kBAAkB,SAAS,MAAM,IAAI,CAAC;AAK5C,OACE,oBALoB,OAAO,MAAM,IAAI,CAAC,MAMtC,mBAAmB,iBACnB;IACA,MAAM,yBAAyB,WAAW,gBAAgB;AAE1D,QAAI,OAAO,2BAA2B,UACpC;SAAI,QAAQ,WAAW,EAAG,QAAO;eACxB,2BAA2B,OACpC,SAAQ,KAAK,uBAAuB;;;;AAM5C,KAAI,QAAQ,WAAW,EACrB;CAMF,MAAM,eAAe,QAAQ,KAAK,SAAS,sBAAsB,KAAK,CAAC;AAGvE,KAAI,aAAa,WAAW,EAC1B,QAAO,aAAa;AAKtB,KAAI,MAAM,QAAQ,aAAa,GAAG,CAChC,QAAO,aAAa;AAKtB,QAAQ,aAA0B,QAAQ,KAAK,SAC7C,iBAAiB,KAAK,KAAK,CAC5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
|
|
2
2
|
import "../interpreter/index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _intlayer_types6 from "@intlayer/types";
|
|
4
4
|
import { ContentNode, DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts
|
|
@@ -24,11 +24,11 @@ declare const getFilterMissingTranslationsContent: <T extends ContentNode, L ext
|
|
|
24
24
|
declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, localeToCheck: LocalesValues) => {
|
|
25
25
|
content: any;
|
|
26
26
|
$schema?: string;
|
|
27
|
-
id?:
|
|
27
|
+
id?: _intlayer_types6.DictionaryId;
|
|
28
28
|
projectIds?: string[];
|
|
29
|
-
localId?:
|
|
30
|
-
localIds?:
|
|
31
|
-
key:
|
|
29
|
+
localId?: _intlayer_types6.LocalDictionaryId;
|
|
30
|
+
localIds?: _intlayer_types6.LocalDictionaryId[];
|
|
31
|
+
key: _intlayer_types6.DictionaryKey;
|
|
32
32
|
title?: string;
|
|
33
33
|
description?: string;
|
|
34
34
|
versions?: string[];
|
|
@@ -36,11 +36,11 @@ declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, l
|
|
|
36
36
|
filePath?: string;
|
|
37
37
|
tags?: string[];
|
|
38
38
|
locale?: LocalesValues;
|
|
39
|
-
fill?:
|
|
39
|
+
fill?: _intlayer_types6.Fill;
|
|
40
40
|
filled?: true;
|
|
41
41
|
priority?: number;
|
|
42
42
|
live?: boolean;
|
|
43
|
-
location?:
|
|
43
|
+
location?: _intlayer_types6.DictionaryLocation;
|
|
44
44
|
};
|
|
45
45
|
//#endregion
|
|
46
46
|
export { filterMissingTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeepTransformContent, NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
|
|
2
2
|
import "../interpreter/index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _intlayer_types0 from "@intlayer/types";
|
|
4
4
|
import { ContentNode, DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
|
|
5
5
|
|
|
6
6
|
//#region src/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts
|
|
@@ -16,11 +16,11 @@ declare const getFilterTranslationsOnlyContent: <T extends ContentNode, L extend
|
|
|
16
16
|
declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, locale?: LocalesValues, fallback?: LocalesValues) => {
|
|
17
17
|
content: any;
|
|
18
18
|
$schema?: string;
|
|
19
|
-
id?:
|
|
19
|
+
id?: _intlayer_types0.DictionaryId;
|
|
20
20
|
projectIds?: string[];
|
|
21
|
-
localId?:
|
|
22
|
-
localIds?:
|
|
23
|
-
key:
|
|
21
|
+
localId?: _intlayer_types0.LocalDictionaryId;
|
|
22
|
+
localIds?: _intlayer_types0.LocalDictionaryId[];
|
|
23
|
+
key: _intlayer_types0.DictionaryKey;
|
|
24
24
|
title?: string;
|
|
25
25
|
description?: string;
|
|
26
26
|
versions?: string[];
|
|
@@ -28,11 +28,11 @@ declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, loca
|
|
|
28
28
|
filePath?: string;
|
|
29
29
|
tags?: string[];
|
|
30
30
|
locale?: LocalesValues;
|
|
31
|
-
fill?:
|
|
31
|
+
fill?: _intlayer_types0.Fill;
|
|
32
32
|
filled?: true;
|
|
33
33
|
priority?: number;
|
|
34
34
|
live?: boolean;
|
|
35
|
-
location?:
|
|
35
|
+
location?: _intlayer_types0.DictionaryLocation;
|
|
36
36
|
};
|
|
37
37
|
//#endregion
|
|
38
38
|
export { filterTranslationsOnlyPlugin, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types0 from "@intlayer/types";
|
|
2
2
|
import { Dictionary } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/dictionaryManipulator/orderDictionaries.d.ts
|
|
@@ -10,7 +10,7 @@ import { Dictionary } from "@intlayer/types";
|
|
|
10
10
|
* @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')
|
|
11
11
|
* @returns Ordered array of dictionaries
|
|
12
12
|
*/
|
|
13
|
-
declare const orderDictionaries: (dictionaries: Dictionary[], configuration?:
|
|
13
|
+
declare const orderDictionaries: (dictionaries: Dictionary[], configuration?: _intlayer_types0.IntlayerConfig) => Dictionary[];
|
|
14
14
|
//#endregion
|
|
15
15
|
export { orderDictionaries };
|
|
16
16
|
//# sourceMappingURL=orderDictionaries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUA;;;;AAGa,cAHA,iBAGA,EAAA,CAAA,YAAA,EAFG,UAEH,EAAA,EAAA,aAAA,CAAA,EAFa,
|
|
1
|
+
{"version":3,"file":"orderDictionaries.d.ts","names":[],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUA;;;;AAGa,cAHA,iBAGA,EAAA,CAAA,YAAA,EAFG,UAEH,EAAA,EAAA,aAAA,CAAA,EAFa,gBAAA,CACxB,cACW,EAAA,GAAV,UAAU,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../../../src/interpreter/getContent/plugins.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAoCA;AAcA;;;;;;AAIqB,KAlBT,OAAA,GAkBS;EAAP,EAAA,EAAA,MAAA;EACR,SAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,GAAA,OAAA;EAAgB,SAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,KAAA,EAdX,SAcW,EAAA,WAAA,EAAA,CAAA,IAAA,EAAA,GAAA,EAAA,KAAA,EAbc,SAad,EAAA,GAAA,GAAA,EAAA,GAAA,GAAA;CACO;;;;AACA,KAPjB,eAOiB,CAAA,CAAA,EAAA,CAAA,EAAA,UAPe,aAOf,CAAA,GA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.ts","names":[],"sources":["../../../src/interpreter/getTranslation.ts"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"getTranslation.d.ts","names":[],"sources":["../../../src/interpreter/getTranslation.ts"],"sourcesContent":[],"mappings":";;;;;;AA+GA;;;;;;;;;;;;;;;;;;;cAAa,oDACM,oBAAoB,kBAC7B,0BACG,kBACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enumeration.d.ts","names":[],"sources":["../../../../src/transpiler/enumeration/enumeration.ts"],"sourcesContent":[],"mappings":";;;KAEK,QAAA;KACA,QAAA;AAH2E,KAI3E,OAAA,GAAU,QAFF,GAEa,QAFb;AAAA,KAIR,KAAA,GAAQ,OAHA;AAAA,KAIR,WAAA,GAHO,IAGW,OAHR,EAAA;AAAmB,KAI7B,QAAA,GAFK,IAEU,OAFP,EAAA;AAAO,KAGf,eAAA,GAFW,KAEY,OAFL,EAAA;AAAO,KAGzB,QAAA,GAFQ,IAEO,
|
|
1
|
+
{"version":3,"file":"enumeration.d.ts","names":[],"sources":["../../../../src/transpiler/enumeration/enumeration.ts"],"sourcesContent":[],"mappings":";;;KAEK,QAAA;KACA,QAAA;AAH2E,KAI3E,OAAA,GAAU,QAFF,GAEa,QAFb;AAAA,KAIR,KAAA,GAAQ,OAHA;AAAA,KAIR,WAAA,GAHO,IAGW,OAHR,EAAA;AAAmB,KAI7B,QAAA,GAFK,IAEU,OAFP,EAAA;AAAO,KAGf,eAAA,GAFW,KAEY,OAFL,EAAA;AAAO,KAGzB,QAAA,GAFQ,IAEO,OAFP,EAAO;AAAO,KAGtB,eAAA,GAFe,KAEQ,OAFA,EAAA;AACvB,KAGO,WAAA,GACR,KAJgB,GAKhB,WALuB,GAMvB,QANuB,GAOvB,eAPuB,GAQvB,QARuB,GASvB,eATuB;AACtB,KAUO,uBAVgB,CAAA,OAAO,CAAA,GAUY,OAVZ,CAWjC,MAXiC,CAW1B,WAX0B,EAWb,OAXa,CAAA,CAAA,GAAA;EAEvB,QAAA,CAAA,EAWC,OAXU;CACnB;AACA,KAYQ,kBAZR,CAAA,UAAA,OAAA,CAAA,GAYgD,cAZhD,CAaF,QAAA,CAAS,WAbP,EAcF,uBAdE,CAcsB,OAdtB,CAAA,CAAA;;;;;;AAMJ;;;;;;;AAMA;;;;;;AAGE;cAqBI,WAA0D,EAAA,CAAA,OAAA,CAAA,CAAA,OAAA,CAAA,EAAxB,uBAAwB,CAAA,OAAA,CAAA,EAAA,GAAQ,cAAR,CAAQ,QAAA,CAAA,WAAR,EAAQ,uBAAR,CAAQ,OAAR,CAAA,EAAA,CAAA,CAAA,CAAA"}
|
|
@@ -23,7 +23,7 @@ type TranslationContent<Content = unknown, RecordContent extends StrictModeLocal
|
|
|
23
23
|
* - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
|
|
24
24
|
*/
|
|
25
25
|
declare const translation: <Content = unknown, ContentRecord extends StrictModeLocaleMap<Content> = StrictModeLocaleMap<Content>>(content: ContentRecord) => TypedNodeModel<NodeType.Translation, ContentRecord, {
|
|
26
|
-
nodeType: "translation"
|
|
26
|
+
nodeType: NodeType.Translation | "translation";
|
|
27
27
|
} & {
|
|
28
28
|
translation: ContentRecord;
|
|
29
29
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.d.ts","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":[],"mappings":";;;KAOY,4DAGR,oBAAoB,WAAW,oBAAoB,YACnD,eAAe,QAAA,CAAS,aAAa;;AAJzC;;;;;;;;;AAIwD;;;;;;;;;;cAsBlD,WAKkB,EAAA,CAAA,UAAA,OAAA,EAAA,sBAFpB,mBAEoB,CAFA,OAEA,CAAA,GAFW,mBAEX,CAF+B,OAE/B,CAAA,CAAA,CAAA,OAAA,EAAb,aAAa,EAAA,GAAA,cAAA,CAAA,QAAA,CAAA,WAAA,EAAA,aAAA,EAAA;EAAA,QAAA,
|
|
1
|
+
{"version":3,"file":"translation.d.ts","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":[],"mappings":";;;KAOY,4DAGR,oBAAoB,WAAW,oBAAoB,YACnD,eAAe,QAAA,CAAS,aAAa;;AAJzC;;;;;;;;;AAIwD;;;;;;;;;;cAsBlD,WAKkB,EAAA,CAAA,UAAA,OAAA,EAAA,sBAFpB,mBAEoB,CAFA,OAEA,CAAA,GAFW,mBAEX,CAF+B,OAE/B,CAAA,CAAA,CAAA,OAAA,EAAb,aAAa,EAAA,GAAA,cAAA,CAAA,QAAA,CAAA,WAAA,EAAA,aAAA,EAAA;EAAA,QAAA,sBAAA,GAAA,aAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
|
|
6
6
|
"keywords": [
|
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@intlayer/api": "7.3.
|
|
106
|
-
"@intlayer/config": "7.3.
|
|
107
|
-
"@intlayer/dictionaries-entry": "7.3.
|
|
108
|
-
"@intlayer/types": "7.3.
|
|
109
|
-
"@intlayer/unmerged-dictionaries-entry": "7.3.
|
|
110
|
-
"
|
|
105
|
+
"@intlayer/api": "7.3.11",
|
|
106
|
+
"@intlayer/config": "7.3.11",
|
|
107
|
+
"@intlayer/dictionaries-entry": "7.3.11",
|
|
108
|
+
"@intlayer/types": "7.3.11",
|
|
109
|
+
"@intlayer/unmerged-dictionaries-entry": "7.3.11",
|
|
110
|
+
"defu": "6.1.4"
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
113
|
"@types/node": "24.10.1",
|