next-intl 3.26.3 → 3.26.5
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/development/navigation/shared/createSharedNavigationFns.js +8 -3
- package/dist/development/server/react-server/RequestLocale.js +2 -1
- package/dist/development/server/react-server/getConfig.js +2 -1
- package/dist/development/shared/utils.js +5 -0
- package/dist/esm/navigation/shared/createSharedNavigationFns.js +1 -1
- package/dist/esm/server/react-server/RequestLocale.js +1 -1
- package/dist/esm/server/react-server/getConfig.js +1 -1
- package/dist/esm/shared/utils.js +1 -1
- package/dist/production/navigation/shared/createSharedNavigationFns.js +1 -1
- package/dist/production/server/react-server/RequestLocale.js +1 -1
- package/dist/production/server/react-server/getConfig.js +1 -1
- package/dist/production/shared/utils.js +1 -1
- package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +1 -1
- package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +1 -1
- package/dist/types/src/shared/utils.d.ts +1 -0
- package/package.json +3 -3
|
@@ -37,9 +37,10 @@ function createSharedNavigationFns(getLocale, routing) {
|
|
|
37
37
|
locale,
|
|
38
38
|
...rest
|
|
39
39
|
} = _ref;
|
|
40
|
-
let pathname, params;
|
|
40
|
+
let pathname, params, query;
|
|
41
41
|
if (typeof href === 'object') {
|
|
42
42
|
pathname = href.pathname;
|
|
43
|
+
query = href.query;
|
|
43
44
|
// @ts-expect-error -- This is ok
|
|
44
45
|
params = href.params;
|
|
45
46
|
} else {
|
|
@@ -49,7 +50,7 @@ function createSharedNavigationFns(getLocale, routing) {
|
|
|
49
50
|
// @ts-expect-error -- This is ok
|
|
50
51
|
const isLocalizable = utils$1.isLocalizableHref(href);
|
|
51
52
|
const localePromiseOrValue = getLocale();
|
|
52
|
-
const curLocale = localePromiseOrValue
|
|
53
|
+
const curLocale = utils$1.isPromise(localePromiseOrValue) ? React.use(localePromiseOrValue) : localePromiseOrValue;
|
|
53
54
|
const finalPathname = isLocalizable ? getPathname(
|
|
54
55
|
// @ts-expect-error -- This is ok
|
|
55
56
|
{
|
|
@@ -85,8 +86,12 @@ function createSharedNavigationFns(getLocale, routing) {
|
|
|
85
86
|
// @ts-expect-error -- This is ok
|
|
86
87
|
{
|
|
87
88
|
locale: curLocale,
|
|
88
|
-
href: pathnames == null ?
|
|
89
|
+
href: pathnames == null ? {
|
|
89
90
|
pathname,
|
|
91
|
+
query
|
|
92
|
+
} : {
|
|
93
|
+
pathname,
|
|
94
|
+
query,
|
|
90
95
|
params
|
|
91
96
|
}
|
|
92
97
|
}, false)
|
|
@@ -5,13 +5,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var headers = require('next/headers');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var constants = require('../../shared/constants.js');
|
|
8
|
+
var utils = require('../../shared/utils.js');
|
|
8
9
|
var RequestLocaleCache = require('./RequestLocaleCache.js');
|
|
9
10
|
|
|
10
11
|
async function getHeadersImpl() {
|
|
11
12
|
const promiseOrValue = headers.headers();
|
|
12
13
|
|
|
13
14
|
// Compatibility with Next.js <15
|
|
14
|
-
return promiseOrValue
|
|
15
|
+
return utils.isPromise(promiseOrValue) ? await promiseOrValue : promiseOrValue;
|
|
15
16
|
}
|
|
16
17
|
const getHeaders = React.cache(getHeadersImpl);
|
|
17
18
|
async function getLocaleFromHeaderImpl() {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var navigation = require('next/navigation');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var core = require('use-intl/core');
|
|
8
|
+
var utils = require('../../shared/utils.js');
|
|
8
9
|
var RequestLocale = require('./RequestLocale.js');
|
|
9
10
|
var RequestLocaleLegacy = require('./RequestLocaleLegacy.js');
|
|
10
11
|
var getRuntimeConfig = require('next-intl/config');
|
|
@@ -48,7 +49,7 @@ async function receiveRuntimeConfigImpl(getConfig, localeOverride) {
|
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
let result = getConfig(params);
|
|
51
|
-
if (result
|
|
52
|
+
if (utils.isPromise(result)) {
|
|
52
53
|
result = await result;
|
|
53
54
|
}
|
|
54
55
|
let locale = result.locale;
|
|
@@ -156,12 +156,17 @@ function comparePathnamePairs(a, b) {
|
|
|
156
156
|
function getSortedPathnames(pathnames) {
|
|
157
157
|
return pathnames.sort(comparePathnamePairs);
|
|
158
158
|
}
|
|
159
|
+
function isPromise(value) {
|
|
160
|
+
// https://github.com/amannn/next-intl/issues/1711
|
|
161
|
+
return typeof value.then === 'function';
|
|
162
|
+
}
|
|
159
163
|
|
|
160
164
|
exports.getLocaleAsPrefix = getLocaleAsPrefix;
|
|
161
165
|
exports.getLocalePrefix = getLocalePrefix;
|
|
162
166
|
exports.getSortedPathnames = getSortedPathnames;
|
|
163
167
|
exports.hasPathnamePrefixed = hasPathnamePrefixed;
|
|
164
168
|
exports.isLocalizableHref = isLocalizableHref;
|
|
169
|
+
exports.isPromise = isPromise;
|
|
165
170
|
exports.localizeHref = localizeHref;
|
|
166
171
|
exports.matchesPathname = matchesPathname;
|
|
167
172
|
exports.normalizeTrailingSlash = normalizeTrailingSlash;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{redirect as o,permanentRedirect as a}from"next/navigation";import t,{forwardRef as n,use as r}from"react";import{receiveRoutingConfig as l}from"../../routing/config.js";import{isLocalizableHref as i}from"../../shared/utils.js";import
|
|
1
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{redirect as o,permanentRedirect as a}from"next/navigation";import t,{forwardRef as n,use as r}from"react";import{receiveRoutingConfig as l}from"../../routing/config.js";import{isLocalizableHref as i,isPromise as m}from"../../shared/utils.js";import c from"./BaseLink.js";import{validateReceivedConfig as u,serializeSearchParams as f,compileLocalizedPathname as s,applyPathnamePrefix as p,normalizeNameOrNameWithParams as d}from"./utils.js";function h(h,y){const j=l(y||{});u(j);const g=j.pathnames,v="as-needed"===j.localePrefix.mode&&j.domains||void 0;function q(o,a){let n,l,u,{href:f,locale:s,...p}=o;"object"==typeof f?(n=f.pathname,u=f.query,l=f.params):n=f;const d=i(f),y=h(),q=m(y)?r(y):y,x=d?L({locale:s||q,href:null==g?n:{pathname:n,params:l}},null!=s||v||void 0):n;return t.createElement(c,e({ref:a,defaultLocale:j.defaultLocale,href:"object"==typeof f?{...f,pathname:x}:x,locale:s,localeCookie:j.localeCookie,unprefixed:v&&d?{domains:j.domains.reduce(((e,o)=>(e[o.domain]=o.defaultLocale,e)),{}),pathname:L({locale:q,href:null==g?{pathname:n,query:u}:{pathname:n,query:u,params:l}},!1)}:void 0},p))}const x=n(q);function L(e,o){const{href:a,locale:t}=e;let n;return null==g?"object"==typeof a?(n=a.pathname,a.query&&(n+=f(a.query))):n=a:n=s({locale:t,...d(a),pathnames:j.pathnames}),p(n,t,j,e.domain,o)}function b(e){return function(o){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];return e(L(o,o.domain?void 0:v),...t)}}const k=b(o),P=b(a);return{config:j,Link:x,redirect:k,permanentRedirect:P,getPathname:L}}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headers as t}from"next/headers";import{cache as e}from"react";import{HEADER_LOCALE_NAME as n}from"../../shared/constants.js";import{
|
|
1
|
+
import{headers as t}from"next/headers";import{cache as e}from"react";import{HEADER_LOCALE_NAME as n}from"../../shared/constants.js";import{isPromise as r}from"../../shared/utils.js";import{getCachedRequestLocale as o}from"./RequestLocaleCache.js";const i=e((async function(){const e=t();return r(e)?await e:e}));const s=e((async function(){let t;try{t=(await i()).get(n)||void 0}catch(t){if(t instanceof Error&&"DYNAMIC_SERVER_USAGE"===t.digest){const e=new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl.dev/docs/getting-started/app-router/with-i18n-routing#static-rendering",{cause:t});throw e.digest=t.digest,e}throw t}return t}));async function a(){return o()||await s()}export{a as getRequestLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{notFound as e}from"next/navigation";import{cache as t}from"react";import{_createIntlFormatters as n,_createCache as o,initializeConfig as r}from"use-intl/core";import{
|
|
1
|
+
import{notFound as e}from"next/navigation";import{cache as t}from"react";import{_createIntlFormatters as n,_createCache as o,initializeConfig as r}from"use-intl/core";import{isPromise as i}from"../../shared/utils.js";import{getRequestLocale as a}from"./RequestLocale.js";import{getRequestLocale as l}from"./RequestLocaleLegacy.js";import s from"next-intl/config";let c=!1,u=!1;const f=t((function(){return new Date}));const d=t((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const m=t((async function(t,n){if("function"!=typeof t)throw new Error("Invalid i18n request configuration detected.\n\nPlease verify that:\n1. In case you've specified a custom location in your Next.js config, make sure that the path is correct.\n2. You have a default export in your i18n request configuration file.\n\nSee also: https://next-intl.dev/docs/usage/configuration#i18n-request\n");const o={get locale(){return u||(console.warn("\nThe `locale` parameter in `getRequestConfig` is deprecated, please switch to `await requestLocale`. See https://next-intl.dev/blog/next-intl-3-22#await-request-locale\n"),u=!0),n||l()},get requestLocale(){return n?Promise.resolve(n):a()}};let r=t(o);i(r)&&(r=await r);let s=r.locale;return s||(c||(console.error("\nA `locale` is expected to be returned from `getRequestConfig`, but none was returned. This will be an error in the next major version of next-intl.\n\nSee: https://next-intl.dev/blog/next-intl-3-22#await-request-locale\n"),c=!0),s=await o.requestLocale,s||(console.error("\nUnable to find `next-intl` locale because the middleware didn't run on this request and no `locale` was returned in `getRequestConfig`. See https://next-intl.dev/docs/routing/middleware#unable-to-find-locale. The `notFound()` function will be called as a result.\n"),e())),{...r,locale:s,now:r.now||f(),timeZone:r.timeZone||d()}})),p=t(n),g=t(o);const w=t((async function(e){const t=await m(s,e);return{...r(t),_formatters:p(g())}}));export{w as default};
|
package/dist/esm/shared/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n){return function(n){return"object"==typeof n?null==n.host&&null==n.hostname:!/^[a-z]+:/i.test(n)}(n)&&!function(n){const t="object"==typeof n?n.pathname:n;return null!=t&&!t.startsWith("/")}(n)}function t(t,r){let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,
|
|
1
|
+
function n(n){return function(n){return"object"==typeof n?null==n.host&&null==n.hostname:!/^[a-z]+:/i.test(n)}(n)&&!function(n){const t="object"==typeof n?n.pathname:n;return null!=t&&!t.startsWith("/")}(n)}function t(t,r){let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0;if(!n(t))return t;const f=r!==u,l=i(c,o);return(f||l)&&null!=c?e(t,c):t}function e(n,t){let e;return"string"==typeof n?e=u(t,n):(e={...n},n.pathname&&(e.pathname=u(t,n.pathname))),e}function r(n,t){return n.replace(new RegExp("^".concat(t)),"")||"/"}function u(n,t){let e=n;return/^\/(\?.*)?$/.test(t)&&(t=t.slice(1)),e+=t,e}function i(n,t){return t===n||t.startsWith("".concat(n,"/"))}function o(n){const t=function(){try{return"true"===process.env._next_intl_trailing_slash}catch(n){return!1}}();if("/"!==n){const e=n.endsWith("/");t&&!e?n+="/":!t&&e&&(n=n.slice(0,-1))}return n}function c(n,t){const e=o(n),r=o(t);return s(e).test(r)}function f(n,t){var e;return"never"!==t.mode&&(null===(e=t.prefixes)||void 0===e?void 0:e[n])||l(n)}function l(n){return"/"+n}function s(n){const t=n.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp("^".concat(t,"$"))}function a(n){return n.includes("[[...")}function p(n){return n.includes("[...")}function h(n){return n.includes("[")}function g(n,t){const e=n.split("/"),r=t.split("/"),u=Math.max(e.length,r.length);for(let n=0;n<u;n++){const t=e[n],u=r[n];if(!t&&u)return-1;if(t&&!u)return 1;if(t||u){if(!h(t)&&h(u))return-1;if(h(t)&&!h(u))return 1;if(!p(t)&&p(u))return-1;if(p(t)&&!p(u))return 1;if(!a(t)&&a(u))return-1;if(a(t)&&!a(u))return 1}}return 0}function d(n){return n.sort(g)}function v(n){return"function"==typeof n.then}export{l as getLocaleAsPrefix,f as getLocalePrefix,d as getSortedPathnames,i as hasPathnamePrefixed,n as isLocalizableHref,v as isPromise,t as localizeHref,c as matchesPathname,o as normalizeTrailingSlash,e as prefixHref,u as prefixPathname,s as templateToRegex,r as unprefixPathname};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("next/navigation"),r=require("react"),t=require("../../routing/config.js"),n=require("../../shared/utils.js"),o=require("./BaseLink.js"),i=require("./utils.js");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r);exports.default=function(l,c){const s=t.receiveRoutingConfig(c||{}),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("next/navigation"),r=require("react"),t=require("../../routing/config.js"),n=require("../../shared/utils.js"),o=require("./BaseLink.js"),i=require("./utils.js");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r);exports.default=function(l,c){const s=t.receiveRoutingConfig(c||{}),d=s.pathnames,f="as-needed"===s.localePrefix.mode&&s.domains||void 0;function m(a,t){let i,c,m,{href:p,locale:q,...v}=a;"object"==typeof p?(i=p.pathname,m=p.query,c=p.params):i=p;const y=n.isLocalizableHref(p),P=l(),g=n.isPromise(P)?r.use(P):P,j=y?h({locale:q||g,href:null==d?i:{pathname:i,params:c}},null!=q||f||void 0):i;return u.default.createElement(o.default,e.extends({ref:t,defaultLocale:s.defaultLocale,href:"object"==typeof p?{...p,pathname:j}:j,locale:q,localeCookie:s.localeCookie,unprefixed:f&&y?{domains:s.domains.reduce(((e,a)=>(e[a.domain]=a.defaultLocale,e)),{}),pathname:h({locale:g,href:null==d?{pathname:i,query:m}:{pathname:i,query:m,params:c}},!1)}:void 0},v))}const p=r.forwardRef(m);function h(e,a){const{href:r,locale:t}=e;let n;return null==d?"object"==typeof r?(n=r.pathname,r.query&&(n+=i.serializeSearchParams(r.query))):n=r:n=i.compileLocalizedPathname({locale:t,...i.normalizeNameOrNameWithParams(r),pathnames:s.pathnames}),i.applyPathnamePrefix(n,t,s,e.domain,a)}function q(e){return function(a){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return e(h(a,a.domain?void 0:f),...t)}}const v=q(a.redirect),y=q(a.permanentRedirect);return{config:s,Link:p,redirect:v,permanentRedirect:y,getPathname:h}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("react"),r=require("../../shared/constants.js"),s=require("../../shared/utils.js"),n=require("./RequestLocaleCache.js");const i=t.cache((async function(){const t=e.headers();return s.isPromise(t)?await t:t}));const a=t.cache((async function(){let e;try{e=(await i()).get(r.HEADER_LOCALE_NAME)||void 0}catch(e){if(e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest){const t=new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl.dev/docs/getting-started/app-router/with-i18n-routing#static-rendering",{cause:e});throw t.digest=e.digest,t}throw e}return e}));exports.getRequestLocale=async function(){return n.getCachedRequestLocale()||await a()};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("use-intl/core"),n=require("../../shared/utils.js"),o=require("./RequestLocale.js"),a=require("./RequestLocaleLegacy.js");function c(e){return e&&e.__esModule?e:{default:e}}var i=c(require("next-intl/config"));const u=t.cache((function(){return new Date}));const s=t.cache((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const l=t.cache((async function(t,r){const c={get locale(){return r||a.getRequestLocale()},get requestLocale(){return r?Promise.resolve(r):o.getRequestLocale()}};let i=t(c);n.isPromise(i)&&(i=await i);let l=i.locale;return l||(l=await c.requestLocale,l||e.notFound()),{...i,locale:l,now:i.now||u(),timeZone:i.timeZone||s()}})),q=t.cache(r._createIntlFormatters),f=t.cache(r._createCache);const d=t.cache((async function(e){const t=await l(i.default,e);return{...r.initializeConfig(t),_formatters:q(f())}}));exports.default=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t){return function(t){return"object"==typeof t?null==t.host&&null==t.hostname:!/^[a-z]+:/i.test(t)}(t)&&!function(t){const e="object"==typeof t?t.pathname:t;return null!=e&&!e.startsWith("/")}(t)}function e(t,e){let r;return"string"==typeof t?r=n(e,t):(r={...t},t.pathname&&(r.pathname=n(e,t.pathname))),r}function n(t,e){let n=t;return/^\/(\?.*)?$/.test(e)&&(e=e.slice(1)),n+=e,n}function r(t,e){return e===t||e.startsWith("".concat(t,"/"))}function o(t){const e=function(){try{return"true"===process.env._next_intl_trailing_slash}catch(t){return!1}}();if("/"!==t){const n=t.endsWith("/");e&&!n?t+="/":!e&&n&&(t=t.slice(0,-1))}return t}function i(t){return"/"+t}function u(t){const e=t.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp("^".concat(e,"$"))}function
|
|
1
|
+
"use strict";function t(t){return function(t){return"object"==typeof t?null==t.host&&null==t.hostname:!/^[a-z]+:/i.test(t)}(t)&&!function(t){const e="object"==typeof t?t.pathname:t;return null!=e&&!e.startsWith("/")}(t)}function e(t,e){let r;return"string"==typeof t?r=n(e,t):(r={...t},t.pathname&&(r.pathname=n(e,t.pathname))),r}function n(t,e){let n=t;return/^\/(\?.*)?$/.test(e)&&(e=e.slice(1)),n+=e,n}function r(t,e){return e===t||e.startsWith("".concat(t,"/"))}function o(t){const e=function(){try{return"true"===process.env._next_intl_trailing_slash}catch(t){return!1}}();if("/"!==t){const n=t.endsWith("/");e&&!n?t+="/":!e&&n&&(t=t.slice(0,-1))}return t}function i(t){return"/"+t}function u(t){const e=t.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp("^".concat(e,"$"))}function s(t){return t.includes("[[...")}function c(t){return t.includes("[...")}function f(t){return t.includes("[")}function a(t,e){const n=t.split("/"),r=e.split("/"),o=Math.max(n.length,r.length);for(let t=0;t<o;t++){const e=n[t],o=r[t];if(!e&&o)return-1;if(e&&!o)return 1;if(e||o){if(!f(e)&&f(o))return-1;if(f(e)&&!f(o))return 1;if(!c(e)&&c(o))return-1;if(c(e)&&!c(o))return 1;if(!s(e)&&s(o))return-1;if(s(e)&&!s(o))return 1}}return 0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLocaleAsPrefix=i,exports.getLocalePrefix=function(t,e){var n;return"never"!==e.mode&&(null===(n=e.prefixes)||void 0===n?void 0:n[t])||i(t)},exports.getSortedPathnames=function(t){return t.sort(a)},exports.hasPathnamePrefixed=r,exports.isLocalizableHref=t,exports.isPromise=function(t){return"function"==typeof t.then},exports.localizeHref=function(n,o){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,u=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;if(!t(n))return n;const c=o!==i,f=r(s,u);return(c||f)&&null!=s?e(n,s):n},exports.matchesPathname=function(t,e){const n=o(t),r=o(e);return u(n).test(r)},exports.normalizeTrailingSlash=o,exports.prefixHref=e,exports.prefixPathname=n,exports.templateToRegex=u,exports.unprefixPathname=function(t,e){return t.replace(new RegExp("^".concat(e)),"")||"/"};
|
|
@@ -53,7 +53,7 @@ export default function createLocalizedPathnamesNavigation<AppLocales extends Lo
|
|
|
53
53
|
};
|
|
54
54
|
} & {
|
|
55
55
|
ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
|
|
56
|
-
}, "
|
|
56
|
+
}, "href" | "name" | "localePrefix" | "localeCookie"> & {
|
|
57
57
|
href: Pathname extends `${string}[[...${string}` ? Pathname | ({
|
|
58
58
|
pathname: Pathname;
|
|
59
59
|
params?: import("../shared/StrictParams").default<Pathname> | undefined;
|
|
@@ -47,7 +47,7 @@ export default function createLocalizedPathnamesNavigation<AppLocales extends Lo
|
|
|
47
47
|
mode: "as-needed";
|
|
48
48
|
prefixes?: Partial<Record<string, string>> | undefined;
|
|
49
49
|
};
|
|
50
|
-
}, "
|
|
50
|
+
}, "href" | "name" | "localePrefix" | "localeCookie"> & {
|
|
51
51
|
href: Pathname extends `${string}[[...${string}` ? Pathname | ({
|
|
52
52
|
pathname: Pathname;
|
|
53
53
|
params?: import("../shared/StrictParams").default<Pathname> | undefined;
|
|
@@ -21,4 +21,5 @@ export declare function getLocalePrefix<AppLocales extends Locales, AppLocalePre
|
|
|
21
21
|
export declare function getLocaleAsPrefix(locale: string): string;
|
|
22
22
|
export declare function templateToRegex(template: string): RegExp;
|
|
23
23
|
export declare function getSortedPathnames(pathnames: Array<string>): string[];
|
|
24
|
+
export declare function isPromise<Value>(value: Value | Promise<Value>): value is Promise<Value>;
|
|
24
25
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "3.26.
|
|
3
|
+
"version": "3.26.5",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -88,11 +88,11 @@
|
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@formatjs/intl-localematcher": "^0.5.4",
|
|
90
90
|
"negotiator": "^1.0.0",
|
|
91
|
-
"use-intl": "^3.26.
|
|
91
|
+
"use-intl": "^3.26.5"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
95
95
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "663c539ea627e808e2b8ed432db123a9825e5845"
|
|
98
98
|
}
|