@kfiross44/valtio-inspector 0.9.3 → 0.9.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/client/app.js CHANGED
@@ -6,6 +6,7 @@ let selectedHistoryId = null
6
6
  let activeTab = 'tree'
7
7
  let collapsedPaths = new Set()
8
8
  let lastDiff = {}
9
+ let allExpanded = true
9
10
 
10
11
  /* ── WebSocket ── */
11
12
  const wsUrl = `ws://${location.host}`
@@ -67,6 +68,47 @@ function setStatus(connected) {
67
68
  text.textContent = connected ? 'connected' : 'disconnected'
68
69
  }
69
70
 
71
+ function collapseAll() {
72
+ function addCollapsedChildren(obj, basePath) {
73
+ if (!obj || typeof obj !== 'object') return
74
+
75
+ for (const key of Object.keys(obj)) {
76
+ const path = `${basePath}.${key}`
77
+ collapsedPaths.add(path)
78
+
79
+ addCollapsedChildren(obj[key], path)
80
+ }
81
+ }
82
+
83
+ collapsedPaths = new Set()
84
+
85
+ for (const key of Object.keys(stateTree)) {
86
+ const rootValue = stateTree[key]
87
+ addCollapsedChildren(rootValue, key)
88
+ }
89
+
90
+ renderMain()
91
+ }
92
+
93
+ function expandAll() {
94
+ collapsedPaths = new Set()
95
+ renderMain()
96
+ }
97
+
98
+ function getAllPaths(obj, base = '') {
99
+ const paths = []
100
+
101
+ if (obj && typeof obj === 'object') {
102
+ for (const key of Object.keys(obj)) {
103
+ const path = base ? `${base}.${key}` : key
104
+ paths.push(path)
105
+ paths.push(...getAllPaths(obj[key], path))
106
+ }
107
+ }
108
+
109
+ return paths
110
+ }
111
+
70
112
  /* ── Render all ── */
