angular-intlayer 9.1.0 → 9.1.1
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/client/useDictionary.cjs.map +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
- package/dist/cjs/client/useIntlayer.cjs.map +1 -1
- package/dist/cjs/getDictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayer.cjs.map +1 -1
- package/dist/esm/client/useDictionary.mjs.map +1 -1
- package/dist/esm/client/useDictionaryDynamic.mjs.map +1 -1
- package/dist/esm/client/useIntlayer.mjs.map +1 -1
- package/dist/esm/esbuild/plugin.mjs +2 -2
- package/dist/esm/getDictionary.mjs.map +1 -1
- package/dist/esm/getIntlayer.mjs.map +1 -1
- package/dist/esm/webpack/mergeConfig.mjs +1 -1
- package/dist/types/client/useDictionary.d.ts +2 -2
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +2 -2
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useIntlayer.d.ts +2 -2
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/getDictionary.d.ts +2 -2
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts +2 -2
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.cjs","names":["INTLAYER_TOKEN","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type {\n Dictionary,\n DictionarySelector,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n
|
|
1
|
+
{"version":3,"file":"useDictionary.cjs","names":["INTLAYER_TOKEN","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type {\n Dictionary,\n DictionarySelector,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular hook that transforms a dictionary (or qualified dictionary group)\n * and returns its reactive content for the given locale or selector.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): Signal<\n DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >\n> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const isSelector =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n typeof localeOrSelector === 'object' &&\n localeOrSelector !== null;\n\n /** a *stable* reactive dictionary object */\n const content = computed(() => {\n const currentLocale = intlayer?.locale();\n\n if (isSelector) {\n return getDictionary(dictionary, {\n ...localeOrSelector,\n locale: localeOrSelector.locale ?? currentLocale,\n } as A) as any;\n }\n\n return getDictionary(\n dictionary,\n (localeOrSelector ?? currentLocale) as A\n ) as any;\n });\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;;;AAoBA,MAAa,iBAMX,YACA,qBAMG;CACH,MAAM,qCAAoCA,2CAAc;CAExD,MAAM,aACJ,QAAQ,IAAI,iCAAiC,WAC7C,OAAO,qBAAqB,YAC5B,qBAAqB;CAmBvB,yCAhB+B;EAC7B,MAAM,gBAAgB,UAAU,OAAO;EAEvC,IAAI,YACF,OAAOC,oCAAc,YAAY;GAC/B,GAAG;GACH,QAAQ,iBAAiB,UAAU;EACrC,CAAM;EAGR,OAAOA,oCACL,YACC,oBAAoB,aACvB;CACF,CAEa;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.cjs","names":["INTLAYER_TOKEN","internationalization","getDictionary","useDictionary","useLoadDynamic"],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject, signal } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport {\n isQualifiedDynamicLoaderMap,\n parseDictionarySelector,\n type QualifiedDynamicLoaderMap,\n resolveQualifiedDynamicContentAsync,\n} from '@intlayer/core/dictionaryManipulator';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DictionaryKeys,\n DictionarySelectorForKey,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * Lazily loads a dictionary (plain or qualified) and returns its reactive\n * content.\n *\n * For a qualified loader map (collection / variant, possibly\n * combined), only the chunk(s) the selector targets are loaded. For a plain\n * loader map, the locale chunk is loaded.\n *\n * If the locale is not provided (directly or through the selector), it will use\n * the locale from the client context.\n */\nexport const useDictionaryDynamic = <\n const T extends Dictionary,\n const K extends DictionaryKeys,\n const A extends
|
|
1
|
+
{"version":3,"file":"useDictionaryDynamic.cjs","names":["INTLAYER_TOKEN","internationalization","getDictionary","useDictionary","useLoadDynamic"],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject, signal } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport {\n isQualifiedDynamicLoaderMap,\n parseDictionarySelector,\n type QualifiedDynamicLoaderMap,\n resolveQualifiedDynamicContentAsync,\n} from '@intlayer/core/dictionaryManipulator';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionarySelectorForKey,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * Lazily loads a dictionary (plain or qualified) and returns its reactive\n * content.\n *\n * For a qualified loader map (collection / variant, possibly\n * combined), only the chunk(s) the selector targets are loaded. For a plain\n * loader map, the locale chunk is loaded.\n *\n * If the locale is not provided (directly or through the selector), it will use\n * the locale from the client context.\n */\nexport const useDictionaryDynamic = <\n const T extends Dictionary,\n const K extends DictionaryKeys,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForKey<K> = DeclaredLocales,\n>(\n dictionaryPromise:\n | StrictModeLocaleMap<() => Promise<T>>\n | QualifiedDynamicLoaderMap,\n key: K,\n localeOrSelector?: A\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n if (\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n isQualifiedDynamicLoaderMap(dictionaryPromise)\n ) {\n const { locale: selectorLocale, selector } =\n parseDictionarySelector<LocalesValues>(localeOrSelector);\n\n const localeTarget =\n selectorLocale ??\n intlayer?.locale() ??\n internationalization.defaultLocale;\n\n const container = signal<unknown>(undefined);\n\n resolveQualifiedDynamicContentAsync({\n loaderMap: dictionaryPromise,\n key: String(key),\n locale: localeTarget,\n selector,\n transform: (dictionary) => getDictionary(dictionary, localeTarget),\n }).then((resolved) => container.set(resolved));\n\n return computed(() => container() as any);\n }\n\n const locale =\n typeof localeOrSelector === 'string'\n ? (localeOrSelector as LocalesValues)\n : undefined;\n\n const localeTarget = computed(\n () => locale ?? intlayer?.locale() ?? internationalization.defaultLocale\n );\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget()}`,\n (dictionaryPromise as any)[localeTarget()]?.()\n ) as T;\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,wBAOX,mBAGA,KACA,qBACG;CACH,MAAM,qCAAoCA,2CAAc;CAExD,IACE,QAAQ,IAAI,iCAAiC,iFACjB,iBAAiB,GAC7C;EACA,MAAM,EAAE,QAAQ,gBAAgB,+EACS,gBAAgB;EAEzD,MAAM,eACJ,kBACA,UAAU,OAAO,KACjBC,4CAAqB;EAEvB,MAAM,sCAA4B,MAAS;EAE3C,8EAAoC;GAClC,WAAW;GACX,KAAK,OAAO,GAAG;GACf,QAAQ;GACR;GACA,YAAY,eAAeC,oCAAc,YAAY,YAAY;EACnE,CAAC,CAAC,CAAC,MAAM,aAAa,UAAU,IAAI,QAAQ,CAAC;EAE7C,yCAAsB,UAAU,CAAQ;CAC1C;CAEA,MAAM,SACJ,OAAO,qBAAqB,WACvB,mBACD;CAEN,MAAM,iDACE,UAAU,UAAU,OAAO,KAAKD,4CAAqB,aAC7D;CAOA,OAAOE,2CALYC,6CACjB,GAAG,OAAO,GAAG,EAAE,GAAG,aAAa,KAC9B,kBAA0B,aAAa,EAAE,GAAG,CAGjB,GAAG,aAAa,CAAQ;AACxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayer.cjs","names":["INTLAYER_TOKEN","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type { DictionarySelector } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n
|
|
1
|
+
{"version":3,"file":"useIntlayer.cjs","names":["INTLAYER_TOKEN","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type { DictionarySelector } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n} from '@intlayer/types/module_augmentation';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type 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\n/**\n * Angular hook that picks one dictionary by its key and returns its reactive content.\n *\n * It utilizes Angular signals to provide deep reactivity, ensuring your components\n * update automatically when the locale changes.\n *\n * @param key - The unique key of the dictionary to retrieve.\n * @param locale - Optional locale to override the current context locale.\n * @returns The transformed dictionary content.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useIntlayer } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-my-component',\n * template: `<div>{{ content().myField.value }}</div>`,\n * })\n * export class MyComponent {\n * content = useIntlayer('my-dictionary-key');\n * }\n * ```\n */\nexport const useIntlayer = <\n const T extends DictionaryKeys,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForKey<T> = DeclaredLocales,\n>(\n key: T,\n localeOrSelector?: A\n): Signal<\n DeepTransformContent<DictionaryRegistryResult<T, A>, ExtractSelectorLocale<A>>\n> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN)!;\n\n const isSelector =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n typeof localeOrSelector === 'object' &&\n localeOrSelector !== null;\n\n /** a *stable* reactive dictionary object */\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n const content = computed(() => {\n const currentLocale = intlayer.locale();\n\n if (isSelector) {\n return getIntlayer(key, {\n ...localeOrSelector,\n locale: localeOrSelector.locale ?? currentLocale,\n } as A) as any;\n }\n\n return getIntlayer(key, (localeOrSelector ?? currentLocale) as A) as any;\n });\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;AAcA,MAAa,mBACX,QAEA,CAAC,CAAC,OACF,OAAO,QAAQ,YACf,OAAQ,IAAY,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BnC,MAAa,eAMX,KACA,qBAGG;CACH,MAAM,qCAAoCA,2CAAc;CAExD,MAAM,aACJ,QAAQ,IAAI,iCAAiC,WAC7C,OAAO,qBAAqB,YAC5B,qBAAqB;CAiBvB,yCAb+B;EAC7B,MAAM,gBAAgB,SAAS,OAAO;EAEtC,IAAI,YACF,OAAOC,gCAAY,KAAK;GACtB,GAAG;GACH,QAAQ,iBAAiB,UAAU;EACrC,CAAM;EAGR,OAAOA,gCAAY,KAAM,oBAAoB,aAAmB;CAClE,CAEa;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionary.cjs","names":["getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n |
|
|
1
|
+
{"version":3,"file":"getDictionary.cjs","names":["getPlugins"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,iBAMX,YACA,qBAIG;CAOH,qDACE,YACA,kBACAA,2BARA,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB,gBAMa,CACnB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIntlayer.cjs","names":["getPlugins"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Picks one dictionary by its key and returns its content for the given\n * locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getIntlayer = <\n const T extends DictionaryKeys,\n const A extends
|
|
1
|
+
{"version":3,"file":"getIntlayer.cjs","names":["getPlugins"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Picks one dictionary by its key and returns its content for the given\n * locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getIntlayer = <\n const T extends DictionaryKeys,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForKey<T> = DeclaredLocales,\n>(\n key: T,\n localeOrSelector?: A\n): DeepTransformContent<\n DictionaryRegistryResult<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getIntlayerCore(key, localeOrSelector, getPlugins(locale)) as any;\n};\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,eAMX,KACA,qBAIG;CAOH,mDAAuB,KAAK,kBAAkBA,2BAL5C,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB,gBAGyD,CAAC;AAClE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type {\n Dictionary,\n DictionarySelector,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n
|
|
1
|
+
{"version":3,"file":"useDictionary.mjs","names":[],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type {\n Dictionary,\n DictionarySelector,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular hook that transforms a dictionary (or qualified dictionary group)\n * and returns its reactive content for the given locale or selector.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): Signal<\n DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n >\n> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const isSelector =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n typeof localeOrSelector === 'object' &&\n localeOrSelector !== null;\n\n /** a *stable* reactive dictionary object */\n const content = computed(() => {\n const currentLocale = intlayer?.locale();\n\n if (isSelector) {\n return getDictionary(dictionary, {\n ...localeOrSelector,\n locale: localeOrSelector.locale ?? currentLocale,\n } as A) as any;\n }\n\n return getDictionary(\n dictionary,\n (localeOrSelector ?? currentLocale) as A\n ) as any;\n });\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;;AAoBA,MAAa,iBAMX,YACA,qBAMG;CACH,MAAM,WAAW,OAAyB,cAAc;CAExD,MAAM,aACJ,QAAQ,IAAI,iCAAiC,WAC7C,OAAO,qBAAqB,YAC5B,qBAAqB;CAmBvB,OAhBgB,eAAe;EAC7B,MAAM,gBAAgB,UAAU,OAAO;EAEvC,IAAI,YACF,OAAO,cAAc,YAAY;GAC/B,GAAG;GACH,QAAQ,iBAAiB,UAAU;EACrC,CAAM;EAGR,OAAO,cACL,YACC,oBAAoB,aACvB;CACF,CAEa;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.mjs","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject, signal } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport {\n isQualifiedDynamicLoaderMap,\n parseDictionarySelector,\n type QualifiedDynamicLoaderMap,\n resolveQualifiedDynamicContentAsync,\n} from '@intlayer/core/dictionaryManipulator';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DictionaryKeys,\n DictionarySelectorForKey,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * Lazily loads a dictionary (plain or qualified) and returns its reactive\n * content.\n *\n * For a qualified loader map (collection / variant, possibly\n * combined), only the chunk(s) the selector targets are loaded. For a plain\n * loader map, the locale chunk is loaded.\n *\n * If the locale is not provided (directly or through the selector), it will use\n * the locale from the client context.\n */\nexport const useDictionaryDynamic = <\n const T extends Dictionary,\n const K extends DictionaryKeys,\n const A extends
|
|
1
|
+
{"version":3,"file":"useDictionaryDynamic.mjs","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject, signal } from '@angular/core';\nimport { internationalization } from '@intlayer/config/built';\nimport {\n isQualifiedDynamicLoaderMap,\n parseDictionarySelector,\n type QualifiedDynamicLoaderMap,\n resolveQualifiedDynamicContentAsync,\n} from '@intlayer/core/dictionaryManipulator';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionarySelectorForKey,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { getDictionary } from '../getDictionary';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * Lazily loads a dictionary (plain or qualified) and returns its reactive\n * content.\n *\n * For a qualified loader map (collection / variant, possibly\n * combined), only the chunk(s) the selector targets are loaded. For a plain\n * loader map, the locale chunk is loaded.\n *\n * If the locale is not provided (directly or through the selector), it will use\n * the locale from the client context.\n */\nexport const useDictionaryDynamic = <\n const T extends Dictionary,\n const K extends DictionaryKeys,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForKey<K> = DeclaredLocales,\n>(\n dictionaryPromise:\n | StrictModeLocaleMap<() => Promise<T>>\n | QualifiedDynamicLoaderMap,\n key: K,\n localeOrSelector?: A\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n if (\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n isQualifiedDynamicLoaderMap(dictionaryPromise)\n ) {\n const { locale: selectorLocale, selector } =\n parseDictionarySelector<LocalesValues>(localeOrSelector);\n\n const localeTarget =\n selectorLocale ??\n intlayer?.locale() ??\n internationalization.defaultLocale;\n\n const container = signal<unknown>(undefined);\n\n resolveQualifiedDynamicContentAsync({\n loaderMap: dictionaryPromise,\n key: String(key),\n locale: localeTarget,\n selector,\n transform: (dictionary) => getDictionary(dictionary, localeTarget),\n }).then((resolved) => container.set(resolved));\n\n return computed(() => container() as any);\n }\n\n const locale =\n typeof localeOrSelector === 'string'\n ? (localeOrSelector as LocalesValues)\n : undefined;\n\n const localeTarget = computed(\n () => locale ?? intlayer?.locale() ?? internationalization.defaultLocale\n );\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget()}`,\n (dictionaryPromise as any)[localeTarget()]?.()\n ) as T;\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,wBAOX,mBAGA,KACA,qBACG;CACH,MAAM,WAAW,OAAyB,cAAc;CAExD,IACE,QAAQ,IAAI,iCAAiC,WAC7C,4BAA4B,iBAAiB,GAC7C;EACA,MAAM,EAAE,QAAQ,gBAAgB,aAC9B,wBAAuC,gBAAgB;EAEzD,MAAM,eACJ,kBACA,UAAU,OAAO,KACjB,qBAAqB;EAEvB,MAAM,YAAY,OAAgB,MAAS;EAE3C,oCAAoC;GAClC,WAAW;GACX,KAAK,OAAO,GAAG;GACf,QAAQ;GACR;GACA,YAAY,eAAe,cAAc,YAAY,YAAY;EACnE,CAAC,CAAC,CAAC,MAAM,aAAa,UAAU,IAAI,QAAQ,CAAC;EAE7C,OAAO,eAAe,UAAU,CAAQ;CAC1C;CAEA,MAAM,SACJ,OAAO,qBAAqB,WACvB,mBACD;CAEN,MAAM,eAAe,eACb,UAAU,UAAU,OAAO,KAAK,qBAAqB,aAC7D;CAOA,OAAO,cALY,eACjB,GAAG,OAAO,GAAG,EAAE,GAAG,aAAa,KAC9B,kBAA0B,aAAa,EAAE,GAAG,CAGjB,GAAG,aAAa,CAAQ;AACxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayer.mjs","names":[],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type { DictionarySelector } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n
|
|
1
|
+
{"version":3,"file":"useIntlayer.mjs","names":[],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type { DictionarySelector } from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n} from '@intlayer/types/module_augmentation';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type 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\n/**\n * Angular hook that picks one dictionary by its key and returns its reactive content.\n *\n * It utilizes Angular signals to provide deep reactivity, ensuring your components\n * update automatically when the locale changes.\n *\n * @param key - The unique key of the dictionary to retrieve.\n * @param locale - Optional locale to override the current context locale.\n * @returns The transformed dictionary content.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useIntlayer } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-my-component',\n * template: `<div>{{ content().myField.value }}</div>`,\n * })\n * export class MyComponent {\n * content = useIntlayer('my-dictionary-key');\n * }\n * ```\n */\nexport const useIntlayer = <\n const T extends DictionaryKeys,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForKey<T> = DeclaredLocales,\n>(\n key: T,\n localeOrSelector?: A\n): Signal<\n DeepTransformContent<DictionaryRegistryResult<T, A>, ExtractSelectorLocale<A>>\n> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN)!;\n\n const isSelector =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n typeof localeOrSelector === 'object' &&\n localeOrSelector !== null;\n\n /** a *stable* reactive dictionary object */\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n const content = computed(() => {\n const currentLocale = intlayer.locale();\n\n if (isSelector) {\n return getIntlayer(key, {\n ...localeOrSelector,\n locale: localeOrSelector.locale ?? currentLocale,\n } as A) as any;\n }\n\n return getIntlayer(key, (localeOrSelector ?? currentLocale) as A) as any;\n });\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;AAcA,MAAa,mBACX,QAEA,CAAC,CAAC,OACF,OAAO,QAAQ,YACf,OAAQ,IAAY,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BnC,MAAa,eAMX,KACA,qBAGG;CACH,MAAM,WAAW,OAAyB,cAAc;CAExD,MAAM,aACJ,QAAQ,IAAI,iCAAiC,WAC7C,OAAO,qBAAqB,YAC5B,qBAAqB;CAiBvB,OAbgB,eAAe;EAC7B,MAAM,gBAAgB,SAAS,OAAO;EAEtC,IAAI,YACF,OAAO,YAAY,KAAK;GACtB,GAAG;GACH,QAAQ,iBAAiB,UAAU;EACrC,CAAM;EAGR,OAAO,YAAY,KAAM,oBAAoB,aAAmB;CAClE,CAEa;AACf"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { getConfiguration } from "@intlayer/config/node";
|
|
3
|
-
import { getAlias, getHasDictionarySelector, getUnusedNodeTypesAsync } from "@intlayer/config/utils";
|
|
4
2
|
import { formatDictionarySelectorEnvVar, formatNodeTypeToEnvVar, getConfigEnvVars } from "@intlayer/config/envVars";
|
|
5
3
|
import { getAppLogger } from "@intlayer/config/logger";
|
|
4
|
+
import { getConfiguration } from "@intlayer/config/node";
|
|
5
|
+
import { getAlias, getHasDictionarySelector, getUnusedNodeTypesAsync } from "@intlayer/config/utils";
|
|
6
6
|
import { getDictionaries } from "@intlayer/dictionaries-entry";
|
|
7
7
|
import { prepareIntlayer } from "@intlayer/engine/build";
|
|
8
8
|
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionary.mjs","names":["getDictionaryCore"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n |
|
|
1
|
+
{"version":3,"file":"getDictionary.mjs","names":["getDictionaryCore"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import { getDictionary as getDictionaryCore } from '@intlayer/core/interpreter';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n ResolveQualifiedDictionaryContent,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Transforms a dictionary (or qualified dictionary group) and returns its\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForGroup<T> = DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n): DeepTransformContent<\n ResolveQualifiedDictionaryContent<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getDictionaryCore(\n dictionary,\n localeOrSelector,\n getPlugins(locale)\n ) as any;\n};\n"],"mappings":";;;;;;;;;AAmBA,MAAa,iBAMX,YACA,qBAIG;CAOH,OAAOA,gBACL,YACA,kBACA,WARA,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB,gBAMa,CACnB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIntlayer.mjs","names":["getIntlayerCore"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Picks one dictionary by its key and returns its content for the given\n * locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getIntlayer = <\n const T extends DictionaryKeys,\n const A extends
|
|
1
|
+
{"version":3,"file":"getIntlayer.mjs","names":["getIntlayerCore"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryResult,\n DictionarySelectorForKey,\n ExtractSelectorLocale,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Picks one dictionary by its key and returns its content for the given\n * locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getIntlayer = <\n const T extends DictionaryKeys,\n const A extends\n | DeclaredLocales\n | DictionarySelectorForKey<T> = DeclaredLocales,\n>(\n key: T,\n localeOrSelector?: A\n): DeepTransformContent<\n DictionaryRegistryResult<T, A>,\n ExtractSelectorLocale<A>\n> => {\n const locale = (\n typeof localeOrSelector === 'object' && localeOrSelector !== null\n ? localeOrSelector.locale\n : localeOrSelector\n ) as LocalesValues | undefined;\n\n return getIntlayerCore(key, localeOrSelector, getPlugins(locale)) as any;\n};\n"],"mappings":";;;;;;;;;AAgBA,MAAa,eAMX,KACA,qBAIG;CAOH,OAAOA,cAAgB,KAAK,kBAAkB,WAL5C,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB,gBAGyD,CAAC;AAClE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __require } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
2
|
import { resolve } from "node:path";
|
|
4
3
|
import { getConfiguration } from "@intlayer/config/node";
|
|
5
4
|
import { getAlias } from "@intlayer/config/utils";
|
|
5
|
+
import { createRequire } from "node:module";
|
|
6
6
|
import { IntlayerPlugin } from "@intlayer/webpack";
|
|
7
7
|
import { defu } from "defu";
|
|
8
8
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { DeepTransformContent } from "../plugins.js";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
|
-
import { DeclaredLocales, ExtractSelectorLocale
|
|
3
|
+
import { DeclaredLocales, ExtractSelectorLocale } from "@intlayer/types/module_augmentation";
|
|
4
4
|
import { Dictionary, DictionarySelectorForGroup, QualifiedDictionaryGroup, ResolveQualifiedDictionaryContent } from "@intlayer/types/dictionary";
|
|
5
5
|
//#region src/client/useDictionary.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Angular hook that transforms a dictionary (or qualified dictionary group)
|
|
8
8
|
* and returns its reactive content for the given locale or selector.
|
|
9
9
|
*/
|
|
10
|
-
declare const useDictionary: <const T extends Dictionary | QualifiedDictionaryGroup, const A extends
|
|
10
|
+
declare const useDictionary: <const T extends Dictionary | QualifiedDictionaryGroup, const A extends DeclaredLocales | DictionarySelectorForGroup<T> = DeclaredLocales>(dictionary: T, localeOrSelector?: A) => Signal<DeepTransformContent<ResolveQualifiedDictionaryContent<T, A>, ExtractSelectorLocale<A>>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useDictionary };
|
|
13
13
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../../src/client/useDictionary.ts"],"mappings":";;;;;;;;;cAoBa,sBACL,UAAU,aAAa,gCACvB,UACF,kBACA,2BAA2B,KAAK,iBAAe,YAEvC,GAAC,mBACM,MAClB,OACD,qBACE,kCAAkC,GAAG,IACrC,sBAAsB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DictionaryKeys, DictionarySelectorForKey,
|
|
1
|
+
import { DeclaredLocales, DictionaryKeys, DictionarySelectorForKey, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
2
2
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
3
|
import { QualifiedDynamicLoaderMap } from "@intlayer/core/dictionaryManipulator";
|
|
4
4
|
//#region src/client/useDictionaryDynamic.d.ts
|
|
@@ -13,7 +13,7 @@ import { QualifiedDynamicLoaderMap } from "@intlayer/core/dictionaryManipulator"
|
|
|
13
13
|
* If the locale is not provided (directly or through the selector), it will use
|
|
14
14
|
* the locale from the client context.
|
|
15
15
|
*/
|
|
16
|
-
declare const useDictionaryDynamic: <const T extends Dictionary, const K extends DictionaryKeys, const A extends
|
|
16
|
+
declare const useDictionaryDynamic: <const T extends Dictionary, const K extends DictionaryKeys, const A extends DeclaredLocales | DictionarySelectorForKey<K> = DeclaredLocales>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>> | QualifiedDynamicLoaderMap, key: K, localeOrSelector?: A) => import("@angular/core").Signal<any>;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { useDictionaryDynamic };
|
|
19
19
|
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;;;;;;;cAkCa,6BACL,UAAU,kBACV,UAAU,sBACV,UACF,kBACA,yBAAyB,KAAK,iBAAe,mBAG7C,0BAA0B,QAAQ,MAClC,2BAAyB,KACxB,GAAC,mBACa,8BAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeepTransformContent } from "../plugins.js";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
|
-
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, DictionarySelectorForKey, ExtractSelectorLocale
|
|
3
|
+
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, DictionarySelectorForKey, ExtractSelectorLocale } from "@intlayer/types/module_augmentation";
|
|
4
4
|
//#region src/client/useIntlayer.d.ts
|
|
5
5
|
/** guard utility - true only for objects generated by `renderIntlayerNode()` */
|
|
6
6
|
declare const isUpdatableNode: (val: unknown) => val is {
|
|
@@ -31,7 +31,7 @@ declare const isUpdatableNode: (val: unknown) => val is {
|
|
|
31
31
|
* }
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
declare const useIntlayer: <const T extends DictionaryKeys, const A extends
|
|
34
|
+
declare const useIntlayer: <const T extends DictionaryKeys, const A extends DeclaredLocales | DictionarySelectorForKey<T> = DeclaredLocales>(key: T, localeOrSelector?: A) => Signal<DeepTransformContent<DictionaryRegistryResult<T, A>, ExtractSelectorLocale<A>>>;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { isUpdatableNode, useIntlayer };
|
|
37
37
|
//# sourceMappingURL=useIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../../src/client/useIntlayer.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../../src/client/useIntlayer.ts"],"mappings":";;;;;cAca,kBAAe,iBAEzB;EAAS,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8BV,oBACL,UAAU,sBACV,UACF,kBACA,yBAAyB,KAAK,iBAAe,KAE5C,GAAC,mBACa,MAClB,OACD,qBAAqB,yBAAyB,GAAG,IAAI,sBAAsB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepTransformContent } from "./plugins.js";
|
|
2
|
-
import { DeclaredLocales, ExtractSelectorLocale
|
|
2
|
+
import { DeclaredLocales, ExtractSelectorLocale } from "@intlayer/types/module_augmentation";
|
|
3
3
|
import { Dictionary, DictionarySelectorForGroup, QualifiedDictionaryGroup, ResolveQualifiedDictionaryContent } from "@intlayer/types/dictionary";
|
|
4
4
|
//#region src/getDictionary.d.ts
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import { Dictionary, DictionarySelectorForGroup, QualifiedDictionaryGroup, Resol
|
|
|
7
7
|
* content for the given locale or selector (`{ item }`, `{ variant }`,
|
|
8
8
|
* optionally combined with `locale`).
|
|
9
9
|
*/
|
|
10
|
-
declare const getDictionary: <const T extends Dictionary | QualifiedDictionaryGroup, const A extends
|
|
10
|
+
declare const getDictionary: <const T extends Dictionary | QualifiedDictionaryGroup, const A extends DeclaredLocales | DictionarySelectorForGroup<T> = DeclaredLocales>(dictionary: T, localeOrSelector?: A) => DeepTransformContent<ResolveQualifiedDictionaryContent<T, A>, ExtractSelectorLocale<A>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { getDictionary };
|
|
13
13
|
//# sourceMappingURL=getDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"mappings":";;;;;;;;;cAmBa,sBACL,UAAU,aAAa,gCACvB,UACF,
|
|
1
|
+
{"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"mappings":";;;;;;;;;cAmBa,sBACL,UAAU,aAAa,gCACvB,UACF,kBACA,2BAA2B,KAAK,iBAAe,YAEvC,GAAC,mBACM,MAClB,qBACD,kCAAkC,GAAG,IACrC,sBAAsB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DeepTransformContent } from "./plugins.js";
|
|
2
|
-
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, DictionarySelectorForKey, ExtractSelectorLocale
|
|
2
|
+
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, DictionarySelectorForKey, ExtractSelectorLocale } from "@intlayer/types/module_augmentation";
|
|
3
3
|
//#region src/getIntlayer.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Picks one dictionary by its key and returns its content for the given
|
|
6
6
|
* locale or selector (`{ item }`, `{ variant }`,
|
|
7
7
|
* optionally combined with `locale`).
|
|
8
8
|
*/
|
|
9
|
-
declare const getIntlayer: <const T extends DictionaryKeys, const A extends
|
|
9
|
+
declare const getIntlayer: <const T extends DictionaryKeys, const A extends DeclaredLocales | DictionarySelectorForKey<T> = DeclaredLocales>(key: T, localeOrSelector?: A) => DeepTransformContent<DictionaryRegistryResult<T, A>, ExtractSelectorLocale<A>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { getIntlayer };
|
|
12
12
|
//# sourceMappingURL=getIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIntlayer.d.ts","names":[],"sources":["../../src/getIntlayer.ts"],"mappings":";;;;;;;;cAgBa,oBACL,UAAU,sBACV,
|
|
1
|
+
{"version":3,"file":"getIntlayer.d.ts","names":[],"sources":["../../src/getIntlayer.ts"],"mappings":";;;;;;;;cAgBa,oBACL,UAAU,sBACV,UACF,kBACA,yBAAyB,KAAK,iBAAe,KAE5C,GAAC,mBACa,MAClB,qBACD,yBAAyB,GAAG,IAC5B,sBAAsB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-intlayer",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Angular applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -119,13 +119,13 @@
|
|
|
119
119
|
"@babel/core": "^7.26.9",
|
|
120
120
|
"@babel/plugin-syntax-import-attributes": "7.28.6",
|
|
121
121
|
"@babel/preset-env": "7.29.2",
|
|
122
|
-
"@intlayer/config": "9.1.
|
|
123
|
-
"@intlayer/core": "9.1.
|
|
124
|
-
"@intlayer/dictionaries-entry": "9.1.
|
|
125
|
-
"@intlayer/editor": "9.1.
|
|
126
|
-
"@intlayer/engine": "9.1.
|
|
127
|
-
"@intlayer/types": "9.1.
|
|
128
|
-
"@intlayer/webpack": "9.1.
|
|
122
|
+
"@intlayer/config": "9.1.1",
|
|
123
|
+
"@intlayer/core": "9.1.1",
|
|
124
|
+
"@intlayer/dictionaries-entry": "9.1.1",
|
|
125
|
+
"@intlayer/editor": "9.1.1",
|
|
126
|
+
"@intlayer/engine": "9.1.1",
|
|
127
|
+
"@intlayer/types": "9.1.1",
|
|
128
|
+
"@intlayer/webpack": "9.1.1",
|
|
129
129
|
"babel-loader": "10.1.1",
|
|
130
130
|
"defu": "6.1.7"
|
|
131
131
|
},
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
"optionalDependencies": {
|
|
158
|
-
"@intlayer/analytics": "9.1.
|
|
158
|
+
"@intlayer/analytics": "9.1.1"
|
|
159
159
|
},
|
|
160
160
|
"engines": {
|
|
161
161
|
"node": ">=14.18"
|