astro 3.5.3 → 3.5.5
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/components/Code.astro +6 -54
- package/components/ViewTransitions.astro +5 -2
- package/config.d.ts +2 -1
- package/dist/@types/astro.d.ts +3 -1
- package/dist/assets/services/noop.js +1 -0
- package/dist/core/app/index.js +7 -2
- package/dist/core/app/types.d.ts +1 -0
- package/dist/core/build/generate.js +5 -2
- package/dist/core/build/plugins/plugin-manifest.js +1 -0
- package/dist/core/build/plugins/plugin-prerender.js +4 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/dev/vite.js +1 -1
- package/dist/core/logger/core.d.ts +1 -1
- package/dist/core/logger/core.js +3 -3
- package/dist/core/messages.js +2 -2
- package/dist/core/pipeline.d.ts +6 -0
- package/dist/core/pipeline.js +13 -0
- package/dist/core/preview/vite-plugin-astro-preview.js +2 -1
- package/dist/core/shiki.d.ts +2 -8
- package/dist/core/shiki.js +5 -24
- package/dist/i18n/middleware.d.ts +6 -1
- package/dist/i18n/middleware.js +21 -6
- package/dist/runtime/client/dev-overlay/entrypoint.js +155 -6
- package/dist/runtime/client/dev-overlay/overlay.d.ts +4 -0
- package/dist/runtime/client/dev-overlay/overlay.js +29 -11
- package/dist/runtime/client/dev-overlay/plugins/astro.js +9 -36
- package/dist/runtime/client/dev-overlay/plugins/settings.d.ts +8 -0
- package/dist/runtime/client/dev-overlay/plugins/settings.js +93 -0
- package/dist/runtime/client/dev-overlay/plugins/utils/window.d.ts +3 -0
- package/dist/runtime/client/dev-overlay/plugins/utils/window.js +45 -0
- package/dist/runtime/client/dev-overlay/settings.d.ts +12 -0
- package/dist/runtime/client/dev-overlay/settings.js +26 -0
- package/dist/runtime/client/dev-overlay/ui-library/icons.d.ts +2 -0
- package/dist/runtime/client/dev-overlay/ui-library/icons.js +3 -1
- package/dist/runtime/client/dev-overlay/ui-library/toggle.d.ts +8 -0
- package/dist/runtime/client/dev-overlay/ui-library/toggle.js +57 -0
- package/dist/runtime/client/dev-overlay/ui-library/window.js +36 -7
- package/dist/transitions/router.js +1 -1
- package/dist/vite-plugin-astro-server/plugin.js +1 -0
- package/dist/vite-plugin-astro-server/route.js +7 -2
- package/package.json +4 -4
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
class DevOverlayToggle extends HTMLElement {
|
|
2
|
+
shadowRoot;
|
|
3
|
+
input;
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.shadowRoot = this.attachShadow({ mode: "open" });
|
|
7
|
+
this.shadowRoot.innerHTML = `
|
|
8
|
+
<style>
|
|
9
|
+
input {
|
|
10
|
+
appearance: none;
|
|
11
|
+
width: 32px;
|
|
12
|
+
height: 20px;
|
|
13
|
+
border: 1px solid rgba(145, 152, 173, 1);
|
|
14
|
+
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
15
|
+
border-radius: 9999px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
input::after {
|
|
19
|
+
content: '';
|
|
20
|
+
width: 16px;
|
|
21
|
+
display: inline-block;
|
|
22
|
+
height: 16px;
|
|
23
|
+
background-color: rgba(145, 152, 173, 1);
|
|
24
|
+
border-radius: 9999px;
|
|
25
|
+
transition: transform 0.2s ease, background-color 0.2s ease;
|
|
26
|
+
top: 1px;
|
|
27
|
+
left: 1px;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
input:checked {
|
|
32
|
+
border: 1px solid rgba(213, 249, 196, 1);
|
|
33
|
+
background-color: rgba(61, 125, 31, 1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
input:checked::after {
|
|
37
|
+
transform: translateX(12px);
|
|
38
|
+
background: rgba(213, 249, 196, 1);
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
`;
|
|
42
|
+
this.input = document.createElement("input");
|
|
43
|
+
}
|
|
44
|
+
connectedCallback() {
|
|
45
|
+
this.input.type = "checkbox";
|
|
46
|
+
this.shadowRoot.append(this.input);
|
|
47
|
+
}
|
|
48
|
+
get value() {
|
|
49
|
+
return this.input.value;
|
|
50
|
+
}
|
|
51
|
+
set value(val) {
|
|
52
|
+
this.input.value = val;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
DevOverlayToggle
|
|
57
|
+
};
|
|
@@ -13,11 +13,12 @@ class DevOverlayWindow extends HTMLElement {
|
|
|
13
13
|
this.shadowRoot.innerHTML = `
|
|
14
14
|
<style>
|
|
15
15
|
:host {
|
|
16
|
+
box-sizing: border-box;
|
|
16
17
|
display: flex;
|
|
17
18
|
flex-direction: column;
|
|
18
19
|
background: linear-gradient(0deg, #13151A, #13151A), linear-gradient(0deg, #343841, #343841);
|
|
19
20
|
border: 1px solid rgba(52, 56, 65, 1);
|
|
20
|
-
width: 640px;
|
|
21
|
+
width: min(640px, 100%);
|
|
21
22
|
height: 480px;
|
|
22
23
|
border-radius: 12px;
|
|
23
24
|
padding: 24px;
|
|
@@ -31,24 +32,52 @@ class DevOverlayWindow extends HTMLElement {
|
|
|
31
32
|
box-shadow: 0px 0px 0px 0px rgba(19, 21, 26, 0.30), 0px 1px 2px 0px rgba(19, 21, 26, 0.29), 0px 4px 4px 0px rgba(19, 21, 26, 0.26), 0px 10px 6px 0px rgba(19, 21, 26, 0.15), 0px 17px 7px 0px rgba(19, 21, 26, 0.04), 0px 26px 7px 0px rgba(19, 21, 26, 0.01);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
h1 {
|
|
35
|
-
margin: 0;
|
|
35
|
+
::slotted(h1), ::slotted(h2), ::slotted(h3), ::slotted(h4), ::slotted(h5) {
|
|
36
36
|
font-weight: 600;
|
|
37
37
|
color: #fff;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
#window-title {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
color: #fff;
|
|
45
|
+
margin: 0;
|
|
46
|
+
font-size: 22px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
::slotted(h1) {
|
|
50
|
+
font-size: 22px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
::slotted(h2) {
|
|
54
|
+
font-size: 20px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
::slotted(h3) {
|
|
58
|
+
font-size: 18px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
::slotted(h4) {
|
|
62
|
+
font-size: 16px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
::slotted(h5) {
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
#window-title svg {
|
|
42
70
|
margin-right: 8px;
|
|
71
|
+
height: 1em;
|
|
43
72
|
}
|
|
44
73
|
|
|
45
|
-
hr {
|
|
74
|
+
hr, ::slotted(hr) {
|
|
46
75
|
border: 1px solid rgba(27, 30, 36, 1);
|
|
47
76
|
margin: 1em 0;
|
|
48
77
|
}
|
|
49
78
|
</style>
|
|
50
79
|
|
|
51
|
-
<h1>${this.windowIcon ? this.getElementForIcon(this.windowIcon) : ""}${this.windowTitle ?? ""}</h1>
|
|
80
|
+
<h1 id="window-title">${this.windowIcon ? this.getElementForIcon(this.windowIcon) : ""}${this.windowTitle ?? ""}</h1>
|
|
52
81
|
<hr />
|
|
53
82
|
<slot />
|
|
54
83
|
`;
|
|
@@ -299,7 +299,7 @@ function navigate(href, options) {
|
|
|
299
299
|
if (inBrowser === false) {
|
|
300
300
|
if (!navigateOnServerWarned) {
|
|
301
301
|
const warning = new Error(
|
|
302
|
-
"The view
|
|
302
|
+
"The view transitions client API was called during a server side render. This may be unintentional as the navigate() function is expected to be called in response to user interactions. Please make sure that your usage is correct."
|
|
303
303
|
);
|
|
304
304
|
warning.name = "Warning";
|
|
305
305
|
console.warn(warning);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { createRequest } from "../core/request.js";
|
|
10
10
|
import { matchAllRoutes } from "../core/routing/index.js";
|
|
11
11
|
import { isPage, resolveIdToUrl } from "../core/util.js";
|
|
12
|
-
import { createI18nMiddleware } from "../i18n/middleware.js";
|
|
12
|
+
import { createI18nMiddleware, i18nPipelineHook } from "../i18n/middleware.js";
|
|
13
13
|
import { getSortedPreloadedMatches } from "../prerender/routing.js";
|
|
14
14
|
import { isServerLikeOutput } from "../prerender/utils.js";
|
|
15
15
|
import { PAGE_SCRIPT_ID } from "../vite-plugin-scripts/index.js";
|
|
@@ -202,13 +202,18 @@ async function handleRoute({
|
|
|
202
202
|
}
|
|
203
203
|
const onRequest = middleware?.onRequest;
|
|
204
204
|
if (config.experimental.i18n) {
|
|
205
|
-
const i18Middleware = createI18nMiddleware(
|
|
205
|
+
const i18Middleware = createI18nMiddleware(
|
|
206
|
+
config.experimental.i18n,
|
|
207
|
+
config.base,
|
|
208
|
+
config.trailingSlash
|
|
209
|
+
);
|
|
206
210
|
if (i18Middleware) {
|
|
207
211
|
if (onRequest) {
|
|
208
212
|
pipeline.setMiddlewareFunction(sequence(i18Middleware, onRequest));
|
|
209
213
|
} else {
|
|
210
214
|
pipeline.setMiddlewareFunction(i18Middleware);
|
|
211
215
|
}
|
|
216
|
+
pipeline.onBeforeRenderRoute(i18nPipelineHook);
|
|
212
217
|
} else if (onRequest) {
|
|
213
218
|
pipeline.setMiddlewareFunction(onRequest);
|
|
214
219
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.5",
|
|
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",
|
|
@@ -165,15 +165,15 @@
|
|
|
165
165
|
"yargs-parser": "^21.1.1",
|
|
166
166
|
"zod": "^3.22.4",
|
|
167
167
|
"@astrojs/internal-helpers": "0.2.1",
|
|
168
|
-
"@astrojs/
|
|
169
|
-
"@astrojs/
|
|
168
|
+
"@astrojs/markdown-remark": "3.5.0",
|
|
169
|
+
"@astrojs/telemetry": "3.0.4"
|
|
170
170
|
},
|
|
171
171
|
"optionalDependencies": {
|
|
172
172
|
"sharp": "^0.32.5"
|
|
173
173
|
},
|
|
174
174
|
"devDependencies": {
|
|
175
175
|
"@astrojs/check": "^0.1.0",
|
|
176
|
-
"@playwright/test": "
|
|
176
|
+
"@playwright/test": "1.40.0-alpha-nov-13-2023",
|
|
177
177
|
"@types/babel__generator": "^7.6.4",
|
|
178
178
|
"@types/babel__traverse": "^7.20.1",
|
|
179
179
|
"@types/chai": "^4.3.5",
|