71
113
  function renderAll() {
72
114
  renderSidebar()
@@ -84,7 +126,9 @@ function storeColor(name) {
84
126
 
85
127
  function renderSidebar() {
86
128
  const list = document.getElementById('store-list')
87
- const stores = Object.keys(stateTree)
129
+ // Sort stores alphabetically
130
+ const stores = Object.keys(stateTree).sort((a, b) => a.localeCompare(b))
131
+
88
132
 
89
133
  if (stores.length === 0) {
90
134
  list.innerHTML = ''
@@ -209,7 +253,11 @@ function buildNode(parent, value, key, path, depth) {
209
253
  if (!collapsed) {
210
254
  const kids = document.createElement('div')
211
255
  kids.className = 'json-children'
212
- for (const [k2, v2] of Object.entries(value)) {
256
+ // Sort the keys alphabetically before mapping to buildNode
257
+ const keys = Object.keys(value).sort((a, b) => a.localeCompare(b))
258
+
259
+ for (const k2 of keys) {
260
+ const v2 = value[k2]
213
261
  buildNode(kids, v2, k2, `${path}.${k2}`, depth + 1)
214
262
  }
215
263
  parent.appendChild(kids)
@@ -319,10 +367,12 @@ document.querySelectorAll('.tab').forEach(tab => {
319
367
  })
320
368
  })
321
369
 
322
- /* ── Clear ── */
370
+ /* ── Buttons ── */
323
371
  document.getElementById('btn-clear').addEventListener('click', () => {
324
- fetch('/state', { method: 'DELETE' }).catch(() => {})
372
+ fetch('/state', { method: 'DELETE' }).catch(() => { })
325
373
  })
374
+ document.getElementById('btn-collapse').onclick = collapseAll
375
+ document.getElementById('btn-expand').onclick = expandAll
326
376
 
327
377
  /* ── Boot ── */
328
378
  connect()
package/client/index.html CHANGED
@@ -1,162 +1,623 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
+
3
4
  <head>
4
5
  <meta charset="UTF-8" />
5
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
7
  <title>Valtio Inspector</title>
7
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap"
11
+ rel="stylesheet">
9
12
  <style>
10
- *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
13
+ *,
14
+ *::before,
15
+ *::after {
16
+ box-sizing: border-box;
17
+ margin: 0;
18
+ padding: 0;
19
+ }
11
20
 
12
21
  :root {
13
- --bg: #0d0f14;
14
- --bg2: #12151c;
15
- --bg3: #191d27;
16
- --bg4: #1f2432;
17
- --border: #262c3d;
18
- --border2: #2e3549;
19
- --text: #c8d0e8;
20
- --text-dim: #5a6480;
21
- --text-mid: #8892b0;
22
- --accent: #7c6af7;
23
- --accent2: #56e0a0;
24
- --accent3: #f7a26a;
25
- --accent4: #f06c8a;
26
- --add: #56e0a0;
27
- --remove: #f06c8a;
28
- --change: #f7a26a;
29
- --dot-size: 6px;
30
- }
31
-
32
- html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 13px; overflow: hidden; }
22
+ --bg: #0d0f14;
23
+ --bg2: #12151c;
24
+ --bg3: #191d27;
25
+ --bg4: #1f2432;
26
+ --border: #262c3d;
27
+ --border2: #2e3549;
28
+ --text: #c8d0e8;
29
+ --text-dim: #5a6480;
30
+ --text-mid: #8892b0;
31
+ --accent: #7c6af7;
32
+ --accent2: #56e0a0;
33
+ --accent3: #f7a26a;
34
+ --accent4: #f06c8a;
35
+ --add: #56e0a0;
36
+ --remove: #f06c8a;
37
+ --change: #f7a26a;
38
+ --dot-size: 6px;
39
+ }
40
+
41
+ html,
42
+ body {
43
+ height: 100%;
44
+ background: var(--bg);
45
+ color: var(--text);
46
+ font-family: 'JetBrains Mono', monospace;
47
+ font-size: 13px;
48
+ overflow: hidden;
49
+ }
33
50
 
34
51
  /* ── Layout ── */
35
- #app { display: grid; grid-template-columns: 220px 1fr 260px; grid-template-rows: 48px 1fr; height: 100vh; }
52
+ #app {
53
+ display: grid;
54
+ grid-template-columns: 220px 1fr 260px;
55
+ grid-template-rows: 48px 1fr;
56
+ height: 100vh;
57
+ }
36
58
 
37
59
  /* ── Topbar ── */
38
60
  #topbar {
39
61
  grid-column: 1 / -1;
40
- display: flex; align-items: center; gap: 16px;
62
+ display: flex;
63
+ align-items: center;
64
+ gap: 16px;
41
65
  padding: 0 20px;
42
66
  background: var(--bg2);
43
67
  border-bottom: 1px solid var(--border);
44
68
  position: relative;
45
69
  z-index: 10;
46
70
  }
47
- #topbar .logo { display: flex; align-items: center; gap: 8px; font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
48
- #topbar .logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s ease-in-out infinite; }
49
- @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(.85)} }
50
- #topbar .spacer { flex: 1; }
51
- .status-pill { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); }
52
- .status-pill .led { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); transition: background .3s, box-shadow .3s; }
53
- .status-pill.connected .led { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }
54
- .status-pill.connected { border-color: #2a4040; color: var(--accent2); }
55
- #btn-clear { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text-dim); cursor: pointer; padding: 4px 12px; font-family: inherit; font-size: 11px; transition: all .2s; }
56
- #btn-clear:hover { border-color: var(--accent4); color: var(--accent4); }
71
+
72
+ #topbar .logo {
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 8px;
76
+ font-family: 'Space Mono', monospace;
77
+ font-size: 14px;
78
+ font-weight: 700;
79
+ letter-spacing: -0.02em;
80
+ }
81
+
82
+ #topbar .logo .dot {
83
+ width: 8px;
84
+ height: 8px;
85
+ border-radius: 50%;
86
+ background: var(--accent);
87
+ box-shadow: 0 0 10px var(--accent);
88
+ animation: pulse 2s ease-in-out infinite;
89
+ }
90
+
91
+ @keyframes pulse {
92
+
93
+ 0%,
94
+ 100% {
95
+ opacity: 1;
96
+ transform: scale(1)
97
+ }
98
+
99
+ 50% {
100
+ opacity: .6;
101
+ transform: scale(.85)
102
+ }
103
+ }
104
+
105
+ #topbar .spacer {
106
+ flex: 1;
107
+ }
108
+
109
+ .status-pill {
110
+ display: flex;
111
+ align-items: center;
112
+ gap: 6px;
113
+ font-size: 11px;
114
+ color: var(--text-dim);
115
+ padding: 4px 10px;
116
+ border-radius: 20px;
117
+ border: 1px solid var(--border);
118
+ }
119
+
120
+ .status-pill .led {
121
+ width: 6px;
122
+ height: 6px;
123
+ border-radius: 50%;
124
+ background: var(--text-dim);
125
+ transition: background .3s, box-shadow .3s;
126
+ }
127
+
128
+ .status-pill.connected .led {
129
+ background: var(--accent2);
130
+ box-shadow: 0 0 8px var(--accent2);
131
+ }
132
+
133
+ .status-pill.connected {
134
+ border-color: #2a4040;
135
+ color: var(--accent2);
136
+ }
137
+
138
+ #btn-clear {
139
+ background: none;
140
+ border: 1px solid var(--border);
141
+ border-radius: 6px;
142
+ color: var(--text-dim);
143
+ cursor: pointer;
144
+ padding: 4px 12px;
145
+ font-family: inherit;
146
+ font-size: 11px;
147
+ transition: all .2s;
148
+ }
149
+
150
+ #btn-clear:hover {
151
+ border-color: var(--accent4);
152
+ color: var(--accent4);
153
+ }
154
+
155
+ #btn-expand {
156
+ background: none;
157
+ border: 1px solid var(--border);
158
+ border-radius: 6px;
159
+ color: var(--text-dim);
160
+ cursor: pointer;
161
+ padding: 4px 12px;
162
+ font-family: inherit;
163
+ font-size: 11px;
164
+ transition: all .2s;
165
+ }
166
+
167
+ #btn-expand:hover {
168
+ border-color: var(--accent2);
169
+ color: var(--accent2);
170
+ }
171
+
172
+ #btn-collapse {
173
+ background: none;
174
+ border: 1px solid var(--border);
175
+ border-radius: 6px;
176
+ color: var(--text-dim);
177
+ cursor: pointer;
178
+ padding: 4px 12px;
179
+ font-family: inherit;
180
+ font-size: 11px;
181
+ transition: all .2s;
182
+ }
183
+
184
+ #btn-collapse:hover {
185
+ border-color: var(--accent3);
186
+ color: var(--accent3);
187
+ }
57
188
 
