next-intlayer 7.5.12 → 7.5.13
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/IntlayerClientProvider.cjs +18 -4
- package/dist/cjs/client/IntlayerClientProvider.cjs.map +1 -1
- package/dist/esm/client/IntlayerClientProvider.mjs +19 -5
- package/dist/esm/client/IntlayerClientProvider.mjs.map +1 -1
- package/dist/types/client/IntlayerClientProvider.d.ts.map +1 -1
- package/dist/types/client/useLocale.d.ts +4 -4
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocalePageRouter.d.ts +4 -4
- package/dist/types/generateStaticParams.d.ts +2 -2
- package/package.json +8 -8
|
@@ -6,13 +6,27 @@ let react_intlayer = require("react-intlayer");
|
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
|
|
8
8
|
//#region src/client/IntlayerClientProvider.tsx
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* A wrapper component that bridges the Next.js routing logic (from useLocale)
|
|
11
|
+
* back into the Intlayer context.
|
|
12
|
+
* * This ensures that any component using useIntlayer() or useIntlayerContext()
|
|
13
|
+
* deep in the tree will still trigger Next.js navigation when calling setLocale.
|
|
14
|
+
*/
|
|
15
|
+
const IntlayerRouterBridge = ({ children }) => {
|
|
16
|
+
const context = (0, react_intlayer.useIntlayerContext)();
|
|
10
17
|
const { setLocale } = require_client_useLocale.useLocale();
|
|
11
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_intlayer.
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_intlayer.IntlayerClientContext.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
...context,
|
|
21
|
+
setLocale
|
|
22
|
+
},
|
|
23
|
+
children
|
|
14
24
|
});
|
|
15
25
|
};
|
|
26
|
+
const IntlayerClientProvider = ({ children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_intlayer.IntlayerProvider, {
|
|
27
|
+
...props,
|
|
28
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IntlayerRouterBridge, { children })
|
|
29
|
+
});
|
|
16
30
|
|
|
17
31
|
//#endregion
|
|
18
32
|
exports.IntlayerClientProvider = IntlayerClientProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerClientProvider.cjs","names":["
|
|
1
|
+
{"version":3,"file":"IntlayerClientProvider.cjs","names":["IntlayerRouterBridge: FC<PropsWithChildren>","useLocale","IntlayerClientContext","IntlayerClientProvider: FC<IntlayerProviderProps>","IntlayerProvider"],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport type { FC, PropsWithChildren } from 'react';\nimport {\n IntlayerClientContext,\n IntlayerProvider,\n type IntlayerProviderProps,\n useIntlayerContext,\n} from 'react-intlayer';\nimport { useLocale } from './useLocale';\n\nexport type IntlayerClientProviderProps = IntlayerProviderProps;\n\n/**\n * A wrapper component that bridges the Next.js routing logic (from useLocale)\n * back into the Intlayer context.\n * * This ensures that any component using useIntlayer() or useIntlayerContext()\n * deep in the tree will still trigger Next.js navigation when calling setLocale.\n */\nconst IntlayerRouterBridge: FC<PropsWithChildren> = ({ children }) => {\n // Get the base context (state, storage, etc.)\n const context = useIntlayerContext();\n\n // Get the enhanced setLocale (routing + state) from the next-intlayer hook\n // This works now because we are INSIDE the IntlayerProvider\n const { setLocale } = useLocale();\n\n // Re-provide the context with the enhanced setLocale\n return (\n <IntlayerClientContext.Provider value={{ ...context, setLocale }}>\n {children}\n </IntlayerClientContext.Provider>\n );\n};\n\nexport const IntlayerClientProvider: FC<IntlayerProviderProps> = ({\n children,\n ...props\n}) => (\n <IntlayerProvider {...props}>\n <IntlayerRouterBridge>{children}</IntlayerRouterBridge>\n </IntlayerProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;AAmBA,MAAMA,wBAA+C,EAAE,eAAe;CAEpE,MAAM,kDAA8B;CAIpC,MAAM,EAAE,cAAcC,oCAAW;AAGjC,QACE,2CAACC,qCAAsB;EAAS,OAAO;GAAE,GAAG;GAAS;GAAW;EAC7D;GAC8B;;AAIrC,MAAaC,0BAAqD,EAChE,UACA,GAAG,YAEH,2CAACC;CAAiB,GAAI;WACpB,2CAAC,wBAAsB,WAAgC;EACtC"}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useLocale as useLocale$1 } from "./useLocale.mjs";
|
|
4
|
-
import { IntlayerProvider } from "react-intlayer";
|
|
4
|
+
import { IntlayerClientContext, IntlayerProvider, useIntlayerContext } from "react-intlayer";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/client/IntlayerClientProvider.tsx
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* A wrapper component that bridges the Next.js routing logic (from useLocale)
|
|
10
|
+
* back into the Intlayer context.
|
|
11
|
+
* * This ensures that any component using useIntlayer() or useIntlayerContext()
|
|
12
|
+
* deep in the tree will still trigger Next.js navigation when calling setLocale.
|
|
13
|
+
*/
|
|
14
|
+
const IntlayerRouterBridge = ({ children }) => {
|
|
15
|
+
const context = useIntlayerContext();
|
|
9
16
|
const { setLocale } = useLocale$1();
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
return /* @__PURE__ */ jsx(IntlayerClientContext.Provider, {
|
|
18
|
+
value: {
|
|
19
|
+
...context,
|
|
20
|
+
setLocale
|
|
21
|
+
},
|
|
22
|
+
children
|
|
13
23
|
});
|
|
14
24
|
};
|
|
25
|
+
const IntlayerClientProvider = ({ children, ...props }) => /* @__PURE__ */ jsx(IntlayerProvider, {
|
|
26
|
+
...props,
|
|
27
|
+
children: /* @__PURE__ */ jsx(IntlayerRouterBridge, { children })
|
|
28
|
+
});
|
|
15
29
|
|
|
16
30
|
//#endregion
|
|
17
31
|
export { IntlayerClientProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerClientProvider.mjs","names":["
|
|
1
|
+
{"version":3,"file":"IntlayerClientProvider.mjs","names":["IntlayerRouterBridge: FC<PropsWithChildren>","useLocale","IntlayerClientProvider: FC<IntlayerProviderProps>"],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport type { FC, PropsWithChildren } from 'react';\nimport {\n IntlayerClientContext,\n IntlayerProvider,\n type IntlayerProviderProps,\n useIntlayerContext,\n} from 'react-intlayer';\nimport { useLocale } from './useLocale';\n\nexport type IntlayerClientProviderProps = IntlayerProviderProps;\n\n/**\n * A wrapper component that bridges the Next.js routing logic (from useLocale)\n * back into the Intlayer context.\n * * This ensures that any component using useIntlayer() or useIntlayerContext()\n * deep in the tree will still trigger Next.js navigation when calling setLocale.\n */\nconst IntlayerRouterBridge: FC<PropsWithChildren> = ({ children }) => {\n // Get the base context (state, storage, etc.)\n const context = useIntlayerContext();\n\n // Get the enhanced setLocale (routing + state) from the next-intlayer hook\n // This works now because we are INSIDE the IntlayerProvider\n const { setLocale } = useLocale();\n\n // Re-provide the context with the enhanced setLocale\n return (\n <IntlayerClientContext.Provider value={{ ...context, setLocale }}>\n {children}\n </IntlayerClientContext.Provider>\n );\n};\n\nexport const IntlayerClientProvider: FC<IntlayerProviderProps> = ({\n children,\n ...props\n}) => (\n <IntlayerProvider {...props}>\n <IntlayerRouterBridge>{children}</IntlayerRouterBridge>\n </IntlayerProvider>\n);\n"],"mappings":";;;;;;;;;;;;;AAmBA,MAAMA,wBAA+C,EAAE,eAAe;CAEpE,MAAM,UAAU,oBAAoB;CAIpC,MAAM,EAAE,cAAcC,aAAW;AAGjC,QACE,oBAAC,sBAAsB;EAAS,OAAO;GAAE,GAAG;GAAS;GAAW;EAC7D;GAC8B;;AAIrC,MAAaC,0BAAqD,EAChE,UACA,GAAG,YAEH,oBAAC;CAAiB,GAAI;WACpB,oBAAC,wBAAsB,WAAgC;EACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerClientProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"IntlayerClientProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"sourcesContent":[],"mappings":";;;;KAWY,2BAAA,GAA8B;cAwB7B,wBAAwB,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types3 from "@intlayer/types";
|
|
2
2
|
import { LocalesValues } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/client/useLocale.d.ts
|
|
@@ -9,9 +9,9 @@ declare const useLocale: ({
|
|
|
9
9
|
onChange
|
|
10
10
|
}?: UseLocaleProps) => {
|
|
11
11
|
pathWithoutLocale: string;
|
|
12
|
-
locale:
|
|
13
|
-
defaultLocale:
|
|
14
|
-
availableLocales:
|
|
12
|
+
locale: _intlayer_types3.DeclaredLocales;
|
|
13
|
+
defaultLocale: _intlayer_types3.DeclaredLocales;
|
|
14
|
+
availableLocales: _intlayer_types3.DeclaredLocales[];
|
|
15
15
|
setLocale: (locale: LocalesValues) => void;
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":[],"mappings":";;;;KAQK,cAAA;4CACuC;;AADvC,cAkBQ,SAlBM,
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":[],"mappings":";;;;KAQK,cAAA;4CACuC;;AADvC,cAkBQ,SAlBM,EAAA,CACyB;EAAA;AAAa,CAAA,CAAb,EAiBJ,cAjBiB,EAAA,GAAA;EAiB5C,iBAiCZ,EAAA,MAAA;EAjCyB,MAAA,EAAiC,gBAAA,CAAA,eAAjC;EAAc,aAAA,kCAAA;EAAmB,gBAAA,oCAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types0 from "@intlayer/types";
|
|
2
2
|
import { LocalesValues } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/client/useLocalePageRouter.d.ts
|
|
5
5
|
declare const useLocalePageRouter: () => {
|
|
6
6
|
pathWithoutLocale: string;
|
|
7
|
-
locale:
|
|
8
|
-
defaultLocale:
|
|
9
|
-
availableLocales:
|
|
7
|
+
locale: _intlayer_types0.DeclaredLocales;
|
|
8
|
+
defaultLocale: _intlayer_types0.DeclaredLocales;
|
|
9
|
+
availableLocales: _intlayer_types0.DeclaredLocales[];
|
|
10
10
|
setLocale: (locale: LocalesValues) => void;
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types0 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/generateStaticParams.d.ts
|
|
4
4
|
declare const generateStaticParams: () => {
|
|
5
|
-
locale:
|
|
5
|
+
locale: _intlayer_types0.Locale;
|
|
6
6
|
}[];
|
|
7
7
|
//#endregion
|
|
8
8
|
export { generateStaticParams };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intlayer",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Simplify internationalization i18n in Next.js with context providers, hooks, locale detection, and multilingual content integration.",
|
|
6
6
|
"keywords": [
|
|
@@ -118,15 +118,15 @@
|
|
|
118
118
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@intlayer/chokidar": "7.5.
|
|
122
|
-
"@intlayer/config": "7.5.
|
|
123
|
-
"@intlayer/core": "7.5.
|
|
124
|
-
"@intlayer/dictionaries-entry": "7.5.
|
|
125
|
-
"@intlayer/types": "7.5.
|
|
126
|
-
"@intlayer/webpack": "7.5.
|
|
121
|
+
"@intlayer/chokidar": "7.5.13",
|
|
122
|
+
"@intlayer/config": "7.5.13",
|
|
123
|
+
"@intlayer/core": "7.5.13",
|
|
124
|
+
"@intlayer/dictionaries-entry": "7.5.13",
|
|
125
|
+
"@intlayer/types": "7.5.13",
|
|
126
|
+
"@intlayer/webpack": "7.5.13",
|
|
127
127
|
"defu": "6.1.4",
|
|
128
128
|
"node-loader": "2.1.0",
|
|
129
|
-
"react-intlayer": "7.5.
|
|
129
|
+
"react-intlayer": "7.5.13"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
132
|
"@types/node": "25.0.3",
|