@nuxt/nitro-server-nightly 4.2.1-29370847.26aaf83d → 4.2.1-29372276.f809e80a

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/index.mjs CHANGED
@@ -17,7 +17,7 @@ import { isWindows } from 'std-env';
17
17
  import { ImpoundPlugin } from 'impound';
18
18
  import { resolveModulePath } from 'exsolve';
19
19
 
20
- const version = "4.2.1-29370847.26aaf83d";
20
+ const version = "4.2.1-29372276.f809e80a";
21
21
 
22
22
  function toArray(value) {
23
23
  return Array.isArray(value) ? value : [value];
@@ -57,7 +57,7 @@ export default (async function errorhandler(error, event, { defaultHandler }) {
57
57
  setResponseStatus(event, res.status && res.status !== 200 ? res.status : defaultRes.status, res.statusText || defaultRes.statusText);
58
58
  if (import.meta.dev) {
59
59
  const prettyResponse = await defaultHandler(error, event, { json: false });
60
- return send(event, html.replace("</body>", `${generateErrorOverlayHTML(prettyResponse.body)}</body>`));
60
+ return send(event, html.replace("</body>", `${generateErrorOverlayHTML(prettyResponse.body, { startMinimized: 300 <= statusCode && statusCode < 500 })}</body>`));
61
61
  }
62
62
  return send(event, html);
63
63
  });
@@ -1 +1,3 @@
1
- export declare function generateErrorOverlayHTML(html: string): string;
1
+ export declare function generateErrorOverlayHTML(html: string, options?: {
2
+ startMinimized?: boolean;
3
+ }): string;
@@ -213,7 +213,7 @@ const errorCSS = (
213
213
  }
214
214
  `
215
215
  );
216
- function webComponentScript(base64HTML) {
216
+ function webComponentScript(base64HTML, startMinimized) {
217
217
  return (
218
218
  /* js */
219
219
  `
@@ -307,6 +307,11 @@ function webComponentScript(base64HTML) {
307
307
  shadow.appendChild(preview);
308
308
  shadow.appendChild(button);
309
309
 
310
+ if (${startMinimized}) {
311
+ iframe.setAttribute('inert', '');
312
+ button.setAttribute('aria-expanded', 'false');
313
+ }
314
+
310
315
  // Initialize preview
311
316
  setTimeout(updatePreview, 100);
312
317
 
@@ -317,13 +322,13 @@ function webComponentScript(base64HTML) {
317
322
  `
318
323
  );
319
324
  }
320
- export function generateErrorOverlayHTML(html) {
325
+ export function generateErrorOverlayHTML(html, options) {
321
326
  const nonce = Array.from(crypto.getRandomValues(new Uint8Array(16)), (b) => b.toString(16).padStart(2, "0")).join("");
322
327
  const errorPage = html.replace("<head>", `<head><script>${iframeStorageBridge(nonce)}<\/script>`);
323
328
  const base64HTML = Buffer.from(errorPage, "utf8").toString("base64");
324
329
  return `
325
330
  <script>${parentStorageBridge(nonce)}<\/script>
326
331
  <nuxt-error-overlay></nuxt-error-overlay>
327
- <script>${webComponentScript(base64HTML)}<\/script>
332
+ <script>${webComponentScript(base64HTML, options?.startMinimized ?? false)}<\/script>
328
333
  `;
329
334
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/nitro-server-nightly",
3
- "version": "4.2.1-29370847.26aaf83d",
3
+ "version": "4.2.1-29372276.f809e80a",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@nuxt/devalue": "^2.0.2",
22
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.1-29370847.26aaf83d",
22
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.1-29372276.f809e80a",
23
23
  "@unhead/vue": "^2.0.19",
24
24
  "@vue/shared": "^3.5.22",
25
25
  "consola": "^3.4.2",
@@ -46,11 +46,11 @@
46
46
  "vue-devtools-stub": "^0.1.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "nuxt": "npm:nuxt-nightly@4.2.1-29370847.26aaf83d"
49
+ "nuxt": "npm:nuxt-nightly@4.2.1-29372276.f809e80a"
50
50
  },
51
51
  "devDependencies": {
52
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.1-29370847.26aaf83d",
53
- "nuxt": "npm:nuxt-nightly@4.2.1-29370847.26aaf83d",
52
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.1-29372276.f809e80a",
53
+ "nuxt": "npm:nuxt-nightly@4.2.1-29372276.f809e80a",
54
54
  "unbuild": "3.6.1",
55
55
  "vitest": "3.2.4"
56
56
  },