58
189
  /* ── Sidebar ── */
59
190
  #sidebar {
60
191
  background: var(--bg2);
61
192
  border-right: 1px solid var(--border);
62
193
  overflow-y: auto;
63
- display: flex; flex-direction: column;
194
+ display: flex;
195
+ flex-direction: column;
196
+ }
197
+
198
+ #sidebar-head {
199
+ padding: 12px 14px 8px;
200
+ font-size: 10px;
201
+ font-weight: 600;
202
+ text-transform: uppercase;
203
+ letter-spacing: .12em;
204
+ color: var(--text-dim);
64
205
  }
65
- #sidebar-head { padding: 12px 14px 8px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--text-dim); }
206
+
66
207
  .store-item {
67
- display: flex; align-items: center; gap: 10px;
68
- padding: 8px 14px; cursor: pointer;
208
+ display: flex;
209
+ align-items: center;
210
+ gap: 10px;
211
+ padding: 8px 14px;
212
+ cursor: pointer;
69
213
  border-left: 2px solid transparent;
70
214
  transition: background .15s, border-color .15s;
71
215
  position: relative;
72
216
  }
73
- .store-item:hover { background: var(--bg3); }
74
- .store-item.active { background: var(--bg3); border-left-color: var(--accent); }
75
- .store-item .store-icon { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; background: var(--bg4); color: var(--accent); flex-shrink: 0; }
76
- .store-item .store-name { flex: 1; color: var(--text); font-size: 12px; }
77
- .store-item .store-flash { position: absolute; inset: 0; background: var(--accent); opacity: 0; pointer-events: none; border-radius: 0; }
78
- .store-item.flash .store-flash { animation: flash-anim .4s ease-out; }
79
- @keyframes flash-anim { 0%{opacity:.12} 100%{opacity:0} }
217
+
218
+ .store-item:hover {
219
+ background: var(--bg3);
220
+ }
221
+
222
+ .store-item.active {
223
+ background: var(--bg3);
224
+ border-left-color: var(--accent);
225
+ }
226
+
227
+ .store-item .store-icon {
228
+ width: 22px;
229
+ height: 22px;
230
+ border-radius: 6px;
231
+ display: flex;
232
+ align-items: center;
233
+ justify-content: center;
234
+ font-size: 11px;
235
+ background: var(--bg4);
236
+ color: var(--accent);
237
+ flex-shrink: 0;
238
+ }
239
+
240
+ .store-item .store-name {
241
+ flex: 1;
242
+ color: var(--text);
243
+ font-size: 12px;
244
+ }
245
+
246
+ .store-item .store-flash {
247
+ position: absolute;
248
+ inset: 0;
249
+ background: var(--accent);
250
+ opacity: 0;
251
+ pointer-events: none;
252
+ border-radius: 0;
253
+ }
254
+
255
+ .store-item.flash .store-flash {
256
+ animation: flash-anim .4s ease-out;
257
+ }
258
+
259
+ @keyframes flash-anim {
260
+ 0% {
261
+ opacity: .12
262
+ }
263
+
264
+ 100% {
265
+ opacity: 0
266
+ }
267
+ }
80
268
 
