next-intlayer 9.4.0-canary.0 → 9.4.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/README.md CHANGED
@@ -214,6 +214,7 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
214
214
  <li><a href="https://intlayer.org/doc/environment/vite-and-vue" rel=''>Vite + Vue</a></li>
215
215
  <li><a href="https://intlayer.org/doc/environment/nuxt-and-vue" rel=''>Vite + Nuxt</a></li>
216
216
  <li><a href="https://intlayer.org/doc/environment/vite-and-solid" rel=''>Vite + Solid</a></li>
217
+ <li><a href="https://intlayer.org/doc/environment/solid-start" rel=''>Solid Start</a></li>
217
218
  <li><a href="https://intlayer.org/doc/environment/angular" rel=''>Angular</a></li>
218
219
  <li>
219
220
  <a href="https://intlayer.org/doc/environment/express" rel=''>Backend</a>
@@ -223,7 +224,9 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
223
224
  <li><a href="https://intlayer.org/doc/environment/fastify" rel=''>Fastify</a></li>
224
225
  <li><a href="https://intlayer.org/doc/environment/adonisjs" rel=''>AdonisJS</a></li>
225
226
  <li><a href="https://intlayer.org/doc/environment/hono" rel=''>Hono</a></li>
227
+ <li><a href="https://intlayer.org/doc/environment/elysia" rel=''>Elysia</a></li>
226
228
  </ul>
229
+
227
230
  </li>
228
231
  </ul>
229
232
  </details>
@@ -6,31 +6,35 @@ let react_jsx_runtime = require("react/jsx-runtime");
6
6
 
7
7
  //#region src/client/IntlayerClientProvider.tsx
8
8
  /**
9
- * Provider for client-side components in Next.js.
9
+ * Client boundary mounted by the unified `IntlayerProvider`.
10
10
  *
11
- * This component wraps the `IntlayerProvider` from `react-intlayer` and is intended
12
- * to be used within Next.js App Router client components.
11
+ * Wraps the `IntlayerProvider` from `react-intlayer` so that client components
12
+ * rendered below a Next.js App Router server component receive the locale and
13
+ * the ambient variant through context.
13
14
  *
14
15
  * @param props - The provider props.
15
16
  * @returns The provider component.
17
+ */
18
+ const IntlayerClientProviderBase = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_intlayer.IntlayerProvider, { ...props });
19
+ /**
20
+ * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead.
21
+ * Mounted once in the locale layout, it seeds the request-scoped server
22
+ * context *and* mounts this client provider, so a single provider covers both
23
+ * halves of the tree:
16
24
  *
17
- * @example
18
25
  * ```tsx
19
- * 'use client';
26
+ * import { IntlayerProvider } from 'next-intlayer/server';
20
27
  *
21
- * import { IntlayerClientProvider } from 'next-intlayer';
28
+ * const LocaleLayout = async ({ children, params }) => {
29
+ * const { locale } = await params;
22
30
  *
23
- * export default function ClientLayout({ children, locale }) {
24
- * return (
25
- * <IntlayerClientProvider locale={locale}>
26
- * {children}
27
- * </IntlayerClientProvider>
28
- * );
29
- * }
31
+ * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;
32
+ * };
30
33
  * ```
31
34
  */
32
- const IntlayerClientProvider = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_intlayer.IntlayerProvider, { ...props });
35
+ const IntlayerClientProvider = IntlayerClientProviderBase;
33
36
 
34
37
  //#endregion
35
38
  exports.IntlayerClientProvider = IntlayerClientProvider;
39
+ exports.IntlayerClientProviderBase = IntlayerClientProviderBase;
36
40
  //# sourceMappingURL=IntlayerClientProvider.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerClientProvider.cjs","names":["IntlayerProvider"],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\n\nimport { IntlayerProvider, type IntlayerProviderProps } from 'react-intlayer';\n\nexport type IntlayerClientProviderProps = IntlayerProviderProps;\n\n/**\n * Provider for client-side components in Next.js.\n *\n * This component wraps the `IntlayerProvider` from `react-intlayer` and is intended\n * to be used within Next.js App Router client components.\n *\n * @param props - The provider props.\n * @returns The provider component.\n *\n * @example\n * ```tsx\n * 'use client';\n *\n * import { IntlayerClientProvider } from 'next-intlayer';\n *\n * export default function ClientLayout({ children, locale }) {\n * return (\n * <IntlayerClientProvider locale={locale}>\n * {children}\n * </IntlayerClientProvider>\n * );\n * }\n * ```\n */\nexport const IntlayerClientProvider: FC<IntlayerProviderProps> = (props) => (\n <IntlayerProvider {...props} />\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAa,0BAAqD,UAChE,2CAACA,iCAAD,EAAkB,GAAI,MAAQ"}
1
+ {"version":3,"file":"IntlayerClientProvider.cjs","names":["IntlayerProvider"],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\n\nimport { IntlayerProvider, type IntlayerProviderProps } from 'react-intlayer';\n\n/**\n * @deprecated Use `IntlayerProviderProps` from `next-intlayer/server` instead.\n */\nexport type IntlayerClientProviderProps = IntlayerProviderProps;\n\n/**\n * Client boundary mounted by the unified `IntlayerProvider`.\n *\n * Wraps the `IntlayerProvider` from `react-intlayer` so that client components\n * rendered below a Next.js App Router server component receive the locale and\n * the ambient variant through context.\n *\n * @param props - The provider props.\n * @returns The provider component.\n */\nexport const IntlayerClientProviderBase: FC<IntlayerProviderProps> = (\n props\n) => <IntlayerProvider {...props} />;\n\n/**\n * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead.\n * Mounted once in the locale layout, it seeds the request-scoped server\n * context *and* mounts this client provider, so a single provider covers both\n * halves of the tree:\n *\n * ```tsx\n * import { IntlayerProvider } from 'next-intlayer/server';\n *\n * const LocaleLayout = async ({ children, params }) => {\n * const { locale } = await params;\n *\n * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;\n * };\n * ```\n */\nexport const IntlayerClientProvider = IntlayerClientProviderBase;\n"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,MAAa,8BACX,UACG,2CAACA,iCAAD,EAAkB,GAAI,MAAQ;;;;;;;;;;;;;;;;;AAkBnC,MAAa,yBAAyB"}
@@ -89,6 +89,12 @@ Object.defineProperty(exports, 't', {
89
89
  return react_intlayer.t;
90
90
  }
91
91
  });
