@intlayer/next-intl 9.0.0-canary.2 → 9.0.0-canary.3
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/NextIntlClientProvider.cjs +1 -1
- package/dist/cjs/client/index.cjs +56 -13
- package/dist/cjs/index.cjs +92 -15
- package/dist/cjs/navigation/Link.cjs +1 -1
- package/dist/cjs/server/getRequestConfig.cjs +28 -0
- package/dist/cjs/server/getRequestConfig.cjs.map +1 -0
- package/dist/cjs/server/getTranslations.cjs +9 -4
- package/dist/cjs/server/getTranslations.cjs.map +1 -1
- package/dist/cjs/server/helpers.cjs +5 -3
- package/dist/cjs/server/helpers.cjs.map +1 -1
- package/dist/cjs/server/index.cjs +5 -1
- package/dist/cjs/server/setRequestLocale.cjs +30 -0
- package/dist/cjs/server/setRequestLocale.cjs.map +1 -0
- package/dist/esm/client/NextIntlClientProvider.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -4
- package/dist/esm/index.mjs +3 -6
- package/dist/esm/navigation/Link.mjs +1 -1
- package/dist/esm/server/getRequestConfig.mjs +25 -0
- package/dist/esm/server/getRequestConfig.mjs.map +1 -0
- package/dist/esm/server/getTranslations.mjs +8 -4
- package/dist/esm/server/getTranslations.mjs.map +1 -1
- package/dist/esm/server/helpers.mjs +4 -3
- package/dist/esm/server/helpers.mjs.map +1 -1
- package/dist/esm/server/index.mjs +3 -1
- package/dist/esm/server/setRequestLocale.mjs +28 -0
- package/dist/esm/server/setRequestLocale.mjs.map +1 -0
- package/dist/types/client/index.d.ts +1 -4
- package/dist/types/index.d.ts +3 -6
- package/dist/types/server/getRequestConfig.d.ts +19 -0
- package/dist/types/server/getRequestConfig.d.ts.map +1 -0
- package/dist/types/server/getTranslations.d.ts +7 -29
- package/dist/types/server/getTranslations.d.ts.map +1 -1
- package/dist/types/server/helpers.d.ts +2 -1
- package/dist/types/server/helpers.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +3 -1
- package/dist/types/server/setRequestLocale.d.ts +23 -0
- package/dist/types/server/setRequestLocale.d.ts.map +1 -0
- package/package.json +9 -8
- package/dist/cjs/client/helpers.cjs +0 -66
- package/dist/cjs/client/helpers.cjs.map +0 -1
- package/dist/cjs/client/useTranslations.cjs +0 -39
- package/dist/cjs/client/useTranslations.cjs.map +0 -1
- package/dist/cjs/createFormatter.cjs +0 -59
- package/dist/cjs/createFormatter.cjs.map +0 -1
- package/dist/cjs/createTranslator.cjs +0 -111
- package/dist/cjs/createTranslator.cjs.map +0 -1
- package/dist/cjs/getTranslationsDictionary.cjs +0 -31
- package/dist/cjs/getTranslationsDictionary.cjs.map +0 -1
- package/dist/cjs/getTranslationsDictionaryDynamic.cjs +0 -27
- package/dist/cjs/getTranslationsDictionaryDynamic.cjs.map +0 -1
- package/dist/cjs/hasLocale.cjs +0 -25
- package/dist/cjs/hasLocale.cjs.map +0 -1
- package/dist/cjs/package.cjs +0 -122
- package/dist/cjs/package.cjs.map +0 -1
- package/dist/cjs/useDictionary.cjs +0 -45
- package/dist/cjs/useDictionary.cjs.map +0 -1
- package/dist/cjs/useDictionaryDynamic.cjs +0 -37
- package/dist/cjs/useDictionaryDynamic.cjs.map +0 -1
- package/dist/cjs/useTranslationsDictionary.cjs +0 -37
- package/dist/cjs/useTranslationsDictionary.cjs.map +0 -1
- package/dist/cjs/useTranslationsDictionaryDynamic.cjs +0 -29
- package/dist/cjs/useTranslationsDictionaryDynamic.cjs.map +0 -1
- package/dist/esm/_virtual/_rolldown/runtime.mjs +0 -8
- package/dist/esm/client/helpers.mjs +0 -59
- package/dist/esm/client/helpers.mjs.map +0 -1
- package/dist/esm/client/useTranslations.mjs +0 -37
- package/dist/esm/client/useTranslations.mjs.map +0 -1
- package/dist/esm/createFormatter.mjs +0 -57
- package/dist/esm/createFormatter.mjs.map +0 -1
- package/dist/esm/createTranslator.mjs +0 -108
- package/dist/esm/createTranslator.mjs.map +0 -1
- package/dist/esm/getTranslationsDictionary.mjs +0 -29
- package/dist/esm/getTranslationsDictionary.mjs.map +0 -1
- package/dist/esm/getTranslationsDictionaryDynamic.mjs +0 -25
- package/dist/esm/getTranslationsDictionaryDynamic.mjs.map +0 -1
- package/dist/esm/hasLocale.mjs +0 -23
- package/dist/esm/hasLocale.mjs.map +0 -1
- package/dist/esm/package.mjs +0 -119
- package/dist/esm/package.mjs.map +0 -1
- package/dist/esm/useDictionary.mjs +0 -43
- package/dist/esm/useDictionary.mjs.map +0 -1
- package/dist/esm/useDictionaryDynamic.mjs +0 -35
- package/dist/esm/useDictionaryDynamic.mjs.map +0 -1
- package/dist/esm/useTranslationsDictionary.mjs +0 -35
- package/dist/esm/useTranslationsDictionary.mjs.map +0 -1
- package/dist/esm/useTranslationsDictionaryDynamic.mjs +0 -27
- package/dist/esm/useTranslationsDictionaryDynamic.mjs.map +0 -1
- package/dist/types/client/helpers.d.ts +0 -45
- package/dist/types/client/helpers.d.ts.map +0 -1
- package/dist/types/client/useTranslations.d.ts +0 -74
- package/dist/types/client/useTranslations.d.ts.map +0 -1
- package/dist/types/createFormatter.d.ts +0 -15
- package/dist/types/createFormatter.d.ts.map +0 -1
- package/dist/types/createTranslator.d.ts +0 -40
- package/dist/types/createTranslator.d.ts.map +0 -1
- package/dist/types/getTranslationsDictionary.d.ts +0 -15
- package/dist/types/getTranslationsDictionary.d.ts.map +0 -1
- package/dist/types/getTranslationsDictionaryDynamic.d.ts +0 -12
- package/dist/types/getTranslationsDictionaryDynamic.d.ts.map +0 -1
- package/dist/types/hasLocale.d.ts +0 -20
- package/dist/types/hasLocale.d.ts.map +0 -1
- package/dist/types/useDictionary.d.ts +0 -22
- package/dist/types/useDictionary.d.ts.map +0 -1
- package/dist/types/useDictionaryDynamic.d.ts +0 -15
- package/dist/types/useDictionaryDynamic.d.ts.map +0 -1
- package/dist/types/useTranslationsDictionary.d.ts +0 -19
- package/dist/types/useTranslationsDictionary.d.ts.map +0 -1
- package/dist/types/useTranslationsDictionaryDynamic.d.ts +0 -12
- package/dist/types/useTranslationsDictionaryDynamic.d.ts.map +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
2
|
-
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
3
|
-
import { Dictionary } from "@intlayer/types/dictionary";
|
|
4
|
-
|
|
5
|
-
//#region src/getTranslationsDictionaryDynamic.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Dynamic dictionary-accepting variant of `getTranslations`.
|
|
8
|
-
*/
|
|
9
|
-
declare const getTranslationsDictionaryDynamic: <const T extends Dictionary, const K extends string>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, namespacePrefix?: string) => Promise<(<P extends ValidDotPathsFor<any>>(lookup: P, params?: Record<string, unknown>) => string)>;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { getTranslationsDictionaryDynamic };
|
|
12
|
-
//# sourceMappingURL=getTranslationsDictionaryDynamic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTranslationsDictionaryDynamic.d.ts","names":[],"sources":["../../src/getTranslationsDictionaryDynamic.ts"],"mappings":";;;;;;;AAQA;cAAa,gCAAA,mBACK,UAAA,0BAGhB,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,GAAA,EAAK,CAAA,EACL,eAAA,cAAwB,OAAA,aAON,gBAAA,OAAqB,MAAA,EAC7B,CAAA,EAAC,MAAA,GACA,MAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { hasLocale as hasLocale$1 } from "next-intl";
|
|
2
|
-
|
|
3
|
-
//#region src/hasLocale.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Drop-in for next-intl's `hasLocale`.
|
|
6
|
-
*
|
|
7
|
-
* Checks that a locale candidate is part of the given locales list (or, when
|
|
8
|
-
* the list is read from routing, the locales configured in intlayer).
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* import { routing } from '@/i18n/routing';
|
|
13
|
-
*
|
|
14
|
-
* if (hasLocale(routing.locales, requested)) { … }
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
declare const hasLocale: typeof hasLocale$1;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { hasLocale };
|
|
20
|
-
//# sourceMappingURL=hasLocale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasLocale.d.ts","names":[],"sources":["../../src/hasLocale.ts"],"mappings":";;;;;AAgBA;;;;;;;;;;;cAAa,SAAA,SAAkB,WAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
2
|
-
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
|
-
|
|
4
|
-
//#region src/useDictionary.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Dictionary-accepting variant of `useTranslations`.
|
|
7
|
-
*
|
|
8
|
-
* Used internally by the SWC optimization: instead of looking up the dictionary
|
|
9
|
-
* at runtime by key, the SWC plugin pre-imports the dictionary JSON at build time
|
|
10
|
-
* and passes it directly here. This enables tree-shaking of unused locale content.
|
|
11
|
-
*
|
|
12
|
-
* @example (generated by SWC, not written manually)
|
|
13
|
-
* import _abc from '.intlayer/dictionaries/about.json' with { type: 'json' };
|
|
14
|
-
* const t = useDictionary(_abc);
|
|
15
|
-
*/
|
|
16
|
-
declare const useDictionary: <T extends Dictionary>(dictionary: T, namespacePrefix?: string) => (<P extends ValidDotPathsFor<any>>(lookup: P, params?: Record<string, unknown>) => string) & {
|
|
17
|
-
has: <P extends ValidDotPathsFor<any>>(lookup: P) => boolean;
|
|
18
|
-
raw: <P extends ValidDotPathsFor<any>>(lookup: P) => unknown;
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { useDictionary };
|
|
22
|
-
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../src/useDictionary.ts"],"mappings":";;;;;;AAkCA;;;;;;;;;cAAa,aAAA,aAA2B,UAAA,EACtC,UAAA,EAAY,CAAA,EACZ,eAAA,0BAQa,gBAAA,OAAqB,MAAA,EACtB,CAAA,EAAC,MAAA,GACA,MAAA;kBAUO,gBAAA,OAAqB,MAAA,EAAU,CAAA;kBAE/B,gBAAA,OAAqB,MAAA,EAAU,CAAA;AAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
2
|
-
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
3
|
-
import { Dictionary } from "@intlayer/types/dictionary";
|
|
4
|
-
|
|
5
|
-
//#region src/useDictionaryDynamic.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Dynamic dictionary-accepting variant of `useTranslations`.
|
|
8
|
-
*/
|
|
9
|
-
declare const useDictionaryDynamic: <const T extends Dictionary, const K extends string>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, namespacePrefix?: string) => (<P extends ValidDotPathsFor<any>>(lookup: P, params?: Record<string, unknown>) => string) & {
|
|
10
|
-
has: <P extends ValidDotPathsFor<any>>(lookup: P) => boolean;
|
|
11
|
-
raw: <P extends ValidDotPathsFor<any>>(lookup: P) => unknown;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { useDictionaryDynamic };
|
|
15
|
-
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../src/useDictionaryDynamic.ts"],"mappings":";;;;;;;AA2BA;cAAa,oBAAA,mBACK,UAAA,0BAGhB,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,GAAA,EAAK,CAAA,EACL,eAAA,0BAWa,gBAAA,OAAqB,MAAA,EACtB,CAAA,EAAC,MAAA,GACA,MAAA;kBAUO,gBAAA,OAAqB,MAAA,EAAU,CAAA;kBAE/B,gBAAA,OAAqB,MAAA,EAAU,CAAA;AAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
2
|
-
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
|
-
|
|
4
|
-
//#region src/useTranslationsDictionary.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Dictionary-accepting variant of `useTranslations`.
|
|
7
|
-
*
|
|
8
|
-
* Used internally by the SWC optimization: instead of looking up the dictionary
|
|
9
|
-
* at runtime by key, the SWC plugin pre-imports the dictionary JSON at build time
|
|
10
|
-
* and passes it directly here. This enables tree-shaking of unused locale content.
|
|
11
|
-
*
|
|
12
|
-
* @example (generated by SWC, not written manually)
|
|
13
|
-
* import _abc from '.intlayer/dictionaries/about.json' with { type: 'json' };
|
|
14
|
-
* const t = useTranslationsDictionary(_abc);
|
|
15
|
-
*/
|
|
16
|
-
declare const useTranslationsDictionary: <T extends Dictionary>(dictionary: T, namespacePrefix?: string) => <P extends ValidDotPathsFor<any>>(lookup: P, params?: Record<string, unknown>) => string;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { useTranslationsDictionary };
|
|
19
|
-
//# sourceMappingURL=useTranslationsDictionary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslationsDictionary.d.ts","names":[],"sources":["../../src/useTranslationsDictionary.ts"],"mappings":";;;;;;AAiBA;;;;;;;;;cAAa,yBAAA,aAAuC,UAAA,EAClD,UAAA,EAAY,CAAA,EACZ,eAAA,yBAIkB,gBAAA,OAChB,MAAA,EAAQ,CAAA,EACR,MAAA,GAAS,MAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
2
|
-
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
3
|
-
import { Dictionary } from "@intlayer/types/dictionary";
|
|
4
|
-
|
|
5
|
-
//#region src/useTranslationsDictionaryDynamic.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Dynamic dictionary-accepting variant of `useTranslations`.
|
|
8
|
-
*/
|
|
9
|
-
declare const useTranslationsDictionaryDynamic: <const T extends Dictionary, const K extends string>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, namespacePrefix?: string) => <P extends ValidDotPathsFor<any>>(lookup: P, params?: Record<string, unknown>) => string;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { useTranslationsDictionaryDynamic };
|
|
12
|
-
//# sourceMappingURL=useTranslationsDictionaryDynamic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslationsDictionaryDynamic.d.ts","names":[],"sources":["../../src/useTranslationsDictionaryDynamic.ts"],"mappings":";;;;;;;AAUA;cAAa,gCAAA,mBACK,UAAA,0BAGhB,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,GAAA,EAAK,CAAA,EACL,eAAA,yBAIkB,gBAAA,OAChB,MAAA,EAAQ,CAAA,EACR,MAAA,GAAS,MAAA"}
|