@sveltejs/kit 1.0.0-next.281 → 1.0.0-next.282

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,6 +37,11 @@ try {
37
37
  // do nothing
38
38
  }
39
39
 
40
+ /** @param {number} index */
41
+ function update_scroll_positions(index) {
42
+ scroll_positions[index] = scroll_state();
43
+ }
44
+
40
45
  function scroll_state() {
41
46
  return {
42
47
  x: pageXOffset,
@@ -143,7 +148,7 @@ class Router {
143
148
 
144
149
  addEventListener('visibilitychange', () => {
145
150
  if (document.visibilityState === 'hidden') {
146
- this.#update_scroll_positions();
151
+ update_scroll_positions(this.current_history_index);
147
152
 
148
153
  try {
149
154
  sessionStorage[SCROLL_KEY] = JSON.stringify(scroll_positions);
@@ -223,7 +228,7 @@ class Router {
223
228
  // clicking a hash link and those triggered by popstate
224
229
  this.hash_navigating = true;
225
230
 
226
- this.#update_scroll_positions();
231
+ update_scroll_positions(this.current_history_index);
227
232
  this.renderer.update_page_store(new URL(url.href));
228
233
 
229
234
  return;
@@ -282,10 +287,6 @@ class Router {
282
287
  this.initialized = true;
283
288
  }
284
289
 
285
- #update_scroll_positions() {
286
- scroll_positions[this.current_history_index] = scroll_state();
287
- }
288
-
289
290
  /**
290
291
  * Returns true if `url` has the same origin and basepath as the app
291
292
  * @param {URL} url
@@ -434,7 +435,7 @@ class Router {
434
435
  });
435
436
  }
436
437
 
437
- this.#update_scroll_positions();
438
+ update_scroll_positions(this.current_history_index);
438
439
 
439
440
  accepted();
440
441
 
package/dist/cli.js CHANGED
@@ -998,7 +998,7 @@ async function launch(port, https) {
998
998
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}`);
999
999
  }
1000
1000
 
1001
- const prog = sade('svelte-kit').version('1.0.0-next.281');
1001
+ const prog = sade('svelte-kit').version('1.0.0-next.282');
1002
1002
 
1003
1003
  prog
1004
1004
  .command('dev')
@@ -1156,7 +1156,7 @@ async function check_port(port) {
1156
1156
  function welcome({ port, host, https, open, loose, allow, cwd }) {
1157
1157
  if (open) launch(port, https);
1158
1158
 
1159
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.281'}\n`));
1159
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.282'}\n`));
1160
1160
 
1161
1161
  const protocol = https ? 'https:' : 'http:';
1162
1162
  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.281",
3
+ "version": "1.0.0-next.282",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",