next-intl 4.0.0-beta-1a5e0ec → 4.0.0-beta-4106641
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.
|
@@ -29,9 +29,10 @@ function createSharedNavigationFns(getLocale, routing) {
|
|
|
29
29
|
locale,
|
|
30
30
|
...rest
|
|
31
31
|
}, ref) {
|
|
32
|
-
let pathname, params;
|
|
32
|
+
let pathname, params, query;
|
|
33
33
|
if (typeof href === 'object') {
|
|
34
34
|
pathname = href.pathname;
|
|
35
|
+
query = href.query;
|
|
35
36
|
// @ts-expect-error -- This is ok
|
|
36
37
|
params = href.params;
|
|
37
38
|
} else {
|
|
@@ -76,8 +77,12 @@ function createSharedNavigationFns(getLocale, routing) {
|
|
|
76
77
|
// @ts-expect-error -- This is ok
|
|
77
78
|
{
|
|
78
79
|
locale: curLocale,
|
|
79
|
-
href: pathnames == null ?
|
|
80
|
+
href: pathnames == null ? {
|
|
80
81
|
pathname,
|
|
82
|
+
query
|
|
83
|
+
} : {
|
|
84
|
+
pathname,
|
|
85
|
+
query,
|
|
81
86
|
params
|
|
82
87
|
}
|
|
83
88
|
}, false)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{redirect as e,permanentRedirect as o}from"next/navigation";import{forwardRef as a}from"react";import{receiveRoutingConfig as t}from"../../routing/config.js";import n from"../../shared/use.js";import{isLocalizableHref as r,isPromise as i}from"../../shared/utils.js";import m from"./BaseLink.js";import{serializeSearchParams as l,compileLocalizedPathname as c,applyPathnamePrefix as f,normalizeNameOrNameWithParams as
|
|
1
|
+
import{redirect as e,permanentRedirect as o}from"next/navigation";import{forwardRef as a}from"react";import{receiveRoutingConfig as t}from"../../routing/config.js";import n from"../../shared/use.js";import{isLocalizableHref as r,isPromise as i}from"../../shared/utils.js";import m from"./BaseLink.js";import{serializeSearchParams as l,compileLocalizedPathname as c,applyPathnamePrefix as f,normalizeNameOrNameWithParams as u}from"./utils.js";import{jsx as s}from"react/jsx-runtime";function p(p,d){const h=t(d||{}),j=h.pathnames,y="as-needed"===h.localePrefix.mode&&h.domains||void 0;function g({href:e,locale:o,...a},t){let l,c,f;"object"==typeof e?(l=e.pathname,f=e.query,c=e.params):l=e;const u=r(e),d=p(),g=i(d)?n(d):d,q=u?v({locale:o||g,href:null==j?l:{pathname:l,params:c}},null!=o||y||void 0):l;return s(m,{ref:t,defaultLocale:h.defaultLocale,href:"object"==typeof e?{...e,pathname:q}:q,locale:o,localeCookie:h.localeCookie,unprefixed:y&&u?{domains:h.domains.reduce(((e,o)=>(e[o.domain]=o.defaultLocale,e)),{}),pathname:v({locale:g,href:null==j?{pathname:l,query:f}:{pathname:l,query:f,params:c}},!1)}:void 0,...a})}const q=a(g);function v(e,o){const{href:a,locale:t}=e;let n;return null==j?"object"==typeof a?(n=a.pathname,a.query&&(n+=l(a.query))):n=a:n=c({locale:t,...u(a),pathnames:h.pathnames}),f(n,t,h,e.domain,o)}function x(e){return function(o,...a){return e(v(o,o.domain?void 0:y),...a)}}const L=x(e),k=x(o);return{config:h,Link:q,redirect:L,permanentRedirect:k,getPathname:v}}export{p as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "4.0.0-beta-
|
|
3
|
+
"version": "4.0.0-beta-4106641",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"dependencies": {
|
|
113
113
|
"@formatjs/intl-localematcher": "^0.5.4",
|
|
114
114
|
"negotiator": "^1.0.0",
|
|
115
|
-
"use-intl": "4.0.0-beta-
|
|
115
|
+
"use-intl": "4.0.0-beta-4106641"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"optional": true
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "b8eaa58ecd2088f788d5f4b7510493ce7f850176"
|
|
128
128
|
}
|