angular-intlayer 5.8.0-canary.0 → 5.8.1-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport { DictionaryKeys } from '@intlayer/core';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\nimport { getIntlayer } from '../getIntlayer';\nimport { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, IntlayerProvider } from './installIntlayer';\n\n/** guard utility
|
|
1
|
+
{"version":3,"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport { DictionaryKeys } from '@intlayer/core';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\nimport { getIntlayer } from '../getIntlayer';\nimport { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, IntlayerProvider } from './installIntlayer';\n\n/** guard utility - true only for objects generated by `renderIntlayerNode()` */\nexport const isUpdatableNode = (\n val: unknown\n): val is { __update: (n: unknown) => void } =>\n !!val &&\n typeof val === 'object' &&\n typeof (val as any).__update === 'function';\n\nexport const useIntlayer = <T extends DictionaryKeys>(\n key: T,\n locale?: LocalesValues\n): DeepTransformContent<IntlayerDictionaryTypesConnector[T]['content']> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN)!;\n\n /** which locale should we use right now? */\n const localeTarget = computed(() => locale ?? intlayer.locale());\n\n /** a *stable* reactive dictionary object */\n const content = computed(() => getIntlayer(key, localeTarget()));\n\n return content() as DeepTransformContent<\n IntlayerDictionaryTypesConnector[T]['content']\n >; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAKjC,yBAA4B;AAE5B,6BAAiD;AAG1C,MAAM,kBAAkB,CAC7B,QAEA,CAAC,CAAC,OACF,OAAO,QAAQ,YACf,OAAQ,IAAY,aAAa;AAE5B,MAAM,cAAc,CACzB,KACA,WACyE;AACzE,QAAM,eAAW,oBAAyB,qCAAc;AAGxD,QAAM,mBAAe,sBAAS,MAAM,UAAU,SAAS,OAAO,CAAC;AAG/D,QAAM,cAAU,sBAAS,UAAM,gCAAY,KAAK,aAAa,CAAC,CAAC;AAE/D,SAAO,QAAQ;AAGjB;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport { DictionaryKeys } from '@intlayer/core';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\nimport { getIntlayer } from '../getIntlayer';\nimport { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, IntlayerProvider } from './installIntlayer';\n\n/** guard utility
|
|
1
|
+
{"version":3,"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport type { LocalesValues } from '@intlayer/config/client';\nimport { DictionaryKeys } from '@intlayer/core';\n// @ts-ignore intlayer declared for module augmentation\nimport type { IntlayerDictionaryTypesConnector } from 'intlayer';\nimport { getIntlayer } from '../getIntlayer';\nimport { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, IntlayerProvider } from './installIntlayer';\n\n/** guard utility - true only for objects generated by `renderIntlayerNode()` */\nexport const isUpdatableNode = (\n val: unknown\n): val is { __update: (n: unknown) => void } =>\n !!val &&\n typeof val === 'object' &&\n typeof (val as any).__update === 'function';\n\nexport const useIntlayer = <T extends DictionaryKeys>(\n key: T,\n locale?: LocalesValues\n): DeepTransformContent<IntlayerDictionaryTypesConnector[T]['content']> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN)!;\n\n /** which locale should we use right now? */\n const localeTarget = computed(() => locale ?? intlayer.locale());\n\n /** a *stable* reactive dictionary object */\n const content = computed(() => getIntlayer(key, localeTarget()));\n\n return content() as DeepTransformContent<\n IntlayerDictionaryTypesConnector[T]['content']\n >; // all consumers keep full reactivity\n};\n"],"mappings":"AAAA,SAAS,UAAU,cAAc;AAKjC,SAAS,mBAAmB;AAE5B,SAAS,sBAAwC;AAG1C,MAAM,kBAAkB,CAC7B,QAEA,CAAC,CAAC,OACF,OAAO,QAAQ,YACf,OAAQ,IAAY,aAAa;AAE5B,MAAM,cAAc,CACzB,KACA,WACyE;AACzE,QAAM,WAAW,OAAyB,cAAc;AAGxD,QAAM,eAAe,SAAS,MAAM,UAAU,SAAS,OAAO,CAAC;AAG/D,QAAM,UAAU,SAAS,MAAM,YAAY,KAAK,aAAa,CAAC,CAAC;AAE/D,SAAO,QAAQ;AAGjB;","names":[]}
|
|
@@ -2,7 +2,7 @@ import type { LocalesValues } from '@intlayer/config/client';
|
|
|
2
2
|
import { DictionaryKeys } from '@intlayer/core';
|
|
3
3
|
import type { IntlayerDictionaryTypesConnector } from 'intlayer';
|
|
4
4
|
import { DeepTransformContent } from '../plugins';
|
|
5
|
-
/** guard utility
|
|
5
|
+
/** guard utility - true only for objects generated by `renderIntlayerNode()` */
|
|
6
6
|
export declare const isUpdatableNode: (val: unknown) => val is {
|
|
7
7
|
__update: (n: unknown) => void;
|
|
8
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-intlayer",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.1-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Angular applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"deepmerge": "^4.3.1",
|
|
65
65
|
"js-cookie": "^3.0.5",
|
|
66
66
|
"uuid": "^11.1.0",
|
|
67
|
-
"@intlayer/
|
|
68
|
-
"@intlayer/
|
|
69
|
-
"@intlayer/
|
|
70
|
-
"@intlayer/
|
|
71
|
-
"@intlayer/editor": "5.8.
|
|
72
|
-
"@intlayer/webpack": "5.8.
|
|
67
|
+
"@intlayer/core": "5.8.1-canary.0",
|
|
68
|
+
"@intlayer/chokidar": "5.8.1-canary.0",
|
|
69
|
+
"@intlayer/dictionaries-entry": "5.8.1-canary.0",
|
|
70
|
+
"@intlayer/config": "5.8.1-canary.0",
|
|
71
|
+
"@intlayer/editor": "5.8.1-canary.0",
|
|
72
|
+
"@intlayer/webpack": "5.8.1-canary.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/node": "^24.2.1",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"tsup": "^8.5.0",
|
|
84
84
|
"typescript": "^5.9.2",
|
|
85
85
|
"vitest": "^3.2.2",
|
|
86
|
-
"@utils/ts-config": "1.0.4",
|
|
87
86
|
"@utils/eslint-config": "1.0.4",
|
|
87
|
+
"@utils/ts-config": "1.0.4",
|
|
88
88
|
"@utils/ts-config-types": "1.0.4",
|
|
89
89
|
"@utils/tsup-config": "1.0.4"
|
|
90
90
|
},
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
93
93
|
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
94
94
|
"rxjs": "^6.0.0 || ^7.0.0",
|
|
95
|
-
"@intlayer/chokidar": "5.8.
|
|
96
|
-
"@intlayer/config": "5.8.
|
|
97
|
-
"@intlayer/core": "5.8.
|
|
98
|
-
"@intlayer/dictionaries-entry": "5.8.
|
|
95
|
+
"@intlayer/chokidar": "5.8.1-canary.0",
|
|
96
|
+
"@intlayer/config": "5.8.1-canary.0",
|
|
97
|
+
"@intlayer/core": "5.8.1-canary.0",
|
|
98
|
+
"@intlayer/dictionaries-entry": "5.8.1-canary.0"
|
|
99
99
|
},
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": ">=14.18"
|