@sveltejs/kit 1.0.0-next.195 → 1.0.0-next.196
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/assets/runtime/internal/start.js +19 -5
- package/dist/chunks/http.js +1 -0
- package/dist/cli.js +2 -2
- package/package.json +1 -3
|
@@ -656,6 +656,8 @@ class Renderer {
|
|
|
656
656
|
this._init(navigation_result);
|
|
657
657
|
}
|
|
658
658
|
|
|
659
|
+
getSelection()?.removeAllRanges();
|
|
660
|
+
|
|
659
661
|
if (!opts) {
|
|
660
662
|
await 0;
|
|
661
663
|
} else {
|
|
@@ -665,14 +667,26 @@ class Renderer {
|
|
|
665
667
|
document.body.focus();
|
|
666
668
|
}
|
|
667
669
|
|
|
668
|
-
const
|
|
670
|
+
const old_page_y_offset = Math.round(pageYOffset);
|
|
671
|
+
const old_max_page_y_offset = document.documentElement.scrollHeight - innerHeight;
|
|
672
|
+
|
|
669
673
|
await 0;
|
|
670
|
-
|
|
674
|
+
|
|
675
|
+
const new_page_y_offset = Math.round(pageYOffset);
|
|
676
|
+
const new_max_page_y_offset = document.documentElement.scrollHeight - innerHeight;
|
|
671
677
|
|
|
672
678
|
// After `await 0`, the `onMount()` function in the component executed.
|
|
673
|
-
//
|
|
674
|
-
|
|
675
|
-
|
|
679
|
+
// Check if no scrolling happened on mount.
|
|
680
|
+
const no_scroll_happened =
|
|
681
|
+
// In most cases, we can compare whether `pageYOffset` changed between navigation
|
|
682
|
+
new_page_y_offset === Math.min(old_page_y_offset, new_max_page_y_offset) ||
|
|
683
|
+
// But if the page is scrolled to/near the bottom, the browser would also scroll
|
|
684
|
+
// to/near the bottom of the new page on navigation. Since we can't detect when this
|
|
685
|
+
// behaviour happens, we naively compare by the y offset from the bottom of the page.
|
|
686
|
+
old_max_page_y_offset - old_page_y_offset === new_max_page_y_offset - new_page_y_offset;
|
|
687
|
+
|
|
688
|
+
// If there was no scrolling, we run on our custom scroll handling
|
|
689
|
+
if (no_scroll_happened) {
|
|
676
690
|
const deep_linked = hash && document.getElementById(hash.slice(1));
|
|
677
691
|
if (scroll) {
|
|
678
692
|
scrollTo(scroll.x, scroll.y);
|
package/dist/chunks/http.js
CHANGED
package/dist/cli.js
CHANGED
|
@@ -817,7 +817,7 @@ async function launch(port, https) {
|
|
|
817
817
|
exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
|
|
818
818
|
}
|
|
819
819
|
|
|
820
|
-
const prog = sade('svelte-kit').version('1.0.0-next.
|
|
820
|
+
const prog = sade('svelte-kit').version('1.0.0-next.196');
|
|
821
821
|
|
|
822
822
|
prog
|
|
823
823
|
.command('dev')
|
|
@@ -982,7 +982,7 @@ async function check_port(port) {
|
|
|
982
982
|
function welcome({ port, host, https, open, loose, allow, cwd }) {
|
|
983
983
|
if (open) launch(port, https);
|
|
984
984
|
|
|
985
|
-
console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.
|
|
985
|
+
console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.196'}\n`));
|
|
986
986
|
|
|
987
987
|
const protocol = https ? 'https:' : 'http:';
|
|
988
988
|
const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/kit",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.196",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sveltejs/kit",
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"@types/marked": "^3.0.1",
|
|
22
22
|
"@types/mime": "^2.0.3",
|
|
23
23
|
"@types/node": "^16.10.3",
|
|
24
|
-
"@types/rimraf": "^3.0.2",
|
|
25
24
|
"@types/sade": "^1.7.3",
|
|
26
25
|
"amphtml-validator": "^1.0.35",
|
|
27
26
|
"cookie": "^0.4.1",
|
|
@@ -33,7 +32,6 @@
|
|
|
33
32
|
"mime": "^2.5.2",
|
|
34
33
|
"node-fetch": "^3.0.0",
|
|
35
34
|
"port-authority": "^1.1.2",
|
|
36
|
-
"rimraf": "^3.0.2",
|
|
37
35
|
"rollup": "^2.58.0",
|
|
38
36
|
"selfsigned": "^1.10.11",
|
|
39
37
|
"sirv": "^1.0.17",
|