81
269
  /* ── Main ── */
82
- #main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
83
- #main-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; }
84
- #main-head .store-label { font-size: 14px; font-weight: 600; color: var(--text); }
85
- #main-head .store-tag { font-size: 10px; color: var(--text-dim); background: var(--bg4); border: 1px solid var(--border); padding: 2px 8px; border-radius: 4px; }
86
- #tabs { display: flex; gap: 2px; padding: 8px 16px 0; background: var(--bg2); border-bottom: 1px solid var(--border); }
87
- .tab { padding: 6px 14px 7px; cursor: pointer; font-size: 11px; color: var(--text-dim); border-bottom: 2px solid transparent; transition: all .2s; border-radius: 4px 4px 0 0; }
88
- .tab:hover { color: var(--text); background: var(--bg3); }
89
- .tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--bg3); }
90
- #view { flex: 1; overflow-y: auto; padding: 16px; }
270
+ #main {
271
+ display: flex;
272
+ flex-direction: column;
273
+ overflow: hidden;
274
+ background: var(--bg);
275
+ }
276
+
277
+ #main-head {
278
+ display: flex;
279
+ align-items: center;
280
+ justify-content: space-between;
281
+ gap: 10px;
282
+ padding: 10px 16px;
283
+ border-bottom: 1px solid var(--border);
284
+ background: var(--bg2);
285
+ flex-shrink: 0;
286
+ }
287
+
288
+ #main-head .store-label {
289
+ font-size: 14px;
290
+ font-weight: 600;
291
+ color: var(--text);
292
+ }
293
+
294
+ #main-head .store-tag {
295
+ font-size: 10px;
296
+ color: var(--text-dim);
297
+ background: var(--bg4);
298
+ border: 1px solid var(--border);
299
+ padding: 2px 8px;
300
+ border-radius: 4px;
301
+ }
302
+
303
+ #main-head .left,
304
+ #main-head .right {
305
+ display: flex;
306
+ align-items: center;
307
+ gap: 10px;
308
+ }
309
+
310
+ #tabs {
311
+ display: flex;
312
+ gap: 2px;
313
+ padding: 8px 16px 0;
314
+ background: var(--bg2);
315
+ border-bottom: 1px solid var(--border);
316
+ }
317
+
318
+ .tab {
319
+ padding: 6px 14px 7px;
320
+ cursor: pointer;
321
+ font-size: 11px;
322
+ color: var(--text-dim);
323
+ border-bottom: 2px solid transparent;
324
+ transition: all .2s;
325
+ border-radius: 4px 4px 0 0;
326
+ }
327
+
328
+ .tab:hover {
329
+ color: var(--text);
330
+ background: var(--bg3);
331
+ }
332
+
333
+ .tab.active {
334
+ color: var(--accent);
335
+ border-bottom-color: var(--accent);
336
+ background: var(--bg3);
337
+ }
338
+
339
+ #view {
340
+ flex: 1;
341
+ overflow-y: auto;
342
+ padding: 16px;
343
+ }
91
344
 
