astro 4.4.9 → 4.4.10
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/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/transitions/router.js +33 -24
- package/package.json +3 -3
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -23,7 +23,7 @@ async function dev(inlineConfig) {
|
|
|
23
23
|
base: restart.container.settings.config.base
|
|
24
24
|
})
|
|
25
25
|
);
|
|
26
|
-
const currentVersion = "4.4.
|
|
26
|
+
const currentVersion = "4.4.10";
|
|
27
27
|
if (currentVersion.includes("-")) {
|
|
28
28
|
logger.warn("SKIP_FORMAT", msg.prerelease({ currentVersion }));
|
|
29
29
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -36,7 +36,7 @@ function serverStart({
|
|
|
36
36
|
host,
|
|
37
37
|
base
|
|
38
38
|
}) {
|
|
39
|
-
const version = "4.4.
|
|
39
|
+
const version = "4.4.10";
|
|
40
40
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
41
41
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
42
42
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -261,7 +261,7 @@ function printHelp({
|
|
|
261
261
|
message.push(
|
|
262
262
|
linebreak(),
|
|
263
263
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
264
|
-
`v${"4.4.
|
|
264
|
+
`v${"4.4.10"}`
|
|
265
265
|
)} ${headline}`
|
|
266
266
|
);
|
|
267
267
|
}
|
|
@@ -49,25 +49,6 @@ if (inBrowser) {
|
|
|
49
49
|
history.scrollRestoration = "manual";
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const throttle = (cb, delay) => {
|
|
53
|
-
let wait = false;
|
|
54
|
-
let onceMore = false;
|
|
55
|
-
return (...args) => {
|
|
56
|
-
if (wait) {
|
|
57
|
-
onceMore = true;
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
cb(...args);
|
|
61
|
-
wait = true;
|
|
62
|
-
setTimeout(() => {
|
|
63
|
-
if (onceMore) {
|
|
64
|
-
onceMore = false;
|
|
65
|
-
cb(...args);
|
|
66
|
-
}
|
|
67
|
-
wait = false;
|
|
68
|
-
}, delay);
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
52
|
async function fetchHTML(href, init) {
|
|
72
53
|
try {
|
|
73
54
|
const res = await fetch(href, init);
|
|
@@ -414,8 +395,10 @@ function onPopState(ev) {
|
|
|
414
395
|
currentHistoryIndex = nextIndex;
|
|
415
396
|
transition(direction, originalLocation, new URL(location.href), {}, state);
|
|
416
397
|
}
|
|
417
|
-
const
|
|
418
|
-
|
|
398
|
+
const onScrollEnd = () => {
|
|
399
|
+
if (scrollX !== history.state.scrollX || scrollY !== history.state.scrollY) {
|
|
400
|
+
updateScrollPosition({ scrollX, scrollY });
|
|
401
|
+
}
|
|
419
402
|
};
|
|
420
403
|
if (inBrowser) {
|
|
421
404
|
if (supportsViewTransitions || getFallback() !== "none") {
|
|
@@ -423,9 +406,35 @@ if (inBrowser) {
|
|
|
423
406
|
addEventListener("popstate", onPopState);
|
|
424
407
|
addEventListener("load", onPageLoad);
|
|
425
408
|
if ("onscrollend" in window)
|
|
426
|
-
addEventListener("scrollend",
|
|
427
|
-
else
|
|
428
|
-
|
|
409
|
+
addEventListener("scrollend", onScrollEnd);
|
|
410
|
+
else {
|
|
411
|
+
let intervalId, lastY, lastX, lastIndex;
|
|
412
|
+
const scrollInterval = () => {
|
|
413
|
+
if (lastIndex !== history.state?.index) {
|
|
414
|
+
clearInterval(intervalId);
|
|
415
|
+
intervalId = void 0;
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
if (lastY === scrollY && lastX === scrollX) {
|
|
419
|
+
clearInterval(intervalId);
|
|
420
|
+
intervalId = void 0;
|
|
421
|
+
onScrollEnd();
|
|
422
|
+
return;
|
|
423
|
+
} else {
|
|
424
|
+
lastY = scrollY, lastX = scrollX;
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
addEventListener(
|
|
428
|
+
"scroll",
|
|
429
|
+
() => {
|
|
430
|
+
if (intervalId !== void 0)
|
|
431
|
+
return;
|
|
432
|
+
lastIndex = history.state.index, lastY = scrollY, lastX = scrollX;
|
|
433
|
+
intervalId = window.setInterval(scrollInterval, 50);
|
|
434
|
+
},
|
|
435
|
+
{ passive: true }
|
|
436
|
+
);
|
|
437
|
+
}
|
|
429
438
|
}
|
|
430
439
|
for (const script of document.scripts) {
|
|
431
440
|
script.dataset.astroExec = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.10",
|
|
4
4
|
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "withastro",
|
|
@@ -163,9 +163,9 @@
|
|
|
163
163
|
"which-pm": "^2.1.1",
|
|
164
164
|
"yargs-parser": "^21.1.1",
|
|
165
165
|
"zod": "^3.22.4",
|
|
166
|
+
"@astrojs/markdown-remark": "4.2.1",
|
|
166
167
|
"@astrojs/internal-helpers": "0.2.1",
|
|
167
|
-
"@astrojs/telemetry": "3.0.4"
|
|
168
|
-
"@astrojs/markdown-remark": "4.2.1"
|
|
168
|
+
"@astrojs/telemetry": "3.0.4"
|
|
169
169
|
},
|
|
170
170
|
"optionalDependencies": {
|
|
171
171
|
"sharp": "^0.32.6"
|