next-intl 2.20.0 → 2.20.2
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/client/useRouter.d.ts +3 -3
- package/dist/src/client/useRouter.d.ts +3 -3
- package/dist/src/middleware/getAlternateLinksHeaderValue.js +7 -3
- package/dist/src/middleware/getAlternateLinksHeaderValue.js.map +1 -1
- package/package.json +8 -6
- package/src/middleware/getAlternateLinksHeaderValue.tsx +5 -1
|
@@ -21,9 +21,9 @@ type IntlNavigateOptions = {
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export default function useRouter(): {
|
|
24
|
-
push(href: string, options?: (import("next/dist/shared/lib/app-router-context").NavigateOptions & IntlNavigateOptions) | undefined): void;
|
|
25
|
-
replace(href: string, options?: (import("next/dist/shared/lib/app-router-context").NavigateOptions & IntlNavigateOptions) | undefined): void;
|
|
26
|
-
prefetch(href: string, options?: (import("next/dist/shared/lib/app-router-context").PrefetchOptions & IntlNavigateOptions) | undefined): void;
|
|
24
|
+
push(href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions) | undefined): void;
|
|
25
|
+
replace(href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions) | undefined): void;
|
|
26
|
+
prefetch(href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & IntlNavigateOptions) | undefined): void;
|
|
27
27
|
back(): void;
|
|
28
28
|
forward(): void;
|
|
29
29
|
refresh(): void;
|
|
@@ -21,9 +21,9 @@ type IntlNavigateOptions = {
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export default function useRouter(): {
|
|
24
|
-
push(href: string, options?: (import("next/dist/shared/lib/app-router-context").NavigateOptions & IntlNavigateOptions) | undefined): void;
|
|
25
|
-
replace(href: string, options?: (import("next/dist/shared/lib/app-router-context").NavigateOptions & IntlNavigateOptions) | undefined): void;
|
|
26
|
-
prefetch(href: string, options?: (import("next/dist/shared/lib/app-router-context").PrefetchOptions & IntlNavigateOptions) | undefined): void;
|
|
24
|
+
push(href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions) | undefined): void;
|
|
25
|
+
replace(href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions) | undefined): void;
|
|
26
|
+
prefetch(href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & IntlNavigateOptions) | undefined): void;
|
|
27
27
|
back(): void;
|
|
28
28
|
forward(): void;
|
|
29
29
|
refresh(): void;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { getHost, isLocaleSupportedOnDomain } from './utils';
|
|
2
2
|
function getUnprefixedUrl(config, request) {
|
|
3
|
-
var _a
|
|
3
|
+
var _a;
|
|
4
4
|
const url = new URL(request.url);
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const host = getHost(request.headers);
|
|
6
|
+
if (host) {
|
|
7
|
+
url.port = '';
|
|
8
|
+
url.host = host;
|
|
9
|
+
}
|
|
10
|
+
url.protocol = (_a = request.headers.get('x-forwarded-proto')) !== null && _a !== void 0 ? _a : url.protocol;
|
|
7
11
|
if (!url.pathname.endsWith('/')) {
|
|
8
12
|
url.pathname += '/';
|
|
9
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAlternateLinksHeaderValue.js","sourceRoot":"","sources":["../../../src/middleware/getAlternateLinksHeaderValue.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAE,yBAAyB,EAAC,MAAM,SAAS,CAAC;AAE3D,SAAS,gBAAgB,CAAC,MAAwB,EAAE,OAAoB;;IACtE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,
|
|
1
|
+
{"version":3,"file":"getAlternateLinksHeaderValue.js","sourceRo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CAAC,YAAY,KAAK,QAAQ,EAAE;gBACvE,gBAAgB,CAAC,GAAG,CAAC,CAAC;aACvB;SACF;QAED,OAAO,iBAAiB,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,sBAAsB;IACtB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACnB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;KAC5D;SAAM;QACL,sDAAsD;KACvD;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"description": "A minimal, but complete solution for internationalization in Next.js apps.",
|
|
@@ -68,23 +68,25 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@formatjs/intl-localematcher": "^0.2.32",
|
|
70
70
|
"negotiator": "^0.6.3",
|
|
71
|
-
"use-intl": "^2.20.
|
|
71
|
+
"use-intl": "^2.20.2"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
|
75
75
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
+
"@edge-runtime/vm": "^3.1.3",
|
|
78
79
|
"@size-limit/preset-big-lib": "^8.2.6",
|
|
79
80
|
"@testing-library/react": "^13.0.0",
|
|
80
81
|
"@types/negotiator": "^0.6.1",
|
|
81
82
|
"@types/node": "^17.0.23",
|
|
82
83
|
"@types/react": "^18.2.5",
|
|
83
84
|
"dts-cli": "^1.4.0",
|
|
84
|
-
"eslint": "^8.
|
|
85
|
-
"eslint-config-molindo": "^
|
|
85
|
+
"eslint": "^8.46.0",
|
|
86
|
+
"eslint-config-molindo": "^7.0.0",
|
|
86
87
|
"eslint-plugin-deprecation": "^1.4.1",
|
|
87
|
-
"next": "13.
|
|
88
|
+
"next": "13.5.1",
|
|
89
|
+
"path-to-regexp": "^6.2.1",
|
|
88
90
|
"react": "^18.2.0",
|
|
89
91
|
"react-dom": "^18.2.0",
|
|
90
92
|
"size-limit": "^8.2.6",
|
|
@@ -104,5 +106,5 @@
|
|
|
104
106
|
"engines": {
|
|
105
107
|
"node": ">=10"
|
|
106
108
|
},
|
|
107
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "77334006dc91aa0c0306e189e14775115ca02324"
|
|
108
110
|
}
|
|
@@ -6,7 +6,11 @@ import {getHost, isLocaleSupportedOnDomain} from './utils';
|
|
|
6
6
|
|
|
7
7
|
function getUnprefixedUrl(config: MiddlewareConfig, request: NextRequest) {
|
|
8
8
|
const url = new URL(request.url);
|
|
9
|
-
|
|
9
|
+
const host = getHost(request.headers);
|
|
10
|
+
if (host) {
|
|
11
|
+
url.port = '';
|
|
12
|
+
url.host = host;
|
|
13
|
+
}
|
|
10
14
|
url.protocol = request.headers.get('x-forwarded-proto') ?? url.protocol;
|
|
11
15
|
|
|
12
16
|
if (!url.pathname.endsWith('/')) {
|