next-intl 3.26.4 → 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.
|
@@ -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 {
|
|
@@ -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)
|
|
@@ -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,isPromise as m}from"../../shared/utils.js";import c from"./BaseLink.js";import{validateReceivedConfig as
|
|
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
|
-
"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,{href:
|
|
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}};
|
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
|
}
|