next 15.4.0-canary.127 → 15.4.0-canary.129
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/bin/next +1 -1
- package/dist/build/define-env.js +2 -1
- package/dist/build/define-env.js.map +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/components/layout-router.js +3 -3
- package/dist/client/components/layout-router.js.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/index.js.map +1 -1
- package/dist/compiled/next-devtools/index.js +2 -2
- package/dist/compiled/next-devtools/index.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
- package/dist/esm/build/define-env.js +2 -1
- package/dist/esm/build/define-env.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/components/layout-router.js +3 -3
- package/dist/esm/client/components/layout-router.js.map +1 -1
- package/dist/esm/client/index.js +3 -3
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/server/config-schema.js +2 -1
- package/dist/esm/server/config-schema.js.map +1 -1
- package/dist/esm/server/config-shared.js +2 -1
- package/dist/esm/server/config-shared.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/esm/shared/lib/router/router.js +2 -2
- package/dist/esm/shared/lib/router/router.js.map +1 -1
- package/dist/esm/shared/lib/router/utils/disable-smooth-scroll.js +44 -0
- package/dist/esm/shared/lib/router/utils/disable-smooth-scroll.js.map +1 -0
- package/dist/server/config-schema.js +2 -1
- package/dist/server/config-schema.js.map +1 -1
- package/dist/server/config-shared.d.ts +9 -0
- package/dist/server/config-shared.js +2 -1
- package/dist/server/config-shared.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/shared/lib/router/router.js +2 -2
- package/dist/shared/lib/router/router.js.map +1 -1
- package/dist/shared/lib/router/utils/{handle-smooth-scroll.d.ts → disable-smooth-scroll.d.ts} +1 -1
- package/dist/shared/lib/router/utils/disable-smooth-scroll.js +51 -0
- package/dist/shared/lib/router/utils/disable-smooth-scroll.js.map +1 -0
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
- package/dist/esm/shared/lib/router/utils/handle-smooth-scroll.js +0 -25
- package/dist/esm/shared/lib/router/utils/handle-smooth-scroll.js.map +0 -1
- package/dist/shared/lib/router/utils/handle-smooth-scroll.js +0 -35
- package/dist/shared/lib/router/utils/handle-smooth-scroll.js.map +0 -1
package/dist/shared/lib/router/utils/{handle-smooth-scroll.d.ts → disable-smooth-scroll.d.ts}
RENAMED
@@ -2,7 +2,7 @@
|
|
2
2
|
* Run function with `scroll-behavior: auto` applied to `<html/>`.
|
3
3
|
* This css change will be reverted after the function finishes.
|
4
4
|
*/
|
5
|
-
export declare function
|
5
|
+
export declare function disableSmoothScrollDuringRouteTransition(fn: () => void, options?: {
|
6
6
|
dontForceLayout?: boolean;
|
7
7
|
onlyHashChange?: boolean;
|
8
8
|
}): void;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "disableSmoothScrollDuringRouteTransition", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return disableSmoothScrollDuringRouteTransition;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _warnonce = require("../../utils/warn-once");
|
12
|
+
function disableSmoothScrollDuringRouteTransition(fn, options) {
|
13
|
+
if (options === void 0) options = {};
|
14
|
+
// if only the hash is changed, we don't need to disable smooth scrolling
|
15
|
+
// we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX
|
16
|
+
if (options.onlyHashChange) {
|
17
|
+
fn();
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
const htmlElement = document.documentElement;
|
21
|
+
const hasDataAttribute = htmlElement.dataset.scrollBehavior === 'smooth';
|
22
|
+
// Since this is a breaking change, this is temporarily flagged
|
23
|
+
// and will be false by default.
|
24
|
+
// In the next major (v16), this will be automatically enabled
|
25
|
+
if (process.env.__NEXT_OPTIMIZE_ROUTER_SCROLL) {
|
26
|
+
if (!hasDataAttribute) {
|
27
|
+
// No smooth scrolling configured, run directly without style manipulation
|
28
|
+
fn();
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
} else {
|
32
|
+
// Old behavior: always manipulate styles, but warn about upcoming change
|
33
|
+
// Warn if smooth scrolling is detected but no data attribute is present
|
34
|
+
if (process.env.NODE_ENV === 'development' && !hasDataAttribute && getComputedStyle(htmlElement).scrollBehavior === 'smooth') {
|
35
|
+
(0, _warnonce.warnOnce)('Detected `scroll-behavior: smooth` on the `<html>` element. In a future version, ' + 'Next.js will no longer automatically disable smooth scrolling during route transitions. ' + 'To prepare for this change, add `data-scroll-behavior="smooth"` to your <html> element. ' + 'Learn more: https://nextjs.org/docs/messages/missing-data-scroll-behavior');
|
36
|
+
}
|
37
|
+
}
|
38
|
+
// Proceed with temporarily disabling smooth scrolling
|
39
|
+
const existing = htmlElement.style.scrollBehavior;
|
40
|
+
htmlElement.style.scrollBehavior = 'auto';
|
41
|
+
if (!options.dontForceLayout) {
|
42
|
+
// In Chrome-based browsers we need to force reflow before calling `scrollTo`.
|
43
|
+
// Otherwise it will not pickup the change in scrollBehavior
|
44
|
+
// More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042
|
45
|
+
htmlElement.getClientRects();
|
46
|
+
}
|
47
|
+
fn();
|
48
|
+
htmlElement.style.scrollBehavior = existing;
|
49
|
+
}
|
50
|
+
|
51
|
+
//# sourceMappingURL=disable-smooth-scroll.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shared/lib/router/utils/disable-smooth-scroll.ts"],"sourcesContent":["import { warnOnce } from '../../utils/warn-once'\n\n/**\n * Run function with `scroll-behavior: auto` applied to `<html/>`.\n * This css change will be reverted after the function finishes.\n */\nexport function disableSmoothScrollDuringRouteTransition(\n fn: () => void,\n options: { dontForceLayout?: boolean; onlyHashChange?: boolean } = {}\n) {\n // if only the hash is changed, we don't need to disable smooth scrolling\n // we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX\n if (options.onlyHashChange) {\n fn()\n return\n }\n\n const htmlElement = document.documentElement\n const hasDataAttribute = htmlElement.dataset.scrollBehavior === 'smooth'\n\n // Since this is a breaking change, this is temporarily flagged\n // and will be false by default.\n // In the next major (v16), this will be automatically enabled\n if (process.env.__NEXT_OPTIMIZE_ROUTER_SCROLL) {\n if (!hasDataAttribute) {\n // No smooth scrolling configured, run directly without style manipulation\n fn()\n return\n }\n } else {\n // Old behavior: always manipulate styles, but warn about upcoming change\n\n // Warn if smooth scrolling is detected but no data attribute is present\n if (\n process.env.NODE_ENV === 'development' &&\n !hasDataAttribute &&\n getComputedStyle(htmlElement).scrollBehavior === 'smooth'\n ) {\n warnOnce(\n 'Detected `scroll-behavior: smooth` on the `<html>` element. In a future version, ' +\n 'Next.js will no longer automatically disable smooth scrolling during route transitions. ' +\n 'To prepare for this change, add `data-scroll-behavior=\"smooth\"` to your <html> element. ' +\n 'Learn more: https://nextjs.org/docs/messages/missing-data-scroll-behavior'\n )\n }\n }\n\n // Proceed with temporarily disabling smooth scrolling\n const existing = htmlElement.style.scrollBehavior\n htmlElement.style.scrollBehavior = 'auto'\n if (!options.dontForceLayout) {\n // In Chrome-based browsers we need to force reflow before calling `scrollTo`.\n // Otherwise it will not pickup the change in scrollBehavior\n // More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042\n htmlElement.getClientRects()\n }\n fn()\n htmlElement.style.scrollBehavior = existing\n}\n"],"names":["disableSmoothScrollDuringRouteTransition","fn","options","onlyHashChange","htmlElement","document","documentElement","hasDataAttribute","dataset","scrollBehavior","process","env","__NEXT_OPTIMIZE_ROUTER_SCROLL","NODE_ENV","getComputedStyle","warnOnce","existing","style","dontForceLayout","getClientRects"],"mappings":";;;;+BAMgBA;;;eAAAA;;;0BANS;AAMlB,SAASA,yCACdC,EAAc,EACdC,OAAqE;IAArEA,IAAAA,oBAAAA,UAAmE,CAAC;IAEpE,yEAAyE;IACzE,6FAA6F;IAC7F,IAAIA,QAAQC,cAAc,EAAE;QAC1BF;QACA;IACF;IAEA,MAAMG,cAAcC,SAASC,eAAe;IAC5C,MAAMC,mBAAmBH,YAAYI,OAAO,CAACC,cAAc,KAAK;IAEhE,+DAA+D;IAC/D,gCAAgC;IAChC,8DAA8D;IAC9D,IAAIC,QAAQC,GAAG,CAACC,6BAA6B,EAAE;QAC7C,IAAI,CAACL,kBAAkB;YACrB,0EAA0E;YAC1EN;YACA;QACF;IACF,OAAO;QACL,yEAAyE;QAEzE,wEAAwE;QACxE,IACES,QAAQC,GAAG,CAACE,QAAQ,KAAK,iBACzB,CAACN,oBACDO,iBAAiBV,aAAaK,cAAc,KAAK,UACjD;YACAM,IAAAA,kBAAQ,EACN,sFACE,6FACA,6FACA;QAEN;IACF;IAEA,sDAAsD;IACtD,MAAMC,WAAWZ,YAAYa,KAAK,CAACR,cAAc;IACjDL,YAAYa,KAAK,CAACR,cAAc,GAAG;IACnC,IAAI,CAACP,QAAQgB,eAAe,EAAE;QAC5B,8EAA8E;QAC9E,4DAA4D;QAC5D,yFAAyF;QACzFd,YAAYe,cAAc;IAC5B;IACAlB;IACAG,YAAYa,KAAK,CAACR,cAAc,GAAGO;AACrC","ignoreList":[0]}
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
|
|
11
11
|
const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
|
12
12
|
function eventCliSessionStopped(event) {
|
13
13
|
// This should be an invariant, if it fails our build tooling is broken.
|
14
|
-
if (typeof "15.4.0-canary.
|
14
|
+
if (typeof "15.4.0-canary.129" !== 'string') {
|
15
15
|
return [];
|
16
16
|
}
|
17
17
|
const payload = {
|
18
|
-
nextVersion: "15.4.0-canary.
|
18
|
+
nextVersion: "15.4.0-canary.129",
|
19
19
|
nodeVersion: process.version,
|
20
20
|
cliCommand: event.cliCommand,
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|
@@ -36,12 +36,12 @@ function hasBabelConfig(dir) {
|
|
36
36
|
function eventCliSession(dir, nextConfig, event) {
|
37
37
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_experimental_reactCompiler, _nextConfig_experimental_reactCompiler1;
|
38
38
|
// This should be an invariant, if it fails our build tooling is broken.
|
39
|
-
if (typeof "15.4.0-canary.
|
39
|
+
if (typeof "15.4.0-canary.129" !== 'string') {
|
40
40
|
return [];
|
41
41
|
}
|
42
42
|
const { images, i18n } = nextConfig || {};
|
43
43
|
const payload = {
|
44
|
-
nextVersion: "15.4.0-canary.
|
44
|
+
nextVersion: "15.4.0-canary.129",
|
45
45
|
nodeVersion: process.version,
|
46
46
|
cliCommand: event.cliCommand,
|
47
47
|
isSrcDir: event.isSrcDir,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "next",
|
3
|
-
"version": "15.4.0-canary.
|
3
|
+
"version": "15.4.0-canary.129",
|
4
4
|
"description": "The React Framework",
|
5
5
|
"main": "./dist/server/next.js",
|
6
6
|
"license": "MIT",
|
@@ -100,7 +100,7 @@
|
|
100
100
|
]
|
101
101
|
},
|
102
102
|
"dependencies": {
|
103
|
-
"@next/env": "15.4.0-canary.
|
103
|
+
"@next/env": "15.4.0-canary.129",
|
104
104
|
"@swc/helpers": "0.5.15",
|
105
105
|
"caniuse-lite": "^1.0.30001579",
|
106
106
|
"postcss": "8.4.31",
|
@@ -130,14 +130,14 @@
|
|
130
130
|
},
|
131
131
|
"optionalDependencies": {
|
132
132
|
"sharp": "^0.34.1",
|
133
|
-
"@next/swc-darwin-arm64": "15.4.0-canary.
|
134
|
-
"@next/swc-darwin-x64": "15.4.0-canary.
|
135
|
-
"@next/swc-linux-arm64-gnu": "15.4.0-canary.
|
136
|
-
"@next/swc-linux-arm64-musl": "15.4.0-canary.
|
137
|
-
"@next/swc-linux-x64-gnu": "15.4.0-canary.
|
138
|
-
"@next/swc-linux-x64-musl": "15.4.0-canary.
|
139
|
-
"@next/swc-win32-arm64-msvc": "15.4.0-canary.
|
140
|
-
"@next/swc-win32-x64-msvc": "15.4.0-canary.
|
133
|
+
"@next/swc-darwin-arm64": "15.4.0-canary.129",
|
134
|
+
"@next/swc-darwin-x64": "15.4.0-canary.129",
|
135
|
+
"@next/swc-linux-arm64-gnu": "15.4.0-canary.129",
|
136
|
+
"@next/swc-linux-arm64-musl": "15.4.0-canary.129",
|
137
|
+
"@next/swc-linux-x64-gnu": "15.4.0-canary.129",
|
138
|
+
"@next/swc-linux-x64-musl": "15.4.0-canary.129",
|
139
|
+
"@next/swc-win32-arm64-msvc": "15.4.0-canary.129",
|
140
|
+
"@next/swc-win32-x64-msvc": "15.4.0-canary.129"
|
141
141
|
},
|
142
142
|
"devDependencies": {
|
143
143
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
@@ -171,11 +171,11 @@
|
|
171
171
|
"@jest/types": "29.5.0",
|
172
172
|
"@mswjs/interceptors": "0.23.0",
|
173
173
|
"@napi-rs/triples": "1.2.0",
|
174
|
-
"@next/font": "15.4.0-canary.
|
175
|
-
"@next/polyfill-module": "15.4.0-canary.
|
176
|
-
"@next/polyfill-nomodule": "15.4.0-canary.
|
177
|
-
"@next/react-refresh-utils": "15.4.0-canary.
|
178
|
-
"@next/swc": "15.4.0-canary.
|
174
|
+
"@next/font": "15.4.0-canary.129",
|
175
|
+
"@next/polyfill-module": "15.4.0-canary.129",
|
176
|
+
"@next/polyfill-nomodule": "15.4.0-canary.129",
|
177
|
+
"@next/react-refresh-utils": "15.4.0-canary.129",
|
178
|
+
"@next/swc": "15.4.0-canary.129",
|
179
179
|
"@opentelemetry/api": "1.6.0",
|
180
180
|
"@playwright/test": "1.51.1",
|
181
181
|
"@rspack/core": "1.4.5",
|
@@ -1,25 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Run function with `scroll-behavior: auto` applied to `<html/>`.
|
3
|
-
* This css change will be reverted after the function finishes.
|
4
|
-
*/ export function handleSmoothScroll(fn, options) {
|
5
|
-
if (options === void 0) options = {};
|
6
|
-
// if only the hash is changed, we don't need to disable smooth scrolling
|
7
|
-
// we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX
|
8
|
-
if (options.onlyHashChange) {
|
9
|
-
fn();
|
10
|
-
return;
|
11
|
-
}
|
12
|
-
const htmlElement = document.documentElement;
|
13
|
-
const existing = htmlElement.style.scrollBehavior;
|
14
|
-
htmlElement.style.scrollBehavior = 'auto';
|
15
|
-
if (!options.dontForceLayout) {
|
16
|
-
// In Chrome-based browsers we need to force reflow before calling `scrollTo`.
|
17
|
-
// Otherwise it will not pickup the change in scrollBehavior
|
18
|
-
// More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042
|
19
|
-
htmlElement.getClientRects();
|
20
|
-
}
|
21
|
-
fn();
|
22
|
-
htmlElement.style.scrollBehavior = existing;
|
23
|
-
}
|
24
|
-
|
25
|
-
//# sourceMappingURL=handle-smooth-scroll.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shared/lib/router/utils/handle-smooth-scroll.ts"],"sourcesContent":["/**\n * Run function with `scroll-behavior: auto` applied to `<html/>`.\n * This css change will be reverted after the function finishes.\n */\nexport function handleSmoothScroll(\n fn: () => void,\n options: { dontForceLayout?: boolean; onlyHashChange?: boolean } = {}\n) {\n // if only the hash is changed, we don't need to disable smooth scrolling\n // we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX\n if (options.onlyHashChange) {\n fn()\n return\n }\n const htmlElement = document.documentElement\n const existing = htmlElement.style.scrollBehavior\n htmlElement.style.scrollBehavior = 'auto'\n if (!options.dontForceLayout) {\n // In Chrome-based browsers we need to force reflow before calling `scrollTo`.\n // Otherwise it will not pickup the change in scrollBehavior\n // More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042\n htmlElement.getClientRects()\n }\n fn()\n htmlElement.style.scrollBehavior = existing\n}\n"],"names":["handleSmoothScroll","fn","options","onlyHashChange","htmlElement","document","documentElement","existing","style","scrollBehavior","dontForceLayout","getClientRects"],"mappings":"AAAA;;;CAGC,GACD,OAAO,SAASA,mBACdC,EAAc,EACdC,OAAqE;IAArEA,IAAAA,oBAAAA,UAAmE,CAAC;IAEpE,yEAAyE;IACzE,6FAA6F;IAC7F,IAAIA,QAAQC,cAAc,EAAE;QAC1BF;QACA;IACF;IACA,MAAMG,cAAcC,SAASC,eAAe;IAC5C,MAAMC,WAAWH,YAAYI,KAAK,CAACC,cAAc;IACjDL,YAAYI,KAAK,CAACC,cAAc,GAAG;IACnC,IAAI,CAACP,QAAQQ,eAAe,EAAE;QAC5B,8EAA8E;QAC9E,4DAA4D;QAC5D,yFAAyF;QACzFN,YAAYO,cAAc;IAC5B;IACAV;IACAG,YAAYI,KAAK,CAACC,cAAc,GAAGF;AACrC","ignoreList":[0]}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Run function with `scroll-behavior: auto` applied to `<html/>`.
|
3
|
-
* This css change will be reverted after the function finishes.
|
4
|
-
*/ "use strict";
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
Object.defineProperty(exports, "handleSmoothScroll", {
|
9
|
-
enumerable: true,
|
10
|
-
get: function() {
|
11
|
-
return handleSmoothScroll;
|
12
|
-
}
|
13
|
-
});
|
14
|
-
function handleSmoothScroll(fn, options) {
|
15
|
-
if (options === void 0) options = {};
|
16
|
-
// if only the hash is changed, we don't need to disable smooth scrolling
|
17
|
-
// we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX
|
18
|
-
if (options.onlyHashChange) {
|
19
|
-
fn();
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
const htmlElement = document.documentElement;
|
23
|
-
const existing = htmlElement.style.scrollBehavior;
|
24
|
-
htmlElement.style.scrollBehavior = 'auto';
|
25
|
-
if (!options.dontForceLayout) {
|
26
|
-
// In Chrome-based browsers we need to force reflow before calling `scrollTo`.
|
27
|
-
// Otherwise it will not pickup the change in scrollBehavior
|
28
|
-
// More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042
|
29
|
-
htmlElement.getClientRects();
|
30
|
-
}
|
31
|
-
fn();
|
32
|
-
htmlElement.style.scrollBehavior = existing;
|
33
|
-
}
|
34
|
-
|
35
|
-
//# sourceMappingURL=handle-smooth-scroll.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shared/lib/router/utils/handle-smooth-scroll.ts"],"sourcesContent":["/**\n * Run function with `scroll-behavior: auto` applied to `<html/>`.\n * This css change will be reverted after the function finishes.\n */\nexport function handleSmoothScroll(\n fn: () => void,\n options: { dontForceLayout?: boolean; onlyHashChange?: boolean } = {}\n) {\n // if only the hash is changed, we don't need to disable smooth scrolling\n // we only care to prevent smooth scrolling when navigating to a new page to avoid jarring UX\n if (options.onlyHashChange) {\n fn()\n return\n }\n const htmlElement = document.documentElement\n const existing = htmlElement.style.scrollBehavior\n htmlElement.style.scrollBehavior = 'auto'\n if (!options.dontForceLayout) {\n // In Chrome-based browsers we need to force reflow before calling `scrollTo`.\n // Otherwise it will not pickup the change in scrollBehavior\n // More info here: https://github.com/vercel/next.js/issues/40719#issuecomment-1336248042\n htmlElement.getClientRects()\n }\n fn()\n htmlElement.style.scrollBehavior = existing\n}\n"],"names":["handleSmoothScroll","fn","options","onlyHashChange","htmlElement","document","documentElement","existing","style","scrollBehavior","dontForceLayout","getClientRects"],"mappings":"AAAA;;;CAGC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,mBACdC,EAAc,EACdC,OAAqE;IAArEA,IAAAA,oBAAAA,UAAmE,CAAC;IAEpE,yEAAyE;IACzE,6FAA6F;IAC7F,IAAIA,QAAQC,cAAc,EAAE;QAC1BF;QACA;IACF;IACA,MAAMG,cAAcC,SAASC,eAAe;IAC5C,MAAMC,WAAWH,YAAYI,KAAK,CAACC,cAAc;IACjDL,YAAYI,KAAK,CAACC,cAAc,GAAG;IACnC,IAAI,CAACP,QAAQQ,eAAe,EAAE;QAC5B,8EAA8E;QAC9E,4DAA4D;QAC5D,yFAAyF;QACzFN,YAAYO,cAAc;IAC5B;IACAV;IACAG,YAAYI,KAAK,CAACC,cAAc,GAAGF;AACrC","ignoreList":[0]}
|