92
345
  /* ── JSON tree ── */
93
- .json-tree { line-height: 1.7; }
94
- .json-node { display: flex; flex-direction: column; }
95
- .json-row { display: flex; align-items: baseline; gap: 6px; cursor: default; padding: 1px 4px; border-radius: 3px; }
96
- .json-row:hover { background: var(--bg3); }
97
- .json-key { color: #7ec8e3; }
98
- .json-colon { color: var(--text-dim); }
99
- .json-string { color: var(--accent2); }
100
- .json-number { color: #f9c46b; }
101
- .json-bool { color: var(--accent3); }
102
- .json-null { color: var(--text-dim); }
103
- .json-collapse { color: var(--text-dim); font-size: 10px; cursor: pointer; user-select: none; padding: 0 3px; }
104
- .json-collapse:hover { color: var(--text); }
105
- .json-children { padding-left: 18px; border-left: 1px solid var(--border); margin-left: 8px; }
346
+ .json-tree {
347
+ line-height: 1.7;
348
+ }
349
+
350
+ .json-node {
351
+ display: flex;
352
+ flex-direction: column;
353
+ }
354
+
355
+ .json-row {
356
+ display: flex;
357
+ align-items: baseline;
358
+ gap: 6px;
359
+ cursor: default;
360
+ padding: 1px 4px;
361
+ border-radius: 3px;
362
+ }
363
+
364
+ .json-row:hover {
365
+ background: var(--bg3);
366
+ }
367
+
368
+ .json-key {
369
+ color: #7ec8e3;
370
+ }
371
+
372
+ .json-colon {
373
+ color: var(--text-dim);
374
+ }
375
+
376
+ .json-string {
377
+ color: var(--accent2);
378
+ }
379
+
380
+ .json-number {
381
+ color: #f9c46b;
382
+ }
383
+
384
+ .json-bool {
385
+ color: var(--accent3);
386
+ }
387
+
388
+ .json-null {
389
+ color: var(--text-dim);
390
+ }
391
+
392
+ .json-collapse {
393
+ color: var(--text-dim);
394
+ font-size: 10px;
395
+ cursor: pointer;
396
+ user-select: none;
397
+ padding: 0 3px;
398
+ }
399
+
400
+ .json-collapse:hover {
401
+ color: var(--text);
402
+ }
403
+
404
+ .json-children {
405
+ padding-left: 18px;
406
+ border-left: 1px solid var(--border);
407
+ margin-left: 8px;
408
+ }
106
409
 
107
410
  /* ── History panel ── */
108
- #history-panel { background: var(--bg2); border-left: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
109
- #history-head { padding: 12px 14px 8px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--text-dim); border-bottom: 1px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }
110
- #history-count { font-size: 10px; color: var(--accent); background: #1e1a3a; border: 1px solid #2d2660; padding: 1px 7px; border-radius: 10px; }
111
- #history-list { flex: 1; overflow-y: auto; }
411
+ #history-panel {
412
+ background: var(--bg2);
413
+ border-left: 1px solid var(--border);
414
+ overflow-y: auto;
415
+ display: flex;
416
+ flex-direction: column;
417
+ }
418
+
419
+ #history-head {
420
+ padding: 12px 14px 8px;
421
+ font-size: 10px;
422
+ font-weight: 600;
423
+ text-transform: uppercase;
424
+ letter-spacing: .12em;
425
+ color: var(--text-dim);
426
+ border-bottom: 1px solid var(--border);
427
+ flex-shrink: 0;
428
+ display: flex;
429
+ align-items: center;
430
+ justify-content: space-between;
431
+ }
432
+
433
+ #history-count {
434
+ font-size: 10px;
435
+ color: var(--accent);
436
+ background: #1e1a3a;
437
+ border: 1px solid #2d2660;
438
+ padding: 1px 7px;
439
+ border-radius: 10px;
440
+ }
441
+
442
+ #history-list {
443
+ flex: 1;
444
+ overflow-y: auto;
445
+ }
446
+
112
447
  .hist-item {
113
- padding: 8px 14px; cursor: pointer;
448
+ padding: 8px 14px;
449
+ cursor: pointer;
114
450
  border-bottom: 1px solid var(--border);
115
451
  transition: background .15s;
116
- display: flex; flex-direction: column; gap: 3px;
117
- }
118
- .hist-item:hover { background: var(--bg3); }
119
- .hist-item.active { background: #191630; border-left: 2px solid var(--accent); }
120
- .hist-item .hist-store { font-size: 11px; color: var(--accent); font-weight: 500; }
121
- .hist-item .hist-time { font-size: 10px; color: var(--text-dim); }
122
- .hist-item .hist-diff-pills { display: flex; flex-wrap: wrap; gap: 3px; }
123
- .hist-pill { font-size: 9px; padding: 1px 6px; border-radius: 10px; font-weight: 500; }
124
- .hist-pill.change { background: #2c200d; color: var(--change); border: 1px solid #3d2c12; }
125
- .hist-pill.add { background: #0d2316; color: var(--add); border: 1px solid #123020; }
126
- .hist-pill.remove { background: #2c0d14; color: var(--remove); border: 1px solid #3d1220; }
452
+ display: flex;
453
+ flex-direction: column;
454
+ gap: 3px;
455
+ }
456
+
457
+ .hist-item:hover {
458
+ background: var(--bg3);
459
+ }
460
+
461
+ .hist-item.active {
462
+ background: #191630;
463
+ border-left: 2px solid var(--accent);
464
+ }
465
+
466
+ .hist-item .hist-store {
467
+ font-size: 11px;
468
+ color: var(--accent);
469
+ font-weight: 500;
470
+ }
471
+
472
+ .hist-item .hist-time {
473
+ font-size: 10px;
474
+ color: var(--text-dim);
475
+ }
476
+
477
+ .hist-item .hist-diff-pills {
478
+ display: flex;
479
+ flex-wrap: wrap;
480
+ gap: 3px;
481
+ }
482
+
483
+ .hist-pill {
484
+ font-size: 9px;
485
+ padding: 1px 6px;
486
+ border-radius: 10px;
487
+ font-weight: 500;
488
+ }
489
+
490
+ .hist-pill.change {
491
+ background: #2c200d;
492
+ color: var(--change);
493
+ border: 1px solid #3d2c12;
494
+ }
495
+
496
+ .hist-pill.add {
497
+ background: #0d2316;
498
+ color: var(--add);
499
+ border: 1px solid #123020;
500
+ }
501
+
502
+ .hist-pill.remove {
503
+ background: #2c0d14;
504
+ color: var(--remove);
505
+ border: 1px solid #3d1220;
506
+ }
127
507
 
128
508
  /* ── Empty / no store states ── */
129
- .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 10px; color: var(--text-dim); text-align: center; }
130
- .empty-state .big { font-size: 32px; opacity: .3; }
131
- .empty-state .hint { font-size: 11px; line-height: 1.8; max-width: 280px; }
132
- .empty-state code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-size: 11px; color: var(--accent); }
509
+ .empty-state {
510
+ display: flex;
511
+ flex-direction: column;
512
+ align-items: center;
513
+ justify-content: center;
514
+ height: 100%;
515
+ gap: 10px;
516
+ color: var(--text-dim);
517
+ text-align: center;
518
+ }
519
+
520
+ .empty-state .big {
521
+ font-size: 32px;
522
+ opacity: .3;
523
+ }
524
+
525
+ .empty-state .hint {
526
+ font-size: 11px;
527
+ line-height: 1.8;
528
+ max-width: 280px;
529
+ }
530
+
531
+ .empty-state code {
532
+ background: var(--bg3);
533
+ padding: 2px 6px;
534
+ border-radius: 4px;
535
+ font-size: 11px;
536
+ color: var(--accent);
537
+ }
133
538
 
134
539
  /* ── Diff view ── */
135
- .diff-line { display: flex; gap: 8px; padding: 3px 8px; border-radius: 3px; font-size: 12px; align-items: baseline; }
136
- .diff-line.changed { background: #1e1505; border-left: 2px solid var(--change); }
137
- .diff-line.added { background: #061510; border-left: 2px solid var(--add); }
138
- .diff-line.removed { background: #150509; border-left: 2px solid var(--remove); }
139
- .diff-label { font-size: 10px; min-width: 50px; opacity: .7; }
140
- .diff-key { color: #7ec8e3; }
141
- .diff-arrow { color: var(--text-dim); }
142
- .diff-val { color: var(--text); }
143
- .diff-old { color: var(--remove); text-decoration: line-through; opacity: .7; }
144
- .diff-new { color: var(--add); }
540
+ .diff-line {
541
+ display: flex;
542
+ gap: 8px;
543
+ padding: 3px 8px;
544
+ border-radius: 3px;
545
+ font-size: 12px;
546
+ align-items: baseline;
547
+ }
548
+
549
+ .diff-line.changed {
550
+ background: #1e1505;
551
+ border-left: 2px solid var(--change);
552
+ }
553
+
554
+ .diff-line.added {
555
+ background: #061510;
556
+ border-left: 2px solid var(--add);
557
+ }
558
+
559
+ .diff-line.removed {
560
+ background: #150509;
561
+ border-left: 2px solid var(--remove);
562
+ }
563
+
564
+ .diff-label {
565
+ font-size: 10px;
566
+ min-width: 50px;
567
+ opacity: .7;
568
+ }
569
+
570
+ .diff-key {
571
+ color: #7ec8e3;
572
+ }
573
+
574
+ .diff-arrow {
575
+ color: var(--text-dim);
576
+ }
577
+
578
+ .diff-val {
579
+ color: var(--text);
580
+ }
581
+
582
+ .diff-old {
583
+ color: var(--remove);
584
+ text-decoration: line-through;
585
+ opacity: .7;
586
+ }
587
+
588
+ .diff-new {
589
+ color: var(--add);
590
+ }
145
591
 
146
592
  /* scrollbar */
147
- ::-webkit-scrollbar { width: 5px; height: 5px; }
148
- ::-webkit-scrollbar-track { background: transparent; }
149
- ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
150
- ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
593
+ ::-webkit-scrollbar {
594
+ width: 5px;
595
+ height: 5px;
596
+ }
597
+
598
+ ::-webkit-scrollbar-track {
599
+ background: transparent;
600
+ }
601
+
602
+ ::-webkit-scrollbar-thumb {
603
+ background: var(--border2);
604
+ border-radius: 3px;
605
+ }
606
+
607
+ ::-webkit-scrollbar-thumb:hover {
608
+ background: var(--text-dim);
609
+ }
151
610
  </style>
152
611
  </head>
612
+
153
613
  <body>
154
614
  <div id="app">
155
615
  <!-- Topbar -->
156
616
  <div id="topbar">
157
- <div class="logo"><span class="dot"></span> valtio inspector</div>
617
+ <div class="logo"><span class="dot"></span> Valtio inspector</div>
158
618
  <div class="spacer"></div>
159
- <div class="status-pill" id="status-pill"><span class="led"></span><span id="status-text">disconnected</span></div>
619
+ <div class="status-pill" id="status-pill"><span class="led"></span><span id="status-text">disconnected</span>
620
+ </div>
160
621
  <button id="btn-clear">⌫ clear</button>
161
622
  </div>
162
623
 
@@ -169,35 +630,47 @@
169
630
  <!-- Main panel -->
170
631
  <div id="main">
171
632
  <div id="main-head">
172
- <span class="store-label" id="main-title">—</span>
173
- <span class="store-tag" id="main-tag">no store selected</span>
174
- </div>
175
- <div id="tabs">
176
- <div class="tab active" data-tab="tree">Tree</div>
177
- <div class="tab" data-tab="raw">Raw JSON</div>
178
- <div class="tab" data-tab="diff">Last Diff</div>
179
- </div>
180
- <div id="view">
181
- <div class="empty-state" id="empty-state">
182
- <div class="big">◎</div>
183
- <div class="hint">No stores connected yet.<br>In your app, call <code>attachInspector(store, { name: 'myStore' })</code> and make sure the inspector server is running.</div>
633
+ <div class="left">
634
+ <span class="store-label" id="main-title">—</span>
635
+ <span class="store-tag" id="main-tag">no store selected</span>
636
+ </div>
637
+
638
+ <div class="right">
639
+ <button id="btn-expand">Expand all</button>
640
+ <button id="btn-collapse">Collapse all</button>
641
+ </div>
642
+ </div>
643
+ <div id="tabs">
644
+ <div class="tab active" data-tab="tree">Tree</div>
645
+ <div class="tab" data-tab="raw">Raw JSON</div>
646
+ <div class="tab" data-tab="diff">Last Diff</div>
647
+ </div>
648
+ <div id="view">
649
+ <div class="empty-state" id="empty-state">
650
+ <div class="big">◎</div>
651
+ <div class="hint">No stores connected yet.<br>In your app, call
652
+ <code>attachInspector(store, { name: 'myStore' })</code> and make sure the inspector server is running.
653
+ </div>
654
+ </div>
655
+ <div id="tree-view" style="display:none"></div>
656
+ <div id="raw-view" style="display:none">
657
+ <pre id="raw-content" style="line-height:1.7;color:var(--text-mid)"></pre>
658
+ </div>
659
+ <div id="diff-view" style="display:none"></div>
184
660
  </div>
185
- <div id="tree-view" style="display:none"></div>
186
- <div id="raw-view" style="display:none"><pre id="raw-content" style="line-height:1.7;color:var(--text-mid)"></pre></div>
187
- <div id="diff-view" style="display:none"></div>
188
661
  </div>
189
- </div>
190
662
 
191
- <!-- History panel -->
192
- <div id="history-panel">
193
- <div id="history-head">
194
- <span>History</span>
195
- <span id="history-count">0</span>
663
+ <!-- History panel -->
664
+ <div id="history-panel">
665
+ <div id="history-head">
666
+ <span>History</span>
667
+ <span id="history-count">0</span>
668
+ </div>
669
+ <div id="history-list"></div>
196
670
  </div>
197
- <div id="history-list"></div>
198
671
  </div>
199
- </div>
200
672
 
201
- <script src="app.js"></script>
673
+ <script src="app.js"></script>
202
674
  </body>
203
- </html>
675
+
676
+ </html>
package/dist/server.js CHANGED
@@ -14,7 +14,7 @@ function startServer(port = 7777) {
14
14
  app.use((0, cors_1.default)({
15
15
  origin: 'http://localhost:5173'
16
16
  }));
17
- app.use(express_1.default.json());
17
+ app.use(express_1.default.json({ limit: '5mb' }));
18
18
  const server = http_1.default.createServer(app);
19
19
  const wss = new ws_1.WebSocketServer({ server });
20
20
  let stateTree = {};
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;AAMA,kCAwHC;AA9HD,sDAA6B;AAC7B,2BAA+C;AAC/C,gDAAuB;AACvB,gDAAuB;AACvB,gDAAuB;AAEvB,SAAgB,WAAW,CAAC,OAAe,IAAI;IAC7C,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAA;IAErB,GAAG,CAAC,GAAG,CAAC,IAAA,cAAI,EAAC;QACX,MAAM,EAAE,uBAAuB;KAChC,CAAC,CAAC,CAAA;IAEH,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IAEvB,MAAM,MAAM,GAAG,cAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACrC,MAAM,GAAG,GAAG,IAAI,oBAAe,CAAC,EA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SAAS;gBACtB,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,IAAI,EAAE,CAAC,CAAC,IAAI;aACb,CAAC,CAAC;SACJ,CAAC,CAAC,CAAA;IACL,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACvB,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,4CAA4C,IAAI,EAAE,CAAC,CAAA;QACpF,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,0CAA0C,IAAI,EAAE,CAAC,CAAA;IACpF,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,gBAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kfiross44/valtio-inspector",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "A dev-only Valtio state inspector with WebSocket live updates",
5
5
  "main": "dist/server/index.js",
6
6
  "bin": {
package/src/server.ts CHANGED
@@ -11,7 +11,7 @@ export function startServer(port: number = 7777) {
11
11
  origin: 'http://localhost:5173'
12
12
  }))
13
13
 
14
- app.use(express.json())
14
+ app.use(express.json({ limit: '5mb' }))
15
15
 
16
16
  const server = http.createServer(app)
17
17
  const wss = new WebSocketServer({ server })