92
+ Object.defineProperty(exports, 'useConversion', {
93
+ enumerable: true,
94
+ get: function () {
95
+ return react_intlayer.useConversion;
96
+ }
97
+ });
92
98
  Object.defineProperty(exports, 'useDictionary', {
93
99
  enumerable: true,
94
100
  get: function () {
@@ -107,6 +113,12 @@ Object.defineProperty(exports, 'useDictionaryDynamic', {
107
113
  return react_intlayer.useDictionaryDynamic;
108
114
  }
109
115
  });
116
+ Object.defineProperty(exports, 'useExperiment', {
117
+ enumerable: true,
118
+ get: function () {
119
+ return react_intlayer.useExperiment;
120
+ }
121
+ });
110
122
  Object.defineProperty(exports, 'useI18n', {
111
123
  enumerable: true,
112
124
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n getDictionary,\n getIntlayer,\n IntlayerClientContext,\n type IntlayerNode,\n IntlayerProvider,\n type IntlayerProviderProps,\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useI18n,\n useIntl,\n useIntlayer,\n useLoadDynamic,\n useLocaleCookie,\n useLocaleStorage,\n} from 'react-intlayer';\nexport * from './client/index';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n LocalPromiseParams,\n Next14LayoutIntlayer,\n Next14PageIntlayer,\n Next15LayoutIntlayer,\n Next15PageIntlayer,\n NextLayoutIntlayer,\n NextPageIntlayer,\n} from './types/index';\n\nimport type {\n MarkdownProviderOptions as _MarkdownProviderOptions,\n MarkdownRendererProps as _MarkdownRendererProps,\n RenderMarkdownProps as _RenderMarkdownProps,\n} from './markdown';\nimport {\n MarkdownProvider as _MarkdownProvider,\n MarkdownRenderer as _MarkdownRenderer,\n renderMarkdown as _renderMarkdown,\n useMarkdownContext as _useMarkdownContext,\n useMarkdownRenderer as _useMarkdownRenderer,\n} from './markdown';\n\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":";;;;;;;;;;;;;AAmDA,MAAa,2DAAmBA;;;;AAIhC,MAAa,6DAAqBC;;;;AAQlC,MAAa,yDAAiBC;;;;AAI9B,MAAa,8DAAsBC;;;;AAInC,MAAa,2DAAmBC"}
1
+ {"version":3,"file":"index.cjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n type ConversionParams,\n type ExperimentState,\n getDictionary,\n getIntlayer,\n IntlayerClientContext,\n type IntlayerNode,\n IntlayerProvider,\n type IntlayerProviderProps,\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n t,\n useConversion,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useExperiment,\n useI18n,\n useIntl,\n useIntlayer,\n useLoadDynamic,\n useLocaleCookie,\n useLocaleStorage,\n} from 'react-intlayer';\nexport * from './client/index';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n LocalPromiseParams,\n Next14LayoutIntlayer,\n Next14PageIntlayer,\n Next15LayoutIntlayer,\n Next15PageIntlayer,\n NextLayoutIntlayer,\n NextPageIntlayer,\n} from './types/index';\n\nimport type {\n MarkdownProviderOptions as _MarkdownProviderOptions,\n MarkdownRendererProps as _MarkdownRendererProps,\n RenderMarkdownProps as _RenderMarkdownProps,\n} from './markdown';\nimport {\n MarkdownProvider as _MarkdownProvider,\n MarkdownRenderer as _MarkdownRenderer,\n renderMarkdown as _renderMarkdown,\n useMarkdownContext as _useMarkdownContext,\n useMarkdownRenderer as _useMarkdownRenderer,\n} from './markdown';\n\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":";;;;;;;;;;;;;AAuDA,MAAa,2DAAmBA;;;;AAIhC,MAAa,6DAAqBC;;;;AAQlC,MAAa,yDAAiBC;;;;AAI9B,MAAa,8DAAsBC;;;;AAInC,MAAa,2DAAmBC"}
@@ -3,15 +3,15 @@ const require_client_IntlayerClientProvider = require('../client/IntlayerClientP
3
3
  const require_client_usePathname = require('../client/usePathname.cjs');
4
4
  const require_client_useLocalePageRouter = require('../client/useLocalePageRouter.cjs');
5
5
  const require_generateStaticParams = require('../generateStaticParams.cjs');
6
- const require_server_IntlayerProvider = require('../server/IntlayerProvider.cjs');
7
6
  const require_server_t = require('../server/t.cjs');
8
- const require_server_useDictionary = require('../server/useDictionary.cjs');
9
- const require_server_useDictionaryAsync = require('../server/useDictionaryAsync.cjs');
10
- const require_server_useDictionaryDynamic = require('../server/useDictionaryDynamic.cjs');
11
7
  const require_server_useI18n = require('../server/useI18n.cjs');
12
- const require_server_useIntl = require('../server/useIntl.cjs');
13
8
  const require_server_useIntlayer = require('../server/useIntlayer.cjs');
9
+ const require_server_useDictionaryAsync = require('../server/useDictionaryAsync.cjs');
14
10
  const require_server_useLocale = require('../server/useLocale.cjs');
11
+ const require_server_IntlayerProvider = require('../server/IntlayerProvider.cjs');
12
+ const require_server_useIntl = require('../server/useIntl.cjs');
13
+ const require_server_useDictionaryDynamic = require('../server/useDictionaryDynamic.cjs');
14
+ const require_server_useDictionary = require('../server/useDictionary.cjs');
15
15
  let react_intlayer = require("react-intlayer");
16
16
  let react_intlayer_server = require("react-intlayer/server");
17
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerProvider.cjs","names":["IntlayerServerProvider","IntlayerClientProvider"],"sources":["../../../src/server/IntlayerProvider.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n IntlayerServerProvider,\n type IntlayerServerProviderProps,\n} from 'react-intlayer/server';\nimport {\n IntlayerClientProvider,\n type IntlayerClientProviderProps,\n} from '../client/IntlayerClientProvider';\n\nexport type IntlayerProviderProps = IntlayerClientProviderProps &\n IntlayerServerProviderProps;\n\n/**\n * Unified Intlayer provider for the Next.js App Router.\n *\n * Server component that seeds the request-scoped server context (locale and\n * ambient variant) read by the server hooks, and mounts the client provider so\n * client components receive the same values — one provider for both halves.\n *\n * Mount it once, in the locale layout:\n *\n * ```tsx\n * import { IntlayerProvider } from 'next-intlayer/server';\n *\n * const LocaleLayout: NextLayoutIntlayer = async ({ children, params }) => {\n * const { locale } = await params;\n *\n * return (\n * <IntlayerProvider locale={locale}>\n * <html lang={locale}>\n * <body>{children}</body>\n * </html>\n * </IntlayerProvider>\n * );\n * };\n * ```\n *\n * The server context is request-scoped, not tree-scoped: on client-side\n * navigations that only re-render the page segment, the layout — and with it\n * this provider — does not re-run. The server hooks then fall back to the\n * locale carried by the request (the `x-intlayer-locale` header set by the\n * intlayer proxy, then the locale cookie), so content stays correct without a\n * per-page provider. The ambient `variant` has no request-carried fallback:\n * seed it per request with `setVariant` when server components read it outside\n * a full render of this provider.\n */\nexport const IntlayerProvider: FC<IntlayerProviderProps> = ({\n children,\n locale,\n variant,\n ...clientProps\n}) => (\n <IntlayerServerProvider locale={locale} variant={variant}>\n <IntlayerClientProvider locale={locale} variant={variant} {...clientProps}>\n {children}\n </IntlayerClientProvider>\n </IntlayerServerProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAa,oBAA+C,EAC1D,UACA,QACA,SACA,GAAG,kBAEH,2CAACA,8CAAD;CAAgC;CAAiB;WAC/C,2CAACC,8DAAD;EAAgC;EAAiB;EAAS,GAAI;EAC3D;CACqB;AACF"}
1
+ {"version":3,"file":"IntlayerProvider.cjs","names":["IntlayerServerProvider","IntlayerClientProvider"],"sources":["../../../src/server/IntlayerProvider.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport type { IntlayerProviderProps as IntlayerClientProviderProps } from 'react-intlayer';\nimport {\n IntlayerServerProvider,\n type IntlayerServerProviderProps,\n} from 'react-intlayer/server';\nimport { IntlayerClientProvider } from '../client/IntlayerClientProvider';\n\nexport type IntlayerProviderProps = IntlayerClientProviderProps &\n IntlayerServerProviderProps;\n\n/**\n * Unified Intlayer provider for the Next.js App Router.\n *\n * Server component that seeds the request-scoped server context (locale and\n * ambient variant) read by the server hooks, and mounts the client provider so\n * client components receive the same values — one provider for both halves.\n *\n * Mount it once, in the locale layout:\n *\n * ```tsx\n * import { IntlayerProvider } from 'next-intlayer/server';\n *\n * const LocaleLayout: NextLayoutIntlayer = async ({ children, params }) => {\n * const { locale } = await params;\n *\n * return (\n * <IntlayerProvider locale={locale}>\n * <html lang={locale}>\n * <body>{children}</body>\n * </html>\n * </IntlayerProvider>\n * );\n * };\n * ```\n *\n * The server context is request-scoped, not tree-scoped: on client-side\n * navigations that only re-render the page segment, the layout — and with it\n * this provider — does not re-run. The server hooks then fall back to the\n * locale carried by the request (the `x-intlayer-locale` header set by the\n * intlayer proxy, then the locale cookie), so content stays correct without a\n * per-page provider. The ambient `variant` has no request-carried fallback:\n * seed it per request with `setVariant` when server components read it outside\n * a full render of this provider.\n */\nexport const IntlayerProvider: FC<IntlayerProviderProps> = ({\n children,\n locale,\n variant,\n ...clientProps\n}) => (\n <IntlayerServerProvider locale={locale} variant={variant}>\n <IntlayerClientProvider locale={locale} variant={variant} {...clientProps}>\n {children}\n </IntlayerClientProvider>\n </IntlayerServerProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,oBAA+C,EAC1D,UACA,QACA,SACA,GAAG,kBAEH,2CAACA,8CAAD;CAAgC;CAAiB;WAC/C,2CAACC,8DAAD;EAAgC;EAAiB;EAAS,GAAI;EAC3D;CACqB;AACF"}
@@ -3,12 +3,24 @@ let react_intlayer_server = require("react-intlayer/server");
3
3
 
4
4
  //#region src/server/IntlayerServerProvider.ts
5
5
  /**
6
- * @deprecated Mount `IntlayerProvider` from `next-intlayer/server` once in the
7
- * locale layout instead it seeds both the server context and the client
8
- * provider, and the server hooks fall back to the locale carried by the
9
- * request when the layout is skipped on client-side navigations. For a page
10
- * that must seed the locale itself (statically rendered routes on
11
- * Next.js < 16), use the imperative `setLocale` instead of wrapping the tree.
6
+ * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead and
7
+ * in most trees, no replacement at all. Mounting `IntlayerProvider` once in the
8
+ * locale layout already seeds both the server context and the client provider
9
+ * for every page below it, and the server hooks fall back to the locale carried
10
+ * by the request when the layout is skipped on client-side navigations. This
11
+ * component's only remaining use is a page that must seed the locale itself
12
+ * (statically rendered routes on Next.js < 16); prefer the imperative
13
+ * `setLocale` over wrapping the tree even there.
14
+ *
15
+ * ```tsx
16
+ * import { IntlayerProvider } from 'next-intlayer/server';
17
+ *
18
+ * const LocaleLayout = async ({ children, params }) => {
19
+ * const { locale } = await params;
20
+ *
21
+ * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;
22
+ * };
23
+ * ```
12
24
  */
13
25
  const IntlayerServerProvider = react_intlayer_server.IntlayerServerProvider;
14
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerServerProvider.cjs","names":["IntlayerServerProviderBase"],"sources":["../../../src/server/IntlayerServerProvider.ts"],"sourcesContent":["import { IntlayerServerProvider as IntlayerServerProviderBase } from 'react-intlayer/server';\n\n/**\n * @deprecated Mount `IntlayerProvider` from `next-intlayer/server` once in the\n * locale layout instead — it seeds both the server context and the client\n * provider, and the server hooks fall back to the locale carried by the\n * request when the layout is skipped on client-side navigations. For a page\n * that must seed the locale itself (statically rendered routes on\n * Next.js < 16), use the imperative `setLocale` instead of wrapping the tree.\n */\nexport const IntlayerServerProvider = IntlayerServerProviderBase;\n"],"mappings":";;;;;;;;;;;;AAUA,MAAa,yBAAyBA"}
1
+ {"version":3,"file":"IntlayerServerProvider.cjs","names":["IntlayerServerProviderBase"],"sources":["../../../src/server/IntlayerServerProvider.ts"],"sourcesContent":["import {\n IntlayerServerProvider as IntlayerServerProviderBase,\n type IntlayerServerProviderProps as IntlayerServerProviderPropsBase,\n} from 'react-intlayer/server';\n\n/**\n * @deprecated Use `IntlayerProviderProps` from `next-intlayer/server` instead.\n */\nexport type IntlayerServerProviderProps = IntlayerServerProviderPropsBase;\n\n/**\n * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead — and\n * in most trees, no replacement at all. Mounting `IntlayerProvider` once in the\n * locale layout already seeds both the server context and the client provider\n * for every page below it, and the server hooks fall back to the locale carried\n * by the request when the layout is skipped on client-side navigations. This\n * component's only remaining use is a page that must seed the locale itself\n * (statically rendered routes on Next.js < 16); prefer the imperative\n * `setLocale` over wrapping the tree even there.\n *\n * ```tsx\n * import { IntlayerProvider } from 'next-intlayer/server';\n *\n * const LocaleLayout = async ({ children, params }) => {\n * const { locale } = await params;\n *\n * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;\n * };\n * ```\n */\nexport const IntlayerServerProvider = IntlayerServerProviderBase;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,yBAAyBA"}
@@ -1,16 +1,16 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_server_IntlayerProvider = require('./IntlayerProvider.cjs');
3
2
  const require_server_getLocale = require('./getLocale.cjs');
4
3
  const require_server_t = require('./t.cjs');
5
- const require_server_useDictionary = require('./useDictionary.cjs');
6
- const require_server_useDictionaryAsync = require('./useDictionaryAsync.cjs');
7
- const require_server_useDictionaryDynamic = require('./useDictionaryDynamic.cjs');
4
+ const require_server_withIntlayer = require('./withIntlayer.cjs');
8
5
  const require_server_useI18n = require('./useI18n.cjs');
9
- const require_server_useIntl = require('./useIntl.cjs');
10
6
  const require_server_useIntlayer = require('./useIntlayer.cjs');
7
+ const require_server_useDictionaryAsync = require('./useDictionaryAsync.cjs');
11
8
  const require_server_useLocale = require('./useLocale.cjs');
12
- const require_server_withIntlayer = require('./withIntlayer.cjs');
9
+ const require_server_IntlayerProvider = require('./IntlayerProvider.cjs');
10
+ const require_server_useIntl = require('./useIntl.cjs');
11
+ const require_server_useDictionaryDynamic = require('./useDictionaryDynamic.cjs');
13
12
  const require_server_IntlayerServerProvider = require('./IntlayerServerProvider.cjs');
13
+ const require_server_useDictionary = require('./useDictionary.cjs');
14
14
  let react_intlayer_server = require("react-intlayer/server");
15
15
 
16
16
  exports.IntlayerProvider = require_server_IntlayerProvider.IntlayerProvider;
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let _intlayer_config_logger = require("@intlayer/config/logger");
4
3
  let node_path = require("node:path");
5
4
  let _intlayer_config_colors = require("@intlayer/config/colors");
6
5
  _intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
6
+ let _intlayer_config_logger = require("@intlayer/config/logger");
7
7
  let _intlayer_config_utils = require("@intlayer/config/utils");
8
8
  let _intlayer_engine_utils = require("@intlayer/engine/utils");
9
9
  let node_fs = require("node:fs");
@@ -3,11 +3,11 @@ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
3
  const require_server_prepareSwcOptimization = require('./prepareSwcOptimization.cjs');
4
4
  const require_server_swcPluginCompatibility = require('./swcPluginCompatibility.cjs');
5
5
  let _intlayer_config_defaultValues = require("@intlayer/config/defaultValues");
6
- let _intlayer_config_logger = require("@intlayer/config/logger");
7
6
  let node_path = require("node:path");
8
7
  let _intlayer_config_colors = require("@intlayer/config/colors");
9
8
  _intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
10
9
  let _intlayer_config_envVars = require("@intlayer/config/envVars");
10
+ let _intlayer_config_logger = require("@intlayer/config/logger");
11
11
  let _intlayer_config_node = require("@intlayer/config/node");
12
12
  let _intlayer_config_utils = require("@intlayer/config/utils");
13
13
  let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
@@ -5,31 +5,34 @@ import { jsx } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/client/IntlayerClientProvider.tsx
7
7
  /**
8
- * Provider for client-side components in Next.js.
8
+ * Client boundary mounted by the unified `IntlayerProvider`.
9
9
  *
10
- * This component wraps the `IntlayerProvider` from `react-intlayer` and is intended
11
- * to be used within Next.js App Router client components.
10
+ * Wraps the `IntlayerProvider` from `react-intlayer` so that client components
11
+ * rendered below a Next.js App Router server component receive the locale and
12
+ * the ambient variant through context.
12
13
  *
13
14
  * @param props - The provider props.
14
15
  * @returns The provider component.
16
+ */
17
+ const IntlayerClientProviderBase = (props) => /* @__PURE__ */ jsx(IntlayerProvider, { ...props });
18
+ /**
19
+ * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead.
20
+ * Mounted once in the locale layout, it seeds the request-scoped server
21
+ * context *and* mounts this client provider, so a single provider covers both
22
+ * halves of the tree:
15
23
  *
16
- * @example
17
24
  * ```tsx
18
- * 'use client';
25
+ * import { IntlayerProvider } from 'next-intlayer/server';
19
26
  *
20
- * import { IntlayerClientProvider } from 'next-intlayer';
27
+ * const LocaleLayout = async ({ children, params }) => {
28
+ * const { locale } = await params;
21
29
  *
22
- * export default function ClientLayout({ children, locale }) {
23
- * return (
24
- * <IntlayerClientProvider locale={locale}>
25
- * {children}
26
- * </IntlayerClientProvider>
27
- * );
28
- * }
30
+ * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;
31
+ * };
29
32
  * ```
30
33
  */
31
- const IntlayerClientProvider = (props) => /* @__PURE__ */ jsx(IntlayerProvider, { ...props });
34
+ const IntlayerClientProvider = IntlayerClientProviderBase;
32
35
 
33
36
  //#endregion
34
- export { IntlayerClientProvider };
37
+ export { IntlayerClientProvider, IntlayerClientProviderBase };
35
38
  //# sourceMappingURL=IntlayerClientProvider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerClientProvider.mjs","names":[],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\n\nimport { IntlayerProvider, type IntlayerProviderProps } from 'react-intlayer';\n\nexport type IntlayerClientProviderProps = IntlayerProviderProps;\n\n/**\n * Provider for client-side components in Next.js.\n *\n * This component wraps the `IntlayerProvider` from `react-intlayer` and is intended\n * to be used within Next.js App Router client components.\n *\n * @param props - The provider props.\n * @returns The provider component.\n *\n * @example\n * ```tsx\n * 'use client';\n *\n * import { IntlayerClientProvider } from 'next-intlayer';\n *\n * export default function ClientLayout({ children, locale }) {\n * return (\n * <IntlayerClientProvider locale={locale}>\n * {children}\n * </IntlayerClientProvider>\n * );\n * }\n * ```\n */\nexport const IntlayerClientProvider: FC<IntlayerProviderProps> = (props) => (\n <IntlayerProvider {...props} />\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAa,0BAAqD,UAChE,oBAAC,kBAAD,EAAkB,GAAI,MAAQ"}
1
+ {"version":3,"file":"IntlayerClientProvider.mjs","names":[],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\n\nimport { IntlayerProvider, type IntlayerProviderProps } from 'react-intlayer';\n\n/**\n * @deprecated Use `IntlayerProviderProps` from `next-intlayer/server` instead.\n */\nexport type IntlayerClientProviderProps = IntlayerProviderProps;\n\n/**\n * Client boundary mounted by the unified `IntlayerProvider`.\n *\n * Wraps the `IntlayerProvider` from `react-intlayer` so that client components\n * rendered below a Next.js App Router server component receive the locale and\n * the ambient variant through context.\n *\n * @param props - The provider props.\n * @returns The provider component.\n */\nexport const IntlayerClientProviderBase: FC<IntlayerProviderProps> = (\n props\n) => <IntlayerProvider {...props} />;\n\n/**\n * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead.\n * Mounted once in the locale layout, it seeds the request-scoped server\n * context *and* mounts this client provider, so a single provider covers both\n * halves of the tree:\n *\n * ```tsx\n * import { IntlayerProvider } from 'next-intlayer/server';\n *\n * const LocaleLayout = async ({ children, params }) => {\n * const { locale } = await params;\n *\n * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;\n * };\n * ```\n */\nexport const IntlayerClientProvider = IntlayerClientProviderBase;\n"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAa,8BACX,UACG,oBAAC,kBAAD,EAAkB,GAAI,MAAQ;;;;;;;;;;;;;;;;;AAkBnC,MAAa,yBAAyB"}
@@ -5,7 +5,7 @@ import { useLocalePageRouter } from "./client/useLocalePageRouter.mjs";
5
5
  import { useRewriteURL } from "./client/useRewriteURL.mjs";
6
6
  import { generateStaticParams } from "./generateStaticParams.mjs";
7
7
  import { markdown_exports } from "./markdown/index.mjs";
8
- import { IntlayerClientContext, IntlayerProvider, getDictionary, getIntlayer, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocaleCookie, useLocaleStorage } from "react-intlayer";
8
+ import { IntlayerClientContext, IntlayerProvider, getDictionary, getIntlayer, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useConversion, useDictionary, useDictionaryAsync, useDictionaryDynamic, useExperiment, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocaleCookie, useLocaleStorage } from "react-intlayer";
9
9
 
10
10
  //#region src/index.ts
11
11
  /**
@@ -30,5 +30,5 @@ const useMarkdownRenderer = markdown_exports.useMarkdownRenderer;
30
30
  const MarkdownRenderer = markdown_exports.MarkdownRenderer;
31
31
 
32
32
  //#endregion
33
- export { IntlayerClientContext, IntlayerClientProvider, IntlayerProvider, MarkdownProvider, MarkdownRenderer, generateStaticParams, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, useLocaleCookie, useLocalePageRouter, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, usePathname, useRewriteURL };
33
+ export { IntlayerClientContext, IntlayerClientProvider, IntlayerProvider, MarkdownProvider, MarkdownRenderer, generateStaticParams, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useConversion, useDictionary, useDictionaryAsync, useDictionaryDynamic, useExperiment, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, useLocaleCookie, useLocalePageRouter, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, usePathname, useRewriteURL };
34
34
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n getDictionary,\n getIntlayer,\n IntlayerClientContext,\n type IntlayerNode,\n IntlayerProvider,\n type IntlayerProviderProps,\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n t,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useI18n,\n useIntl,\n useIntlayer,\n useLoadDynamic,\n useLocaleCookie,\n useLocaleStorage,\n} from 'react-intlayer';\nexport * from './client/index';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n LocalPromiseParams,\n Next14LayoutIntlayer,\n Next14PageIntlayer,\n Next15LayoutIntlayer,\n Next15PageIntlayer,\n NextLayoutIntlayer,\n NextPageIntlayer,\n} from './types/index';\n\nimport type {\n MarkdownProviderOptions as _MarkdownProviderOptions,\n MarkdownRendererProps as _MarkdownRendererProps,\n RenderMarkdownProps as _RenderMarkdownProps,\n} from './markdown';\nimport {\n MarkdownProvider as _MarkdownProvider,\n MarkdownRenderer as _MarkdownRenderer,\n renderMarkdown as _renderMarkdown,\n useMarkdownContext as _useMarkdownContext,\n useMarkdownRenderer as _useMarkdownRenderer,\n} from './markdown';\n\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":";;;;;;;;;;;;;AAmDA,MAAa,mBAAmBA;;;;AAIhC,MAAa,qBAAqBC;;;;AAQlC,MAAa,iBAAiBC;;;;AAI9B,MAAa,sBAAsBC;;;;AAInC,MAAa,mBAAmBC"}
1
+ {"version":3,"file":"index.mjs","names":["_MarkdownProvider","_useMarkdownContext","_renderMarkdown","_useMarkdownRenderer","_MarkdownRenderer"],"sources":["../../src/index.ts"],"sourcesContent":["export {\n type ConversionParams,\n type ExperimentState,\n getDictionary,\n getIntlayer,\n IntlayerClientContext,\n type IntlayerNode,\n IntlayerProvider,\n type IntlayerProviderProps,\n localeCookie,\n localeInStorage,\n setLocaleCookie,\n setLocaleInStorage,\n t,\n useConversion,\n useDictionary,\n useDictionaryAsync,\n useDictionaryDynamic,\n useExperiment,\n useI18n,\n useIntl,\n useIntlayer,\n useLoadDynamic,\n useLocaleCookie,\n useLocaleStorage,\n} from 'react-intlayer';\nexport * from './client/index';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n LocalPromiseParams,\n Next14LayoutIntlayer,\n Next14PageIntlayer,\n Next15LayoutIntlayer,\n Next15PageIntlayer,\n NextLayoutIntlayer,\n NextPageIntlayer,\n} from './types/index';\n\nimport type {\n MarkdownProviderOptions as _MarkdownProviderOptions,\n MarkdownRendererProps as _MarkdownRendererProps,\n RenderMarkdownProps as _RenderMarkdownProps,\n} from './markdown';\nimport {\n MarkdownProvider as _MarkdownProvider,\n MarkdownRenderer as _MarkdownRenderer,\n renderMarkdown as _renderMarkdown,\n useMarkdownContext as _useMarkdownContext,\n useMarkdownRenderer as _useMarkdownRenderer,\n} from './markdown';\n\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownProvider = _MarkdownProvider;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownContext = _useMarkdownContext;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownProviderOptions = _MarkdownProviderOptions;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const renderMarkdown = _renderMarkdown;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const useMarkdownRenderer = _useMarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport const MarkdownRenderer = _MarkdownRenderer;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type RenderMarkdownProps = _RenderMarkdownProps;\n/**\n * @deprecated import from next-intlayer/markdown instead\n */\nexport type MarkdownRendererProps = _MarkdownRendererProps;\n"],"mappings":";;;;;;;;;;;;;AAuDA,MAAa,mBAAmBA;;;;AAIhC,MAAa,qBAAqBC;;;;AAQlC,MAAa,iBAAiBC;;;;AAI9B,MAAa,sBAAsBC;;;;AAInC,MAAa,mBAAmBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerProvider.mjs","names":[],"sources":["../../../src/server/IntlayerProvider.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n IntlayerServerProvider,\n type IntlayerServerProviderProps,\n} from 'react-intlayer/server';\nimport {\n IntlayerClientProvider,\n type IntlayerClientProviderProps,\n} from '../client/IntlayerClientProvider';\n\nexport type IntlayerProviderProps = IntlayerClientProviderProps &\n IntlayerServerProviderProps;\n\n/**\n * Unified Intlayer provider for the Next.js App Router.\n *\n * Server component that seeds the request-scoped server context (locale and\n * ambient variant) read by the server hooks, and mounts the client provider so\n * client components receive the same values — one provider for both halves.\n *\n * Mount it once, in the locale layout:\n *\n * ```tsx\n * import { IntlayerProvider } from 'next-intlayer/server';\n *\n * const LocaleLayout: NextLayoutIntlayer = async ({ children, params }) => {\n * const { locale } = await params;\n *\n * return (\n * <IntlayerProvider locale={locale}>\n * <html lang={locale}>\n * <body>{children}</body>\n * </html>\n * </IntlayerProvider>\n * );\n * };\n * ```\n *\n * The server context is request-scoped, not tree-scoped: on client-side\n * navigations that only re-render the page segment, the layout — and with it\n * this provider — does not re-run. The server hooks then fall back to the\n * locale carried by the request (the `x-intlayer-locale` header set by the\n * intlayer proxy, then the locale cookie), so content stays correct without a\n * per-page provider. The ambient `variant` has no request-carried fallback:\n * seed it per request with `setVariant` when server components read it outside\n * a full render of this provider.\n */\nexport const IntlayerProvider: FC<IntlayerProviderProps> = ({\n children,\n locale,\n variant,\n ...clientProps\n}) => (\n <IntlayerServerProvider locale={locale} variant={variant}>\n <IntlayerClientProvider locale={locale} variant={variant} {...clientProps}>\n {children}\n </IntlayerClientProvider>\n </IntlayerServerProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAa,oBAA+C,EAC1D,UACA,QACA,SACA,GAAG,kBAEH,oBAAC,wBAAD;CAAgC;CAAiB;WAC/C,oBAAC,wBAAD;EAAgC;EAAiB;EAAS,GAAI;EAC3D;CACqB;AACF"}
1
+ {"version":3,"file":"IntlayerProvider.mjs","names":[],"sources":["../../../src/server/IntlayerProvider.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport type { IntlayerProviderProps as IntlayerClientProviderProps } from 'react-intlayer';\nimport {\n IntlayerServerProvider,\n type IntlayerServerProviderProps,\n} from 'react-intlayer/server';\nimport { IntlayerClientProvider } from '../client/IntlayerClientProvider';\n\nexport type IntlayerProviderProps = IntlayerClientProviderProps &\n IntlayerServerProviderProps;\n\n/**\n * Unified Intlayer provider for the Next.js App Router.\n *\n * Server component that seeds the request-scoped server context (locale and\n * ambient variant) read by the server hooks, and mounts the client provider so\n * client components receive the same values — one provider for both halves.\n *\n * Mount it once, in the locale layout:\n *\n * ```tsx\n * import { IntlayerProvider } from 'next-intlayer/server';\n *\n * const LocaleLayout: NextLayoutIntlayer = async ({ children, params }) => {\n * const { locale } = await params;\n *\n * return (\n * <IntlayerProvider locale={locale}>\n * <html lang={locale}>\n * <body>{children}</body>\n * </html>\n * </IntlayerProvider>\n * );\n * };\n * ```\n *\n * The server context is request-scoped, not tree-scoped: on client-side\n * navigations that only re-render the page segment, the layout — and with it\n * this provider — does not re-run. The server hooks then fall back to the\n * locale carried by the request (the `x-intlayer-locale` header set by the\n * intlayer proxy, then the locale cookie), so content stays correct without a\n * per-page provider. The ambient `variant` has no request-carried fallback:\n * seed it per request with `setVariant` when server components read it outside\n * a full render of this provider.\n */\nexport const IntlayerProvider: FC<IntlayerProviderProps> = ({\n children,\n locale,\n variant,\n ...clientProps\n}) => (\n <IntlayerServerProvider locale={locale} variant={variant}>\n <IntlayerClientProvider locale={locale} variant={variant} {...clientProps}>\n {children}\n </IntlayerClientProvider>\n </IntlayerServerProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,oBAA+C,EAC1D,UACA,QACA,SACA,GAAG,kBAEH,oBAAC,wBAAD;CAAgC;CAAiB;WAC/C,oBAAC,wBAAD;EAAgC;EAAiB;EAAS,GAAI;EAC3D;CACqB;AACF"}
@@ -2,12 +2,24 @@ import { IntlayerServerProvider as IntlayerServerProvider$1 } from "react-intlay
2
2
 
3
3
  //#region src/server/IntlayerServerProvider.ts
4
4
  /**
5
- * @deprecated Mount `IntlayerProvider` from `next-intlayer/server` once in the
6
- * locale layout instead it seeds both the server context and the client
7
- * provider, and the server hooks fall back to the locale carried by the
8
- * request when the layout is skipped on client-side navigations. For a page
9
- * that must seed the locale itself (statically rendered routes on
10
- * Next.js < 16), use the imperative `setLocale` instead of wrapping the tree.
5
+ * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead and
6
+ * in most trees, no replacement at all. Mounting `IntlayerProvider` once in the
7
+ * locale layout already seeds both the server context and the client provider
8
+ * for every page below it, and the server hooks fall back to the locale carried
9
+ * by the request when the layout is skipped on client-side navigations. This
10
+ * component's only remaining use is a page that must seed the locale itself
11
+ * (statically rendered routes on Next.js < 16); prefer the imperative
12
+ * `setLocale` over wrapping the tree even there.
13
+ *
14
+ * ```tsx
15
+ * import { IntlayerProvider } from 'next-intlayer/server';
16
+ *
17
+ * const LocaleLayout = async ({ children, params }) => {
18
+ * const { locale } = await params;
19
+ *
20
+ * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;
21
+ * };
22
+ * ```
11
23
  */
12
24
  const IntlayerServerProvider = IntlayerServerProvider$1;
13
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerServerProvider.mjs","names":["IntlayerServerProviderBase"],"sources":["../../../src/server/IntlayerServerProvider.ts"],"sourcesContent":["import { IntlayerServerProvider as IntlayerServerProviderBase } from 'react-intlayer/server';\n\n/**\n * @deprecated Mount `IntlayerProvider` from `next-intlayer/server` once in the\n * locale layout instead — it seeds both the server context and the client\n * provider, and the server hooks fall back to the locale carried by the\n * request when the layout is skipped on client-side navigations. For a page\n * that must seed the locale itself (statically rendered routes on\n * Next.js < 16), use the imperative `setLocale` instead of wrapping the tree.\n */\nexport const IntlayerServerProvider = IntlayerServerProviderBase;\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,yBAAyBA"}
1
+ {"version":3,"file":"IntlayerServerProvider.mjs","names":["IntlayerServerProviderBase"],"sources":["../../../src/server/IntlayerServerProvider.ts"],"sourcesContent":["import {\n IntlayerServerProvider as IntlayerServerProviderBase,\n type IntlayerServerProviderProps as IntlayerServerProviderPropsBase,\n} from 'react-intlayer/server';\n\n/**\n * @deprecated Use `IntlayerProviderProps` from `next-intlayer/server` instead.\n */\nexport type IntlayerServerProviderProps = IntlayerServerProviderPropsBase;\n\n/**\n * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead — and\n * in most trees, no replacement at all. Mounting `IntlayerProvider` once in the\n * locale layout already seeds both the server context and the client provider\n * for every page below it, and the server hooks fall back to the locale carried\n * by the request when the layout is skipped on client-side navigations. This\n * component's only remaining use is a page that must seed the locale itself\n * (statically rendered routes on Next.js < 16); prefer the imperative\n * `setLocale` over wrapping the tree even there.\n *\n * ```tsx\n * import { IntlayerProvider } from 'next-intlayer/server';\n *\n * const LocaleLayout = async ({ children, params }) => {\n * const { locale } = await params;\n *\n * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;\n * };\n * ```\n */\nexport const IntlayerServerProvider = IntlayerServerProviderBase;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,yBAAyBA"}
@@ -1,32 +1,38 @@
1
1
  import { FC } from "react";
2
2
  import { IntlayerProviderProps } from "react-intlayer";
3
3
  //#region src/client/IntlayerClientProvider.d.ts
4
+ /**
5
+ * @deprecated Use `IntlayerProviderProps` from `next-intlayer/server` instead.
6
+ */
4
7
  type IntlayerClientProviderProps = IntlayerProviderProps;
5
8
  /**
6
- * Provider for client-side components in Next.js.
9
+ * Client boundary mounted by the unified `IntlayerProvider`.
7
10
  *
8
- * This component wraps the `IntlayerProvider` from `react-intlayer` and is intended
9
- * to be used within Next.js App Router client components.
11
+ * Wraps the `IntlayerProvider` from `react-intlayer` so that client components
12
+ * rendered below a Next.js App Router server component receive the locale and
13
+ * the ambient variant through context.
10
14
  *
11
15
  * @param props - The provider props.
12
16
  * @returns The provider component.
17
+ */
18
+ declare const IntlayerClientProviderBase: FC<IntlayerProviderProps>;
19
+ /**
20
+ * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead.
21
+ * Mounted once in the locale layout, it seeds the request-scoped server
22
+ * context *and* mounts this client provider, so a single provider covers both
23
+ * halves of the tree:
13
24
  *
14
- * @example
15
25
  * ```tsx
16
- * 'use client';
26
+ * import { IntlayerProvider } from 'next-intlayer/server';
17
27
  *
18
- * import { IntlayerClientProvider } from 'next-intlayer';
28
+ * const LocaleLayout = async ({ children, params }) => {
29
+ * const { locale } = await params;
19
30
  *
20
- * export default function ClientLayout({ children, locale }) {
21
- * return (
22
- * <IntlayerClientProvider locale={locale}>
23
- * {children}
24
- * </IntlayerClientProvider>
25
- * );
26
- * }
31
+ * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;
32
+ * };
27
33
  * ```
28
34
  */
29
35
  declare const IntlayerClientProvider: FC<IntlayerProviderProps>;
30
36
  //#endregion
31
- export { IntlayerClientProvider, IntlayerClientProviderProps };
37
+ export { IntlayerClientProvider, IntlayerClientProviderBase, IntlayerClientProviderProps };
32
38
  //# sourceMappingURL=IntlayerClientProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerClientProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"mappings":";;;KAMY,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;cA0B7B,wBAAwB,GAAG"}
1
+ {"version":3,"file":"IntlayerClientProvider.d.ts","names":[],"sources":["../../../src/client/IntlayerClientProvider.tsx"],"mappings":";;;;;;KASY,8BAA8B;;;;;;;;;;;cAY7B,4BAA4B,GAAG;;;;;;;;;;;;;;;;;cAoB/B,wBAAsB,GAAA"}
@@ -8,7 +8,7 @@ import { generateStaticParams } from "./generateStaticParams.js";
8
8
  import { LocalParams, LocalPromiseParams, Next14LayoutIntlayer, Next14PageIntlayer, Next15LayoutIntlayer, Next15PageIntlayer, NextLayoutIntlayer, NextPageIntlayer } from "./types/NextPage.js";
9
9
  import "./types/index.js";
10
10
  import { index_d_exports } from "./markdown/index.js";
11
- import { IntlayerClientContext, IntlayerNode, IntlayerProvider, IntlayerProviderProps, getDictionary, getIntlayer, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocaleCookie, useLocaleStorage } from "react-intlayer";
11
+ import { ConversionParams, ExperimentState, IntlayerClientContext, IntlayerNode, IntlayerProvider, IntlayerProviderProps, getDictionary, getIntlayer, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, t, useConversion, useDictionary, useDictionaryAsync, useDictionaryDynamic, useExperiment, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocaleCookie, useLocaleStorage } from "react-intlayer";
12
12
  //#region src/index.d.ts
13
13
  /**
14
14
  * @deprecated import from next-intlayer/markdown instead
@@ -52,5 +52,5 @@ type RenderMarkdownProps = index_d_exports.RenderMarkdownProps;
52
52
  */
53
53
  type MarkdownRendererProps = index_d_exports.MarkdownRendererProps;
54
54
  //#endregion
55
- export { IntlayerClientContext, IntlayerClientProvider, type IntlayerClientProviderProps, type IntlayerNode, IntlayerProvider, type IntlayerProviderProps, type LocalParams, type LocalPromiseParams, MarkdownProvider, MarkdownProviderOptions, MarkdownRenderer, MarkdownRendererProps, type Next14LayoutIntlayer, type Next14PageIntlayer, type Next15LayoutIntlayer, type Next15PageIntlayer, type NextLayoutIntlayer, type NextPageIntlayer, RenderMarkdownProps, generateStaticParams, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, useLocaleCookie, useLocalePageRouter, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, usePathname, useRewriteURL };
55
+ export { type ConversionParams, type ExperimentState, IntlayerClientContext, IntlayerClientProvider, type IntlayerClientProviderProps, type IntlayerNode, IntlayerProvider, type IntlayerProviderProps, type LocalParams, type LocalPromiseParams, MarkdownProvider, MarkdownProviderOptions, MarkdownRenderer, MarkdownRendererProps, type Next14LayoutIntlayer, type Next14PageIntlayer, type Next15LayoutIntlayer, type Next15PageIntlayer, type NextLayoutIntlayer, type NextPageIntlayer, RenderMarkdownProps, generateStaticParams, getDictionary, getIntlayer, localeCookie, localeInStorage, renderMarkdown, setLocaleCookie, setLocaleInStorage, t, useConversion, useDictionary, useDictionaryAsync, useDictionaryDynamic, useExperiment, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, useLocaleCookie, useLocalePageRouter, useLocaleStorage, useMarkdownContext, useMarkdownRenderer, usePathname, useRewriteURL };
56
56
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;cAmDa,kCAAgB,GAAA,gBAAA;;;;;;;;;;cAIhB;;;;;;;KAID,0BAA0B,gBAAA;;;;cAIzB,iBAAc,oDAAA,kBAAA,YAAA,SAAA,YAAA,aAAA,qBAAA,cAAA,gBAAA,wCAAA,IAAA;;;;cAId,wBAAmB,YAAA,SAAA,YAAA,aAAA,qBAAA,cAAA,gBAAA,yBAAA,oDAAA,wEAAA,IAAA,UAAA,yBAAA,aAAA,wBAAA;;;;cAInB,kCAAgB,GAAA,gBAAA;;;;KAIjB,sBAAsB,gBAAA;;;;KAItB,wBAAwB,gBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;cAuDa,kCAAgB,GAAA,gBAAA;;;;;;;;;;cAIhB;;;;;;;KAID,0BAA0B,gBAAA;;;;cAIzB,iBAAc,oDAAA,kBAAA,YAAA,SAAA,YAAA,aAAA,qBAAA,cAAA,gBAAA,wCAAA,IAAA;;;;cAId,wBAAmB,YAAA,SAAA,YAAA,aAAA,qBAAA,cAAA,gBAAA,yBAAA,oDAAA,wEAAA,IAAA,UAAA,yBAAA,aAAA,wBAAA;;;;cAInB,kCAAgB,GAAA,gBAAA;;;;KAIjB,sBAAsB,gBAAA;;;;KAItB,wBAAwB,gBAAA"}
@@ -1,8 +1,8 @@
1
- import { IntlayerClientProviderProps } from "../client/IntlayerClientProvider.js";
2
1
  import { FC } from "react";
2
+ import { IntlayerProviderProps as IntlayerProviderProps$1 } from "react-intlayer";
3
3
  import { IntlayerServerProviderProps } from "react-intlayer/server";
4
4
  //#region src/server/IntlayerProvider.d.ts
5
- type IntlayerProviderProps = IntlayerClientProviderProps & IntlayerServerProviderProps;
5
+ type IntlayerProviderProps = IntlayerProviderProps$1 & IntlayerServerProviderProps;
6
6
  /**
7
7
  * Unified Intlayer provider for the Next.js App Router.
8
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerProvider.d.ts","names":[],"sources":["../../../src/server/IntlayerProvider.tsx"],"mappings":";;;;KAUY,wBAAwB,8BAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoCW,kBAAkB,GAAG"}
1
+ {"version":3,"file":"IntlayerProvider.d.ts","names":[],"sources":["../../../src/server/IntlayerProvider.tsx"],"mappings":";;;;KAQY,wBAAwB,0BAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoCW,kBAAkB,GAAG"}
@@ -1,13 +1,30 @@
1
+ import { IntlayerServerProviderProps as IntlayerServerProviderProps$1 } from "react-intlayer/server";
1
2
  //#region src/server/IntlayerServerProvider.d.ts
2
3
  /**
3
- * @deprecated Mount `IntlayerProvider` from `next-intlayer/server` once in the
4
- * locale layout instead — it seeds both the server context and the client
5
- * provider, and the server hooks fall back to the locale carried by the
6
- * request when the layout is skipped on client-side navigations. For a page
7
- * that must seed the locale itself (statically rendered routes on
8
- * Next.js < 16), use the imperative `setLocale` instead of wrapping the tree.
4
+ * @deprecated Use `IntlayerProviderProps` from `next-intlayer/server` instead.
9
5
  */
10
- declare const IntlayerServerProvider: import("react").FC<import("react-intlayer/server").IntlayerServerProviderProps>;
6
+ type IntlayerServerProviderProps = IntlayerServerProviderProps$1;
7
+ /**
8
+ * @deprecated Use `IntlayerProvider` from `next-intlayer/server` instead — and
9
+ * in most trees, no replacement at all. Mounting `IntlayerProvider` once in the
10
+ * locale layout already seeds both the server context and the client provider
11
+ * for every page below it, and the server hooks fall back to the locale carried
12
+ * by the request when the layout is skipped on client-side navigations. This
13
+ * component's only remaining use is a page that must seed the locale itself
14
+ * (statically rendered routes on Next.js < 16); prefer the imperative
15
+ * `setLocale` over wrapping the tree even there.
16
+ *
17
+ * ```tsx
18
+ * import { IntlayerProvider } from 'next-intlayer/server';
19
+ *
20
+ * const LocaleLayout = async ({ children, params }) => {
21
+ * const { locale } = await params;
22
+ *
23
+ * return <IntlayerProvider locale={locale}>{children}</IntlayerProvider>;
24
+ * };
25
+ * ```
26
+ */
27
+ declare const IntlayerServerProvider: import("react").FC<IntlayerServerProviderProps$1>;
11
28
  //#endregion
12
- export { IntlayerServerProvider };
29
+ export { IntlayerServerProvider, IntlayerServerProviderProps };
13
30
  //# sourceMappingURL=IntlayerServerProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntlayerServerProvider.d.ts","names":[],"sources":["../../../src/server/IntlayerServerProvider.ts"],"mappings":";;;;;;;;;cAUa,wCAAsB,mCAAA"}
1
+ {"version":3,"file":"IntlayerServerProvider.d.ts","names":[],"sources":["../../../src/server/IntlayerServerProvider.ts"],"mappings":";;;;;KAQY,8BAA8B;;;;;;;;;;;;;;;;;;;;;cAsB7B,wCAAsB,GAAA"}
@@ -7,8 +7,8 @@ import { useI18n } from "./useI18n.js";
7
7
  import { useIntl } from "./useIntl.js";
8
8
  import { useIntlayer } from "./useIntlayer.js";
9
9
  import { UseLocaleResult, useLocale } from "./useLocale.js";
10
- import { IntlayerServerProvider } from "./IntlayerServerProvider.js";
10
+ import { IntlayerServerProvider, IntlayerServerProviderProps } from "./IntlayerServerProvider.js";
11
11
  import { getLocale } from "./getLocale.js";
12
12
  import { withIntlayer, withIntlayerSync } from "./withIntlayer.js";
13
- import { IntlayerServerProviderProps, getServerContext, locale, setLocale, setVariant, useLoadDynamic } from "react-intlayer/server";
13
+ import { getServerContext, locale, setLocale, setVariant, useLoadDynamic } from "react-intlayer/server";
14
14
  export { IntlayerProvider, type IntlayerProviderProps, IntlayerServerProvider, type IntlayerServerProviderProps, type UseLocaleResult, getLocale, getServerContext, locale, setLocale, setVariant, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale, withIntlayer, withIntlayerSync };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intlayer",
3
- "version": "9.4.0-canary.0",
3
+ "version": "9.4.1",
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": [
@@ -138,18 +138,18 @@
138
138
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
139
139
  },
140
140
  "dependencies": {
141
- "@intlayer/config": "9.4.0-canary.0",
142
- "@intlayer/core": "9.4.0-canary.0",
143
- "@intlayer/dictionaries-entry": "9.4.0-canary.0",
144
- "@intlayer/engine": "9.4.0-canary.0",
145
- "@intlayer/types": "9.4.0-canary.0",
146
- "@intlayer/webpack": "9.4.0-canary.0",
141
+ "@intlayer/config": "9.4.1",
142
+ "@intlayer/core": "9.4.1",
143
+ "@intlayer/dictionaries-entry": "9.4.1",
144
+ "@intlayer/engine": "9.4.1",
145
+ "@intlayer/types": "9.4.1",
146
+ "@intlayer/webpack": "9.4.1",
147
147
  "defu": "6.1.7",
148
148
  "node-loader": "2.1.0",
149
- "react-intlayer": "9.4.0-canary.0"
149
+ "react-intlayer": "9.4.1"
150
150
  },
151
151
  "devDependencies": {
152
- "@types/node": "26.2.0",
152
+ "@types/node": "26.3.0",
153
153
  "@types/react": ">=16.0.0",
154
154
  "@types/react-dom": ">=16.0.0",
155
155
  "@utils/ts-config": "1.0.4",