astralis-devtools 0.0.0-stage → 0.1.0
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/CHANGELOG.md +35 -0
- package/LICENSE +21 -0
- package/README.md +81 -2
- package/package.json +66 -3
- package/src/bridge/bridge.mjs +169 -0
- package/src/bridge/github.mjs +139 -0
- package/src/bridge/http.mjs +194 -0
- package/src/bridge/node-adapter.mjs +68 -0
- package/src/bridge/project.mjs +103 -0
- package/src/bridge/snapshot.mjs +71 -0
- package/src/client/dom.mjs +82 -0
- package/src/client/fonts/OFL.txt +94 -0
- package/src/client/fonts.mjs +22 -0
- package/src/client/icons.mjs +44 -0
- package/src/client/identity.mjs +117 -0
- package/src/client/launcher.mjs +142 -0
- package/src/client/overlay.d.mts +9 -0
- package/src/client/overlay.mjs +525 -0
- package/src/client/page.mjs +92 -0
- package/src/client/picker.mjs +118 -0
- package/src/client/report.mjs +161 -0
- package/src/client/screens/component.mjs +151 -0
- package/src/client/screens/components.mjs +117 -0
- package/src/client/screens/findings.mjs +92 -0
- package/src/client/screens/home.mjs +100 -0
- package/src/client/screens/report.mjs +498 -0
- package/src/client/screens/shared.mjs +59 -0
- package/src/client/styles.mjs +512 -0
- package/src/next/devtools.d.mts +6 -0
- package/src/next/devtools.mjs +32 -0
- package/src/next/route.d.mts +10 -0
- package/src/next/route.mjs +17 -0
- package/src/vite.d.mts +12 -0
- package/src/vite.mjs +59 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
import { FAMILIES } from "./fonts.mjs";
|
|
2
|
+
|
|
3
|
+
/* The overlay's own styles, scoped by its shadow root: nothing here reaches
|
|
4
|
+
the page and nothing on the page restyles the overlay. It is Astralis's
|
|
5
|
+
tool, so it wears the Astralis brand (the docs' yellow and fonts) on one
|
|
6
|
+
dark palette, whatever the app's theme. */
|
|
7
|
+
|
|
8
|
+
export const STYLES = `
|
|
9
|
+
:host {
|
|
10
|
+
all: initial;
|
|
11
|
+
--bg: #0c0c0f;
|
|
12
|
+
--bg-1: #121216;
|
|
13
|
+
--bg-2: #18181e;
|
|
14
|
+
--bg-3: #202027;
|
|
15
|
+
--line: rgb(255 255 255 / 0.07);
|
|
16
|
+
--line-2: rgb(255 255 255 / 0.13);
|
|
17
|
+
--text: #f4f4f5;
|
|
18
|
+
--muted: #a1a1aa;
|
|
19
|
+
--faint: #6b6b76;
|
|
20
|
+
--brand: #eab308;
|
|
21
|
+
--brand-2: #facc15;
|
|
22
|
+
--brand-ink: #1c1500;
|
|
23
|
+
--brand-soft: rgb(234 179 8 / 0.12);
|
|
24
|
+
--brand-line: rgb(234 179 8 / 0.38);
|
|
25
|
+
--error: #f87171;
|
|
26
|
+
--error-soft: rgb(248 113 113 / 0.12);
|
|
27
|
+
--advice: #7dd3fc;
|
|
28
|
+
--advice-soft: rgb(125 211 252 / 0.11);
|
|
29
|
+
--ok: #4ade80;
|
|
30
|
+
--ok-soft: rgb(74 222 128 / 0.12);
|
|
31
|
+
--sans: "${FAMILIES.sans}", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
32
|
+
--display: "${FAMILIES.display}", "Space Grotesk", var(--sans);
|
|
33
|
+
--mono: "${FAMILIES.mono}", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
34
|
+
--ease: cubic-bezier(0.22, 1, 0.36, 1);
|
|
35
|
+
--spring: cubic-bezier(0.34, 1.4, 0.64, 1);
|
|
36
|
+
font: 400 13px/1.5 var(--sans);
|
|
37
|
+
color: var(--text);
|
|
38
|
+
-webkit-font-smoothing: antialiased;
|
|
39
|
+
}
|
|
40
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
41
|
+
button, input, textarea { font: inherit; color: inherit; }
|
|
42
|
+
button { cursor: pointer; background: none; border: 0; padding: 0; }
|
|
43
|
+
[hidden] { display: none !important; }
|
|
44
|
+
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
|
|
45
|
+
.icon { display: inline-grid; place-items: center; flex: none; }
|
|
46
|
+
.icon svg { width: 100%; height: 100%; display: block; }
|
|
47
|
+
::-webkit-scrollbar { width: 10px; height: 10px; }
|
|
48
|
+
::-webkit-scrollbar-thumb { background: rgb(255 255 255 / 0.09); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
|
|
49
|
+
::-webkit-scrollbar-thumb:hover { background-color: rgb(255 255 255 / 0.16); }
|
|
50
|
+
|
|
51
|
+
/* ---- launcher ---------------------------------------------------------------- */
|
|
52
|
+
|
|
53
|
+
.launcher {
|
|
54
|
+
position: fixed; left: 0; top: 0; z-index: 2147483001;
|
|
55
|
+
display: flex; align-items: center; height: 44px; padding: 4px;
|
|
56
|
+
border-radius: 14px; background: rgb(14 14 18 / 0.92);
|
|
57
|
+
border: 1px solid var(--line-2);
|
|
58
|
+
box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(0 0 0 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.06);
|
|
59
|
+
backdrop-filter: blur(14px) saturate(160%);
|
|
60
|
+
-webkit-backdrop-filter: blur(14px) saturate(160%);
|
|
61
|
+
touch-action: none; user-select: none;
|
|
62
|
+
animation: launcher-in 520ms var(--spring) both;
|
|
63
|
+
transition: box-shadow 200ms var(--ease), border-color 200ms var(--ease);
|
|
64
|
+
}
|
|
65
|
+
.launcher:hover { border-color: var(--brand-line); }
|
|
66
|
+
.launcher.dragging { cursor: grabbing; box-shadow: 0 18px 44px -10px rgb(0 0 0 / 0.75), 0 0 0 1px var(--brand-line); transition: none; }
|
|
67
|
+
.launcher.settling { transition: transform 360ms var(--spring), box-shadow 200ms var(--ease); }
|
|
68
|
+
@keyframes launcher-in { from { opacity: 0; scale: 0.6; } }
|
|
69
|
+
.launcher-button {
|
|
70
|
+
position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
|
|
71
|
+
color: var(--muted); transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
|
|
72
|
+
}
|
|
73
|
+
.launcher-button:hover { background: rgb(255 255 255 / 0.07); color: var(--text); }
|
|
74
|
+
.launcher-button:active { transform: scale(0.92); }
|
|
75
|
+
.launcher-button .icon { width: 18px; height: 18px; }
|
|
76
|
+
.launcher-button.mark { color: var(--brand); }
|
|
77
|
+
.launcher-button.mark .icon { width: 20px; height: 20px; }
|
|
78
|
+
.launcher-button.mark:hover .b4 { transform: rotate(-8deg) translate(-1px, 1px); }
|
|
79
|
+
.launcher .b4 { transform-box: fill-box; transform-origin: center; transition: transform 300ms var(--spring); }
|
|
80
|
+
.launcher[data-open="true"] .launcher-button.mark { background: var(--brand-soft); }
|
|
81
|
+
.launcher-button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
|
|
82
|
+
.launcher-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--line-2); }
|
|
83
|
+
.dot {
|
|
84
|
+
position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px;
|
|
85
|
+
border-radius: 8px; font: 600 10px/16px var(--sans); text-align: center;
|
|
86
|
+
background: var(--error); color: #2a0606; box-shadow: 0 0 0 2px rgb(14 14 18);
|
|
87
|
+
animation: pop 360ms var(--spring) both;
|
|
88
|
+
}
|
|
89
|
+
.dot.advice { background: var(--advice); color: #04202c; }
|
|
90
|
+
@keyframes pop { from { scale: 0.3; opacity: 0; } }
|
|
91
|
+
|
|
92
|
+
/* ---- panel ------------------------------------------------------------------- */
|
|
93
|
+
|
|
94
|
+
.panel {
|
|
95
|
+
position: fixed; left: 0; top: 0; z-index: 2147483000;
|
|
96
|
+
width: min(640px, calc(100vw - 24px)); height: min(560px, calc(100vh - 24px));
|
|
97
|
+
display: grid; grid-template-columns: 60px 1fr;
|
|
98
|
+
border-radius: 18px; overflow: hidden;
|
|
99
|
+
background: linear-gradient(180deg, rgb(255 255 255 / 0.025), transparent 40%), rgb(12 12 15 / 0.96);
|
|
100
|
+
border: 1px solid var(--line-2);
|
|
101
|
+
box-shadow: 0 30px 90px -20px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(0 0 0 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.05);
|
|
102
|
+
backdrop-filter: blur(24px) saturate(150%);
|
|
103
|
+
-webkit-backdrop-filter: blur(24px) saturate(150%);
|
|
104
|
+
opacity: 0; scale: 0.94; translate: 0 10px; pointer-events: none; visibility: hidden;
|
|
105
|
+
transition: opacity 200ms var(--ease), scale 280ms var(--ease), translate 280ms var(--ease), visibility 0s linear 280ms;
|
|
106
|
+
}
|
|
107
|
+
.panel[data-open="true"] {
|
|
108
|
+
opacity: 1; scale: 1; translate: 0 0; pointer-events: auto; visibility: visible;
|
|
109
|
+
transition: opacity 180ms var(--ease), scale 360ms var(--spring), translate 360ms var(--spring), visibility 0s;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.sidebar {
|
|
113
|
+
position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
|
|
114
|
+
padding: 12px 0; background: rgb(255 255 255 / 0.015); border-right: 1px solid var(--line);
|
|
115
|
+
}
|
|
116
|
+
.brand { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 10px; color: var(--brand); }
|
|
117
|
+
.brand .icon { width: 24px; height: 24px; filter: drop-shadow(0 0 12px rgb(234 179 8 / 0.35)); }
|
|
118
|
+
.nav { position: relative; display: flex; flex-direction: column; gap: 4px; }
|
|
119
|
+
.nav-indicator {
|
|
120
|
+
position: absolute; left: -10px; top: 0; width: 3px; height: 20px; margin-top: 10px;
|
|
121
|
+
border-radius: 0 3px 3px 0; background: var(--brand); box-shadow: 0 0 12px var(--brand);
|
|
122
|
+
transition: transform 360ms var(--spring), opacity 200ms var(--ease);
|
|
123
|
+
}
|
|
124
|
+
.nav-button {
|
|
125
|
+
position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
|
|
126
|
+
color: var(--faint); transition: background 160ms var(--ease), color 160ms var(--ease);
|
|
127
|
+
}
|
|
128
|
+
.nav-button .icon { width: 19px; height: 19px; transition: transform 240ms var(--spring); }
|
|
129
|
+
.nav-button:hover { color: var(--text); background: rgb(255 255 255 / 0.05); }
|
|
130
|
+
.nav-button:hover .icon { transform: scale(1.08); }
|
|
131
|
+
.nav-button[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
|
|
132
|
+
.nav-button[aria-pressed="true"] { color: var(--brand-ink); background: var(--brand); }
|
|
133
|
+
.nav-button .count {
|
|
134
|
+
position: absolute; top: 3px; right: 2px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px;
|
|
135
|
+
font: 600 9.5px/15px var(--sans); text-align: center; background: var(--error); color: #2a0606;
|
|
136
|
+
box-shadow: 0 0 0 2px var(--bg);
|
|
137
|
+
}
|
|
138
|
+
.nav-button .count.advice { background: var(--advice); color: #04202c; }
|
|
139
|
+
.tip {
|
|
140
|
+
position: absolute; left: calc(100% + 10px); top: 50%; translate: -4px -50%; z-index: 2;
|
|
141
|
+
padding: 4px 8px; border-radius: 7px; white-space: nowrap; pointer-events: none;
|
|
142
|
+
font: 500 12px/1.3 var(--sans); color: var(--text); background: var(--bg-3); border: 1px solid var(--line-2);
|
|
143
|
+
box-shadow: 0 8px 20px -6px rgb(0 0 0 / 0.6); opacity: 0;
|
|
144
|
+
transition: opacity 140ms var(--ease), translate 200ms var(--ease);
|
|
145
|
+
}
|
|
146
|
+
.nav-button:hover .tip, .nav-button:focus-visible .tip { opacity: 1; translate: 0 -50%; transition-delay: 250ms; }
|
|
147
|
+
.sidebar-end { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
|
|
148
|
+
|
|
149
|
+
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
|
|
150
|
+
.topbar {
|
|
151
|
+
display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px 0 18px; flex: none;
|
|
152
|
+
border-bottom: 1px solid var(--line);
|
|
153
|
+
}
|
|
154
|
+
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font: 600 14px/1 var(--display); letter-spacing: -0.01em; }
|
|
155
|
+
.crumbs .icon { width: 14px; height: 14px; color: var(--faint); }
|
|
156
|
+
.crumb-link { color: var(--muted); transition: color 140ms; }
|
|
157
|
+
.crumb-link:hover { color: var(--text); }
|
|
158
|
+
.crumb-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
159
|
+
.crumb-current.code { font: 600 13px/1 var(--mono); }
|
|
160
|
+
.status {
|
|
161
|
+
display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; border-radius: 999px;
|
|
162
|
+
font: 500 11.5px/1 var(--sans); color: var(--muted); background: rgb(255 255 255 / 0.04); border: 1px solid var(--line);
|
|
163
|
+
}
|
|
164
|
+
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
|
|
165
|
+
.status.live i { background: var(--ok); box-shadow: 0 0 0 0 rgb(74 222 128 / 0.5); animation: pulse 2.2s var(--ease) infinite; }
|
|
166
|
+
.status.unreachable i { background: var(--error); }
|
|
167
|
+
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgb(74 222 128 / 0); } 100% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0); } }
|
|
168
|
+
.icon-button {
|
|
169
|
+
display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--muted);
|
|
170
|
+
transition: background 140ms var(--ease), color 140ms var(--ease);
|
|
171
|
+
}
|
|
172
|
+
.icon-button:hover { background: rgb(255 255 255 / 0.06); color: var(--text); }
|
|
173
|
+
.icon-button .icon { width: 16px; height: 16px; }
|
|
174
|
+
.view { flex: 1; min-height: 0; overflow: hidden auto; padding: 18px; scroll-padding: 18px; }
|
|
175
|
+
|
|
176
|
+
/* ---- shared pieces ----------------------------------------------------------------- */
|
|
177
|
+
|
|
178
|
+
h1, h2, h3, h4, p { margin: 0; }
|
|
179
|
+
.muted { color: var(--muted); }
|
|
180
|
+
.faint { color: var(--faint); }
|
|
181
|
+
.code { font-family: var(--mono); }
|
|
182
|
+
.stack { display: flex; flex-direction: column; gap: 12px; }
|
|
183
|
+
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
184
|
+
.grow { flex: 1; min-width: 0; }
|
|
185
|
+
.section-title {
|
|
186
|
+
display: flex; align-items: center; gap: 8px; margin: 2px 0 8px;
|
|
187
|
+
font: 600 11px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
|
|
188
|
+
}
|
|
189
|
+
.section-title .n { color: var(--muted); letter-spacing: 0; }
|
|
190
|
+
.card {
|
|
191
|
+
position: relative; border-radius: 14px; background: var(--bg-1); border: 1px solid var(--line);
|
|
192
|
+
}
|
|
193
|
+
.pad { padding: 14px; }
|
|
194
|
+
.btn {
|
|
195
|
+
display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
|
|
196
|
+
border-radius: 10px; font: 500 12.5px/1 var(--sans); white-space: nowrap;
|
|
197
|
+
background: rgb(255 255 255 / 0.05); border: 1px solid var(--line-2); color: var(--text);
|
|
198
|
+
transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease), box-shadow 200ms var(--ease);
|
|
199
|
+
}
|
|
200
|
+
.btn:hover { background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.2); }
|
|
201
|
+
.btn:active { transform: scale(0.97); }
|
|
202
|
+
.btn .icon { width: 15px; height: 15px; }
|
|
203
|
+
.btn.primary {
|
|
204
|
+
background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: var(--brand-ink); border-color: transparent; font-weight: 600;
|
|
205
|
+
box-shadow: 0 6px 20px -8px rgb(234 179 8 / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.35);
|
|
206
|
+
}
|
|
207
|
+
.btn.primary:hover { box-shadow: 0 8px 26px -8px rgb(234 179 8 / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.35); }
|
|
208
|
+
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
|
|
209
|
+
.btn.ghost:hover { color: var(--text); background: rgb(255 255 255 / 0.05); }
|
|
210
|
+
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
|
|
211
|
+
.btn[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
|
|
212
|
+
.pill {
|
|
213
|
+
display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
|
|
214
|
+
font: 500 11px/1 var(--sans); color: var(--muted); background: rgb(255 255 255 / 0.04); border: 1px solid var(--line);
|
|
215
|
+
white-space: nowrap;
|
|
216
|
+
}
|
|
217
|
+
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
|
218
|
+
.pill.none { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
|
|
219
|
+
.pill.leaf { color: var(--brand-2); background: var(--brand-soft); border-color: transparent; }
|
|
220
|
+
.pill.required { color: var(--advice); background: var(--advice-soft); border-color: transparent; }
|
|
221
|
+
.pill.error { color: var(--error); background: var(--error-soft); border-color: transparent; }
|
|
222
|
+
.pill.advice { color: var(--advice); background: var(--advice-soft); border-color: transparent; }
|
|
223
|
+
.pill.brand { color: var(--brand-2); background: var(--brand-soft); border-color: transparent; }
|
|
224
|
+
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-2); text-decoration: none; font-weight: 500; }
|
|
225
|
+
.link .icon { width: 13px; height: 13px; }
|
|
226
|
+
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
|
|
227
|
+
.kbd {
|
|
228
|
+
display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px;
|
|
229
|
+
font: 500 11px/1 var(--mono); color: var(--text); background: var(--bg-3); border: 1px solid var(--line-2);
|
|
230
|
+
box-shadow: inset 0 -1.5px 0 rgb(0 0 0 / 0.5);
|
|
231
|
+
}
|
|
232
|
+
.path { font: 12px/1.4 var(--mono); word-break: break-all; }
|
|
233
|
+
.path .dir { color: var(--faint); }
|
|
234
|
+
.path .base { color: var(--text); }
|
|
235
|
+
.empty {
|
|
236
|
+
display: grid; justify-items: center; gap: 10px; padding: 36px 20px; text-align: center; color: var(--muted);
|
|
237
|
+
}
|
|
238
|
+
.empty .icon { width: 40px; height: 40px; padding: 10px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); }
|
|
239
|
+
.empty.neutral .icon { background: rgb(255 255 255 / 0.05); color: var(--muted); }
|
|
240
|
+
.empty h3 { font: 600 15px/1.3 var(--display); color: var(--text); }
|
|
241
|
+
.notice { padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--muted); }
|
|
242
|
+
.notice code, p code { font: 12px var(--mono); color: var(--text); background: rgb(255 255 255 / 0.05); padding: 1px 5px; border-radius: 5px; }
|
|
243
|
+
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, rgb(255 255 255 / 0.04), rgb(255 255 255 / 0.09), rgb(255 255 255 / 0.04)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
|
|
244
|
+
@keyframes shimmer { to { background-position: -200% 0; } }
|
|
245
|
+
|
|
246
|
+
/* ---- home -------------------------------------------------------------------- */
|
|
247
|
+
|
|
248
|
+
.hero { position: relative; display: flex; align-items: center; gap: 16px; padding: 4px 2px 20px; }
|
|
249
|
+
.hero::before {
|
|
250
|
+
content: ""; position: absolute; inset: -60px -40px auto -60px; height: 220px; pointer-events: none;
|
|
251
|
+
background: radial-gradient(closest-side, rgb(234 179 8 / 0.16), transparent); filter: blur(10px);
|
|
252
|
+
}
|
|
253
|
+
.hero-mark { position: relative; width: 52px; height: 52px; color: var(--brand); flex: none; }
|
|
254
|
+
.hero-mark svg { width: 100%; height: 100%; overflow: visible; }
|
|
255
|
+
.hero-mark rect { transform-box: fill-box; transform-origin: center; animation: block-in 620ms var(--spring) both; }
|
|
256
|
+
.hero-mark .b1 { animation-delay: 40ms; }
|
|
257
|
+
.hero-mark .b2 { animation-delay: 120ms; }
|
|
258
|
+
.hero-mark .b3 { animation-delay: 200ms; }
|
|
259
|
+
.hero-mark .b4 { animation: block-tip 760ms var(--spring) 300ms both; }
|
|
260
|
+
@keyframes block-in { from { opacity: 0; translate: 0 -10px; scale: 0.6; } }
|
|
261
|
+
@keyframes block-tip { from { opacity: 0; translate: 6px -14px; rotate: 40deg; } }
|
|
262
|
+
.hero h1 { position: relative; font: 600 22px/1.15 var(--display); letter-spacing: -0.02em; }
|
|
263
|
+
.hero h1 span { color: var(--brand); }
|
|
264
|
+
.hero p { position: relative; margin-top: 6px; color: var(--muted); }
|
|
265
|
+
.hero .row { position: relative; margin-top: 10px; }
|
|
266
|
+
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
|
|
267
|
+
.tile {
|
|
268
|
+
position: relative; display: flex; flex-direction: column; gap: 14px; padding: 14px; overflow: hidden; text-align: left;
|
|
269
|
+
border-radius: 14px; background: var(--bg-1); border: 1px solid var(--line);
|
|
270
|
+
transition: border-color 200ms var(--ease), transform 260ms var(--spring), background 200ms var(--ease);
|
|
271
|
+
animation: rise 460ms var(--ease) both;
|
|
272
|
+
}
|
|
273
|
+
.tile::before {
|
|
274
|
+
content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 240ms var(--ease);
|
|
275
|
+
background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgb(234 179 8 / 0.1), transparent 60%);
|
|
276
|
+
}
|
|
277
|
+
.tile:hover { border-color: var(--brand-line); transform: translateY(-2px); background: var(--bg-2); }
|
|
278
|
+
.tile:hover::before { opacity: 1; }
|
|
279
|
+
.tile:nth-child(2) { animation-delay: 50ms; }
|
|
280
|
+
.tile:nth-child(3) { animation-delay: 100ms; }
|
|
281
|
+
.tile:nth-child(4) { animation-delay: 150ms; }
|
|
282
|
+
@keyframes rise { from { opacity: 0; translate: 0 8px; } }
|
|
283
|
+
.tile-head { display: flex; align-items: center; justify-content: space-between; }
|
|
284
|
+
.tile-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
|
|
285
|
+
.tile-icon .icon { width: 18px; height: 18px; }
|
|
286
|
+
.tile.error .tile-icon { background: var(--error-soft); color: var(--error); }
|
|
287
|
+
.tile.advice .tile-icon { background: var(--advice-soft); color: var(--advice); }
|
|
288
|
+
.tile.clean .tile-icon { background: var(--ok-soft); color: var(--ok); }
|
|
289
|
+
.tile-arrow { width: 16px; height: 16px; color: var(--faint); transition: transform 260ms var(--spring), color 200ms; }
|
|
290
|
+
.tile:hover .tile-arrow { transform: translateX(3px); color: var(--brand); }
|
|
291
|
+
.tile-value { font: 600 30px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
|
|
292
|
+
.tile-label { margin-top: 6px; font-weight: 600; }
|
|
293
|
+
.tile-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
|
|
294
|
+
.shortcuts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: rgb(255 255 255 / 0.02); border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
|
|
295
|
+
.shortcut { display: inline-flex; align-items: center; gap: 4px; }
|
|
296
|
+
.shortcut span:last-child { margin-left: 6px; }
|
|
297
|
+
|
|
298
|
+
/* ---- lists ------------------------------------------------------------------- */
|
|
299
|
+
|
|
300
|
+
.search {
|
|
301
|
+
display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; margin-bottom: 14px;
|
|
302
|
+
border-radius: 11px; background: var(--bg-1); border: 1px solid var(--line); transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
|
|
303
|
+
}
|
|
304
|
+
.search:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
|
|
305
|
+
.search .icon { width: 15px; height: 15px; color: var(--faint); }
|
|
306
|
+
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; }
|
|
307
|
+
.search input::placeholder { color: var(--faint); }
|
|
308
|
+
.list { display: flex; flex-direction: column; gap: 2px; }
|
|
309
|
+
.group { border-radius: 11px; transition: background 160ms var(--ease); }
|
|
310
|
+
.group[data-open="true"] { background: rgb(255 255 255 / 0.025); }
|
|
311
|
+
.group-row, .instance-row {
|
|
312
|
+
display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 10px; border-radius: 10px; text-align: left;
|
|
313
|
+
transition: background 140ms var(--ease);
|
|
314
|
+
}
|
|
315
|
+
.group-row:hover, .instance-row:hover { background: rgb(255 255 255 / 0.05); }
|
|
316
|
+
.group-row .chev { width: 14px; height: 14px; color: var(--faint); transition: transform 240ms var(--spring); }
|
|
317
|
+
.group[data-open="true"] .chev { transform: rotate(90deg); }
|
|
318
|
+
.group-row .name { font: 500 13px/1.2 var(--mono); }
|
|
319
|
+
.tier-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--faint); }
|
|
320
|
+
.tier-dot.none { background: var(--ok); }
|
|
321
|
+
.tier-dot.leaf { background: var(--brand); }
|
|
322
|
+
.tier-dot.required { background: var(--advice); }
|
|
323
|
+
.n-pill { min-width: 22px; padding: 2px 7px; border-radius: 999px; font: 500 11px/1.3 var(--sans); text-align: center; color: var(--muted); background: rgb(255 255 255 / 0.06); }
|
|
324
|
+
.mini { display: inline-flex; align-items: center; gap: 4px; font: 600 11px/1 var(--sans); }
|
|
325
|
+
.mini.error { color: var(--error); }
|
|
326
|
+
.mini.advice { color: var(--advice); }
|
|
327
|
+
.mini i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
|
328
|
+
.instances { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 300ms var(--ease); }
|
|
329
|
+
.group[data-open="true"] .instances { grid-template-rows: 1fr; }
|
|
330
|
+
.instances > div { overflow: hidden; }
|
|
331
|
+
.instances .list { padding: 0 6px 6px 30px; }
|
|
332
|
+
.instance-row { min-height: 34px; font-size: 12.5px; }
|
|
333
|
+
.instance-row .idx { font: 500 11px var(--mono); color: var(--faint); width: 22px; }
|
|
334
|
+
.instance-row .text { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
335
|
+
.instance-row .props { font: 11.5px var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
336
|
+
.instance-row .go { width: 14px; height: 14px; color: var(--faint); opacity: 0; transition: opacity 140ms, transform 200ms var(--spring); }
|
|
337
|
+
.instance-row:hover .go { opacity: 1; transform: translateX(2px); color: var(--brand); }
|
|
338
|
+
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 11.5px; color: var(--faint); }
|
|
339
|
+
.legend span { display: inline-flex; align-items: center; gap: 6px; }
|
|
340
|
+
|
|
341
|
+
/* ---- findings ------------------------------------------------------------------ */
|
|
342
|
+
|
|
343
|
+
.summary { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
|
|
344
|
+
.summary-value { font: 600 34px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
|
|
345
|
+
.summary.error .summary-value { color: var(--error); }
|
|
346
|
+
.summary.advice .summary-value { color: var(--advice); }
|
|
347
|
+
.summary-text { color: var(--muted); font-size: 12.5px; }
|
|
348
|
+
.summary-text strong { display: block; color: var(--text); font: 600 14px/1.3 var(--display); }
|
|
349
|
+
.segmented { display: inline-flex; padding: 3px; margin-left: auto; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line); }
|
|
350
|
+
.segmented button { height: 26px; padding: 0 10px; border-radius: 7px; font-size: 12px; color: var(--muted); transition: background 160ms var(--ease), color 160ms var(--ease); }
|
|
351
|
+
.segmented button[aria-pressed="true"] { background: var(--bg-3); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.4); }
|
|
352
|
+
.file-card { margin-bottom: 10px; border-radius: 13px; background: var(--bg-1); border: 1px solid var(--line); overflow: hidden; animation: rise 360ms var(--ease) both; }
|
|
353
|
+
.file-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 0.015); }
|
|
354
|
+
.file-head .icon { width: 14px; height: 14px; color: var(--faint); }
|
|
355
|
+
.finding { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 10px 12px 10px 15px; }
|
|
356
|
+
.finding + .finding { border-top: 1px solid var(--line); }
|
|
357
|
+
.finding::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--error); }
|
|
358
|
+
.finding.warning::before { background: var(--advice); }
|
|
359
|
+
.finding .at { font: 500 11.5px/1.6 var(--mono); color: var(--faint); }
|
|
360
|
+
.finding .message { line-height: 1.45; }
|
|
361
|
+
.finding .meta { grid-column: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
|
|
362
|
+
.finding .rule { font: 11px var(--mono); color: var(--faint); }
|
|
363
|
+
.chip {
|
|
364
|
+
display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px;
|
|
365
|
+
font: 500 11.5px/1 var(--mono); color: var(--text); background: rgb(255 255 255 / 0.05); border: 1px solid var(--line);
|
|
366
|
+
transition: border-color 140ms var(--ease), color 140ms var(--ease);
|
|
367
|
+
}
|
|
368
|
+
button.chip:hover { border-color: var(--brand-line); color: var(--brand-2); }
|
|
369
|
+
.chip .icon { width: 12px; height: 12px; }
|
|
370
|
+
.chip.exact { color: var(--brand-2); border-color: var(--brand-line); background: var(--brand-soft); }
|
|
371
|
+
|
|
372
|
+
/* ---- component detail ----------------------------------------------------------- */
|
|
373
|
+
|
|
374
|
+
.detail-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
|
|
375
|
+
.detail-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; flex: none; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line); }
|
|
376
|
+
.detail-icon .icon { width: 22px; height: 22px; }
|
|
377
|
+
.detail-head h2 { font: 600 20px/1.2 var(--mono); letter-spacing: -0.01em; word-break: break-word; }
|
|
378
|
+
.detail-head .chain { margin-top: 4px; font: 12px var(--mono); color: var(--faint); }
|
|
379
|
+
.detail-head .row { margin-top: 10px; }
|
|
380
|
+
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
|
|
381
|
+
.props { width: 100%; border-collapse: collapse; font: 12px/1.5 var(--mono); }
|
|
382
|
+
.props td { padding: 7px 0; vertical-align: top; border-top: 1px solid var(--line); }
|
|
383
|
+
.props tr:first-child td { border-top: 0; }
|
|
384
|
+
.props td:first-child { width: 1%; padding-right: 16px; white-space: nowrap; color: var(--muted); }
|
|
385
|
+
.props td:last-child { color: var(--brand-2); word-break: break-word; }
|
|
386
|
+
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
387
|
+
.gone { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border-radius: 11px; background: var(--error-soft); color: var(--error); font-size: 12.5px; }
|
|
388
|
+
|
|
389
|
+
/* ---- report ------------------------------------------------------------------ */
|
|
390
|
+
|
|
391
|
+
.target { display: flex; align-items: center; gap: 12px; padding: 12px; }
|
|
392
|
+
.target .detail-icon { width: 36px; height: 36px; border-radius: 10px; }
|
|
393
|
+
.target .detail-icon .icon { width: 18px; height: 18px; }
|
|
394
|
+
.target .name { font: 600 14px/1.2 var(--mono); }
|
|
395
|
+
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
|
|
396
|
+
.field {
|
|
397
|
+
display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border-radius: 10px; resize: vertical;
|
|
398
|
+
background: var(--bg-1); color: var(--text); border: 1px solid var(--line-2); outline: none;
|
|
399
|
+
transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
|
|
400
|
+
}
|
|
401
|
+
.field::placeholder { color: var(--faint); }
|
|
402
|
+
.field:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
|
|
403
|
+
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; cursor: pointer; }
|
|
404
|
+
.switch-row + .switch-row { border-top: 1px solid var(--line); }
|
|
405
|
+
.switch-row small { display: block; color: var(--faint); font-size: 11.5px; }
|
|
406
|
+
.switch { position: relative; width: 34px; height: 20px; flex: none; }
|
|
407
|
+
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
|
|
408
|
+
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line-2); transition: background 200ms var(--ease); pointer-events: none; }
|
|
409
|
+
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 260ms var(--spring), background 200ms; }
|
|
410
|
+
.switch input:checked + span { background: var(--brand); border-color: transparent; }
|
|
411
|
+
.switch input:checked + span::after { transform: translateX(14px); background: var(--brand-ink); }
|
|
412
|
+
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
|
|
413
|
+
.shot { display: flex; align-items: center; gap: 10px; }
|
|
414
|
+
.thumb { max-width: 120px; max-height: 72px; border-radius: 8px; border: 1px solid var(--line-2); }
|
|
415
|
+
details.json-box { border-radius: 12px; background: var(--bg-1); border: 1px solid var(--line); }
|
|
416
|
+
details.json-box summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; font-weight: 500; }
|
|
417
|
+
details.json-box summary::-webkit-details-marker { display: none; }
|
|
418
|
+
details.json-box summary .icon { width: 14px; height: 14px; color: var(--faint); transition: transform 240ms var(--spring); }
|
|
419
|
+
details.json-box[open] summary .icon { transform: rotate(90deg); }
|
|
420
|
+
.json {
|
|
421
|
+
margin: 0; max-height: 220px; overflow: auto; padding: 12px; border-top: 1px solid var(--line);
|
|
422
|
+
font: 11px/1.5 var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-word;
|
|
423
|
+
}
|
|
424
|
+
.problems { margin: 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--error-soft); color: var(--error); font-size: 12px; }
|
|
425
|
+
.problems:empty { display: none; }
|
|
426
|
+
.report-status { font-size: 12.5px; min-height: 18px; }
|
|
427
|
+
.report-status.failed { color: var(--error); }
|
|
428
|
+
.report-status.sent { color: var(--ok); }
|
|
429
|
+
|
|
430
|
+
/* ---- GitHub ------------------------------------------------------------------- */
|
|
431
|
+
|
|
432
|
+
.small { font-size: 12px; }
|
|
433
|
+
.account { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
|
|
434
|
+
.account-name { font: 600 14px/1.3 var(--display); }
|
|
435
|
+
.account-error { margin-top: 6px; font-size: 12px; color: var(--error); }
|
|
436
|
+
.account-actions { display: flex; flex-direction: column; gap: 6px; }
|
|
437
|
+
.gh-avatar {
|
|
438
|
+
display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
|
|
439
|
+
font: 600 15px/1 var(--display); color: var(--brand-ink); background: linear-gradient(180deg, var(--brand-2), var(--brand));
|
|
440
|
+
}
|
|
441
|
+
.gh-avatar.muted-avatar { color: var(--text); background: var(--bg-3); border: 1px solid var(--line-2); }
|
|
442
|
+
.gh-avatar .icon { width: 18px; height: 18px; }
|
|
443
|
+
.account.pending { align-items: stretch; border-color: var(--brand-line); background: linear-gradient(180deg, var(--brand-soft), transparent 70%), var(--bg-1); }
|
|
444
|
+
.device-code {
|
|
445
|
+
margin: 6px 0 8px; font: 600 28px/1 var(--mono); letter-spacing: 0.12em; color: var(--brand-2);
|
|
446
|
+
text-shadow: 0 0 24px rgb(234 179 8 / 0.35); user-select: all;
|
|
447
|
+
}
|
|
448
|
+
.waiting { gap: 8px; font-size: 12px; color: var(--muted); }
|
|
449
|
+
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
|
|
450
|
+
.spinning svg { animation: spin 0.8s linear infinite; }
|
|
451
|
+
.issue-row {
|
|
452
|
+
display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; color: inherit; text-decoration: none;
|
|
453
|
+
transition: background 140ms var(--ease);
|
|
454
|
+
}
|
|
455
|
+
.issue-row + .issue-row { border-top: 1px solid var(--line); }
|
|
456
|
+
.issue-row:hover { background: rgb(255 255 255 / 0.03); }
|
|
457
|
+
.issue-row .state { width: 16px; height: 16px; margin-top: 1px; }
|
|
458
|
+
.issue-row.open .state { color: var(--ok); }
|
|
459
|
+
.issue-row.done .state { color: #c4a5ff; }
|
|
460
|
+
.issue-row.skipped .state { color: var(--faint); }
|
|
461
|
+
.issue-title { font-weight: 500; line-height: 1.4; }
|
|
462
|
+
.issue-meta { margin-top: 2px; font-size: 12px; color: var(--faint); }
|
|
463
|
+
.issue-row .go { width: 14px; height: 14px; color: var(--faint); opacity: 0; transition: opacity 140ms; }
|
|
464
|
+
.issue-row:hover .go { opacity: 1; color: var(--brand); }
|
|
465
|
+
button.link { font: inherit; padding: 0; }
|
|
466
|
+
.similar { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
|
|
467
|
+
.similar.likely { border-color: var(--brand-line); background: linear-gradient(180deg, var(--brand-soft), transparent 80%), var(--bg-1); }
|
|
468
|
+
.similar-head { display: flex; align-items: center; gap: 8px; font: 600 13.5px/1.3 var(--display); }
|
|
469
|
+
.similar-head .icon { width: 15px; height: 15px; color: var(--brand); }
|
|
470
|
+
.similar-head.quiet { margin-top: 4px; font: 600 11px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
|
|
471
|
+
.similar-row { display: flex; align-items: center; gap: 10px; min-height: 34px; }
|
|
472
|
+
.similar-row .state { width: 15px; height: 15px; }
|
|
473
|
+
.similar-row .state.open { color: var(--ok); }
|
|
474
|
+
.similar-row .state.closed { color: #c4a5ff; }
|
|
475
|
+
.similar-title { color: var(--text); text-decoration: none; line-height: 1.35; }
|
|
476
|
+
.similar-title:hover { color: var(--brand-2); }
|
|
477
|
+
|
|
478
|
+
/* ---- picking ------------------------------------------------------------------- */
|
|
479
|
+
|
|
480
|
+
.highlight {
|
|
481
|
+
position: fixed; left: 0; top: 0; z-index: 2147482999; pointer-events: none;
|
|
482
|
+
border: 1.5px solid var(--brand); border-radius: 6px;
|
|
483
|
+
background: rgb(234 179 8 / 0.08);
|
|
484
|
+
box-shadow: 0 0 0 4px rgb(234 179 8 / 0.12), 0 0 30px rgb(234 179 8 / 0.15);
|
|
485
|
+
transition: transform 90ms var(--ease), width 90ms var(--ease), height 90ms var(--ease), opacity 120ms;
|
|
486
|
+
}
|
|
487
|
+
.highlight.flash { animation: flash 900ms var(--ease) 2; }
|
|
488
|
+
@keyframes flash { 50% { box-shadow: 0 0 0 10px rgb(234 179 8 / 0.25), 0 0 40px rgb(234 179 8 / 0.35); } }
|
|
489
|
+
.highlight .label {
|
|
490
|
+
position: absolute; left: -1.5px; bottom: calc(100% + 6px); display: flex; align-items: center; gap: 8px;
|
|
491
|
+
padding: 5px 9px; border-radius: 8px; white-space: nowrap;
|
|
492
|
+
background: var(--brand); color: var(--brand-ink); font: 600 11.5px/1 var(--mono);
|
|
493
|
+
box-shadow: 0 8px 20px -6px rgb(0 0 0 / 0.5);
|
|
494
|
+
}
|
|
495
|
+
.highlight .label .size { font-weight: 500; opacity: 0.7; }
|
|
496
|
+
.highlight.below .label { bottom: auto; top: calc(100% + 6px); }
|
|
497
|
+
.toast {
|
|
498
|
+
position: fixed; left: 50%; top: 16px; z-index: 2147483002; translate: -50% 0;
|
|
499
|
+
display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 12px;
|
|
500
|
+
background: rgb(14 14 18 / 0.94); border: 1px solid var(--brand-line); color: var(--text);
|
|
501
|
+
box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.7);
|
|
502
|
+
backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
|
|
503
|
+
animation: toast-in 380ms var(--spring) both;
|
|
504
|
+
}
|
|
505
|
+
.toast .icon { width: 16px; height: 16px; color: var(--brand); animation: spin 6s linear infinite; }
|
|
506
|
+
@keyframes toast-in { from { opacity: 0; translate: -50% -14px; } }
|
|
507
|
+
@keyframes spin { to { rotate: 360deg; } }
|
|
508
|
+
|
|
509
|
+
@media (prefers-reduced-motion: reduce) {
|
|
510
|
+
*, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
|
|
511
|
+
}
|
|
512
|
+
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Astralis DevTools for a Next.js app. Place it once in the root layout:
|
|
7
|
+
*
|
|
8
|
+
* import { AstralisDevTools } from "astralis-devtools/next";
|
|
9
|
+
* <body>{children}<AstralisDevTools /></body>
|
|
10
|
+
*
|
|
11
|
+
* and add the bridge's route (see "astralis-devtools/next/route"). It renders
|
|
12
|
+
* nothing itself. In development it loads the overlay after hydration; in a
|
|
13
|
+
* production build the branch that loads it is removed, so no DevTools code
|
|
14
|
+
* reaches the client.
|
|
15
|
+
*/
|
|
16
|
+
export function AstralisDevTools() {
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (process.env.NODE_ENV !== "production") {
|
|
19
|
+
let unmount = null;
|
|
20
|
+
let cancelled = false;
|
|
21
|
+
import("../client/overlay.mjs").then(({ mountOverlay }) => {
|
|
22
|
+
if (!cancelled) unmount = mountOverlay({ base: "/api/astralis-devtools", framework: "next" });
|
|
23
|
+
});
|
|
24
|
+
return () => {
|
|
25
|
+
cancelled = true;
|
|
26
|
+
unmount?.();
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}, []);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The DevTools bridge as a Next.js route handler. Re-export both methods from
|
|
3
|
+
* `app/api/astralis-devtools/[...path]/route.ts`:
|
|
4
|
+
*
|
|
5
|
+
* export { GET, POST } from "astralis-devtools/next/route";
|
|
6
|
+
*
|
|
7
|
+
* Answers the local machine only in development, and 404 in production.
|
|
8
|
+
*/
|
|
9
|
+
export function GET(request: Request): Promise<Response>;
|
|
10
|
+
export function POST(request: Request): Promise<Response>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The DevTools bridge as a Next.js route handler. Re-export it from
|
|
3
|
+
* `app/api/astralis-devtools/[...path]/route.ts`:
|
|
4
|
+
*
|
|
5
|
+
* export { GET, POST } from "astralis-devtools/next/route";
|
|
6
|
+
*
|
|
7
|
+
* In production it answers 404 without loading the bridge, so the validator
|
|
8
|
+
* never runs in a deployed app.
|
|
9
|
+
*/
|
|
10
|
+
async function answer(request) {
|
|
11
|
+
if (process.env.NODE_ENV === "production") return new Response(null, { status: 404 });
|
|
12
|
+
const { handle } = await import("../bridge/http.mjs");
|
|
13
|
+
return handle(request, { root: process.cwd(), framework: "next" });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const GET = answer;
|
|
17
|
+
export const POST = answer;
|
package/src/vite.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Structurally a Vite plugin; typed loosely so this package needs no Vite types. */
|
|
2
|
+
export interface AstralisDevtoolsPlugin {
|
|
3
|
+
name: "astralis-devtools";
|
|
4
|
+
apply: "serve";
|
|
5
|
+
[hook: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The Astralis DevTools for a Vite project. Dev server only: injects the
|
|
10
|
+
* overlay into index.html and serves the bridge. `vite build` never sees it.
|
|
11
|
+
*/
|
|
12
|
+
export function astralisDevtools(): AstralisDevtoolsPlugin;
|
package/src/vite.mjs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { bridgeFor } from "./bridge/bridge.mjs";
|
|
2
|
+
import { BASE_PATH } from "./bridge/http.mjs";
|
|
3
|
+
import { bridgeMiddleware } from "./bridge/node-adapter.mjs";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The module index.html loads to start the overlay. It is served by this
|
|
7
|
+
* plugin rather than written inline: Vite resolves the bare import in a module
|
|
8
|
+
* it serves, but not in an inline script a plugin injects into the page.
|
|
9
|
+
*/
|
|
10
|
+
export const ENTRY_URL = "/@astralis-devtools/entry.js";
|
|
11
|
+
const ENTRY_SOURCE = `import { mountOverlay } from "astralis-devtools/client";
|
|
12
|
+
mountOverlay({ base: ${JSON.stringify(BASE_PATH)}, framework: "vite" });
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The Astralis DevTools for a Vite project:
|
|
17
|
+
*
|
|
18
|
+
* // vite.config.ts
|
|
19
|
+
* import { astralisDevtools } from "astralis-devtools/vite";
|
|
20
|
+
* export default defineConfig({ plugins: [react(), astralisDevtools()] });
|
|
21
|
+
*
|
|
22
|
+
* `apply: "serve"` keeps it out of `vite build` entirely: the overlay is
|
|
23
|
+
* injected into index.html and the bridge mounted on the dev server only.
|
|
24
|
+
*/
|
|
25
|
+
export function astralisDevtools() {
|
|
26
|
+
let root = process.cwd();
|
|
27
|
+
return {
|
|
28
|
+
name: "astralis-devtools",
|
|
29
|
+
apply: "serve",
|
|
30
|
+
configResolved(config) {
|
|
31
|
+
root = config.root;
|
|
32
|
+
},
|
|
33
|
+
resolveId(id) {
|
|
34
|
+
return id === ENTRY_URL ? ENTRY_URL : null;
|
|
35
|
+
},
|
|
36
|
+
load(id) {
|
|
37
|
+
return id === ENTRY_URL ? ENTRY_SOURCE : null;
|
|
38
|
+
},
|
|
39
|
+
configureServer(server) {
|
|
40
|
+
// Vite already watches the project; the bridge listens to that watcher
|
|
41
|
+
// instead of opening a second one.
|
|
42
|
+
const watch = (onChange) => {
|
|
43
|
+
const events = ["add", "change", "unlink"];
|
|
44
|
+
for (const event of events) server.watcher.on(event, onChange);
|
|
45
|
+
return () => {
|
|
46
|
+
for (const event of events) server.watcher.off(event, onChange);
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
server.middlewares.use(BASE_PATH, bridgeMiddleware({ root, framework: "vite", watch }));
|
|
50
|
+
// Validate while the server starts, so the first page load has findings waiting.
|
|
51
|
+
bridgeFor(root, "vite", { watch })
|
|
52
|
+
.start()
|
|
53
|
+
.catch((error) => server.config.logger.warn(`[astralis-devtools] ${error.message}`));
|
|
54
|
+
},
|
|
55
|
+
transformIndexHtml() {
|
|
56
|
+
return [{ tag: "script", attrs: { type: "module", src: ENTRY_URL }, injectTo: "body" }];
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|