@intlayer/core 5.5.3 → 5.5.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/interpreter/getContent/getLocalisedContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport type { ContentNode } from '../../types';\nimport { deepTransformNode } from './deepTransform';\nimport {\n translationPlugin,\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from './plugins';\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n * In comparison to `getContent`, this function will only apply the translation plugin.\n * It will not transform enumerations, insertions, or other content types.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getLocalisedContent = <\n T extends ContentNode,\n L extends LocalesValues = Locales,\n>(\n node: T,\n locale: L = configuration.internationalization.defaultLocale as L,\n nodeProps: NodeProps,\n fallback: boolean = false\n) => {\n const plugins: Plugins[] = [\n translationPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAG1B,2BAAkC;AAClC,qBAKO;AAUA,MAAM,sBAAsB,CAIjC,MACA,SAAY,aAAAA,QAAc,qBAAqB,eAC/C,WACA,WAAoB,UACjB;AACH,QAAM,UAAqB;AAAA,QACzB,kCAAkB,QAAQ,QAAQ;AAAA,IAClC,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,aAAO,wCAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["configuration"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/interpreter/getContent/getLocalisedContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport type { ContentNode } from '../../types';\nimport { deepTransformNode } from './deepTransform';\nimport {\n translationPlugin,\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from './plugins';\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n * In comparison to `getContent`, this function will only apply the translation plugin.\n * It will not transform enumerations, insertions, or other content types.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getLocalisedContent = <\n T extends ContentNode,\n L extends LocalesValues = Locales,\n>(\n node: T,\n locale: L = configuration.internationalization.defaultLocale as L,\n nodeProps: NodeProps,\n fallback: boolean = false // fallback mean that if field is not translated, it will use the default locale\n) => {\n const plugins: Plugins[] = [\n translationPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAG1B,2BAAkC;AAClC,qBAKO;AAUA,MAAM,sBAAsB,CAIjC,MACA,SAAY,aAAAA,QAAc,qBAAqB,eAC/C,WACA,WAAoB,UACjB;AACH,QAAM,UAAqB;AAAA,QACzB,kCAAkB,QAAQ,QAAQ;AAAA,IAClC,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,aAAO,wCAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["configuration"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/interpreter/getContent/getLocalisedContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport type { ContentNode } from '../../types';\nimport { deepTransformNode } from './deepTransform';\nimport {\n translationPlugin,\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from './plugins';\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n * In comparison to `getContent`, this function will only apply the translation plugin.\n * It will not transform enumerations, insertions, or other content types.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getLocalisedContent = <\n T extends ContentNode,\n L extends LocalesValues = Locales,\n>(\n node: T,\n locale: L = configuration.internationalization.defaultLocale as L,\n nodeProps: NodeProps,\n fallback: boolean = false\n) => {\n const plugins: Plugins[] = [\n translationPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAG1B,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,OAIK;AAUA,MAAM,sBAAsB,CAIjC,MACA,SAAY,cAAc,qBAAqB,eAC/C,WACA,WAAoB,UACjB;AACH,QAAM,UAAqB;AAAA,IACzB,kBAAkB,QAAQ,QAAQ;AAAA,IAClC,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,SAAO,kBAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/interpreter/getContent/getLocalisedContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport type { ContentNode } from '../../types';\nimport { deepTransformNode } from './deepTransform';\nimport {\n translationPlugin,\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from './plugins';\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n * In comparison to `getContent`, this function will only apply the translation plugin.\n * It will not transform enumerations, insertions, or other content types.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getLocalisedContent = <\n T extends ContentNode,\n L extends LocalesValues = Locales,\n>(\n node: T,\n locale: L = configuration.internationalization.defaultLocale as L,\n nodeProps: NodeProps,\n fallback: boolean = false // fallback mean that if field is not translated, it will use the default locale\n) => {\n const plugins: Plugins[] = [\n translationPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAG1B,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,OAIK;AAUA,MAAM,sBAAsB,CAIjC,MACA,SAAY,cAAc,qBAAqB,eAC/C,WACA,WAAoB,UACjB;AACH,QAAM,UAAqB;AAAA,IACzB,kBAAkB,QAAQ,QAAQ;AAAA,IAClC,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,SAAO,kBAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
|
|
6
6
|
"keywords": [
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"negotiator": "^1.0.0",
|
|
78
|
-
"@intlayer/
|
|
79
|
-
"@intlayer/
|
|
80
|
-
"@intlayer/
|
|
78
|
+
"@intlayer/config": "5.5.4",
|
|
79
|
+
"@intlayer/dictionaries-entry": "5.5.4",
|
|
80
|
+
"@intlayer/api": "5.5.4"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@types/negotiator": "^0.6.3",
|
|
@@ -90,16 +90,16 @@
|
|
|
90
90
|
"tsc-alias": "^1.8.11",
|
|
91
91
|
"tsup": "^8.4.0",
|
|
92
92
|
"typescript": "^5.8.2",
|
|
93
|
-
"@utils/ts-config": "1.0.4",
|
|
94
|
-
"@utils/ts-config-types": "1.0.4",
|
|
95
93
|
"@utils/eslint-config": "1.0.4",
|
|
96
|
-
"@utils/
|
|
94
|
+
"@utils/ts-config-types": "1.0.4",
|
|
95
|
+
"@utils/tsup-config": "1.0.4",
|
|
96
|
+
"@utils/ts-config": "1.0.4"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"@intlayer/api": "5.5.
|
|
100
|
-
"@intlayer/
|
|
101
|
-
"
|
|
102
|
-
"intlayer": "5.5.
|
|
99
|
+
"@intlayer/api": "5.5.4",
|
|
100
|
+
"@intlayer/dictionaries-entry": "5.5.4",
|
|
101
|
+
"intlayer": "5.5.4",
|
|
102
|
+
"@intlayer/config": "5.5.4"
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|
|
105
105
|
"node": ">=14.18"
|