nuxtseo-layer-devtools 0.4.1 → 0.4.2
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/error.vue +114 -0
- package/package.json +3 -1
- package/public/fonts/fira-code.woff2 +0 -0
- package/public/fonts/hubot-sans.woff2 +0 -0
package/error.vue
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NuxtError } from '#app'
|
|
3
|
+
|
|
4
|
+
const { error } = defineProps<{
|
|
5
|
+
error: NuxtError
|
|
6
|
+
}>()
|
|
7
|
+
|
|
8
|
+
const stack = computed(() => {
|
|
9
|
+
if (!error.stack)
|
|
10
|
+
return ''
|
|
11
|
+
// Clean ANSI codes if present
|
|
12
|
+
return error.stack.replace(/\u001B\[[0-9;]*m/g, '')
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
function handleClear() {
|
|
16
|
+
clearError({ redirect: '/' })
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div class="error-page">
|
|
22
|
+
<div class="error-container">
|
|
23
|
+
<div class="error-icon-wrap">
|
|
24
|
+
<UIcon name="carbon:warning" class="error-icon" />
|
|
25
|
+
</div>
|
|
26
|
+
<h1 class="error-title">
|
|
27
|
+
{{ error.statusCode || 'Error' }}: {{ error.message || 'Something went wrong' }}
|
|
28
|
+
</h1>
|
|
29
|
+
<pre v-if="stack" class="error-stack">{{ stack }}</pre>
|
|
30
|
+
<div class="error-actions">
|
|
31
|
+
<UButton size="sm" @click="handleClear">
|
|
32
|
+
Clear Error
|
|
33
|
+
</UButton>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<style scoped>
|
|
40
|
+
.error-page {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
min-height: 100vh;
|
|
45
|
+
padding: 1.5rem;
|
|
46
|
+
background: var(--color-surface, #fff);
|
|
47
|
+
color: var(--color-text, #1a1a1a);
|
|
48
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (prefers-color-scheme: dark) {
|
|
52
|
+
.error-page {
|
|
53
|
+
background: #111;
|
|
54
|
+
color: #e5e5e5;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.error-container {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 0.75rem;
|
|
63
|
+
max-width: 48rem;
|
|
64
|
+
width: 100%;
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.error-icon-wrap {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
width: 3rem;
|
|
73
|
+
height: 3rem;
|
|
74
|
+
border-radius: 0.75rem;
|
|
75
|
+
background: oklch(65% 0.15 25 / 0.1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.error-icon {
|
|
79
|
+
font-size: 1.5rem;
|
|
80
|
+
color: oklch(60% 0.18 25);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.error-title {
|
|
84
|
+
font-size: 0.875rem;
|
|
85
|
+
font-weight: 600;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.error-stack {
|
|
89
|
+
width: 100%;
|
|
90
|
+
max-height: 60vh;
|
|
91
|
+
overflow: auto;
|
|
92
|
+
padding: 1rem;
|
|
93
|
+
border-radius: 0.5rem;
|
|
94
|
+
background: oklch(0% 0 0 / 0.05);
|
|
95
|
+
border: 1px solid oklch(0% 0 0 / 0.1);
|
|
96
|
+
font-family: var(--font-mono, ui-monospace, monospace);
|
|
97
|
+
font-size: 0.6875rem;
|
|
98
|
+
line-height: 1.6;
|
|
99
|
+
text-align: left;
|
|
100
|
+
white-space: pre-wrap;
|
|
101
|
+
word-break: break-word;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (prefers-color-scheme: dark) {
|
|
105
|
+
.error-stack {
|
|
106
|
+
background: oklch(100% 0 0 / 0.05);
|
|
107
|
+
border-color: oklch(100% 0 0 / 0.1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.error-actions {
|
|
112
|
+
margin-top: 0.5rem;
|
|
113
|
+
}
|
|
114
|
+
</style>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxtseo-layer-devtools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.2",
|
|
5
5
|
"description": "Shared Nuxt layer for Nuxt SEO devtools clients.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -21,8 +21,10 @@
|
|
|
21
21
|
"assets",
|
|
22
22
|
"components",
|
|
23
23
|
"composables",
|
|
24
|
+
"error.vue",
|
|
24
25
|
"nuxt.config.ts",
|
|
25
26
|
"plugins",
|
|
27
|
+
"public",
|
|
26
28
|
"skills"
|
|
27
29
|
],
|
|
28
30
|
"dependencies": {
|
|
Binary file
|
|
Binary file
|