@atolljs/devtools 0.1.7 → 0.1.9

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.
Files changed (50) hide show
  1. package/README.md +408 -71
  2. package/app/api.js +68 -0
  3. package/app/fw-logos.js +14 -0
  4. package/app/index.html +161 -2
  5. package/app/main.js +897 -222
  6. package/app/panels/actions.js +324 -0
  7. package/app/panels/audit-rules.js +728 -0
  8. package/app/panels/audits.js +438 -0
  9. package/app/panels/inspect-island.js +351 -0
  10. package/app/panels/memory-values.js +287 -0
  11. package/app/panels/performance.js +304 -0
  12. package/app/panels/reactivity.js +271 -0
  13. package/app/panels/recorder.js +344 -0
  14. package/app/panels/recording-format.js +166 -0
  15. package/app/panels/route.d.ts +44 -0
  16. package/app/panels/route.js +264 -0
  17. package/app/panels/shell.js +789 -0
  18. package/app/panels/toast.js +38 -0
  19. package/dist/bin.js +704 -5
  20. package/dist/chunk-57NGHQUL.js +344 -0
  21. package/dist/chunk-6E54FXKS.js +495 -0
  22. package/dist/chunk-WIL2P7HG.js +661 -0
  23. package/dist/client.d.ts +7 -0
  24. package/dist/control.d.ts +4 -0
  25. package/dist/index.js +2 -1
  26. package/dist/node.js +2 -1
  27. package/dist/nodeWs.d.ts +1 -0
  28. package/dist/otel.d.ts +35 -0
  29. package/dist/otel.js +87 -0
  30. package/dist/otelMap.d.ts +232 -0
  31. package/dist/otelTransport.d.ts +69 -0
  32. package/dist/overlay.d.ts +16 -2
  33. package/dist/probes.d.ts +7 -0
  34. package/dist/protocol.d.ts +46 -4
  35. package/dist/server.d.ts +19 -0
  36. package/dist/server.js +61 -3
  37. package/package.json +6 -2
  38. package/src/bin.ts +27 -2
  39. package/src/broadcast.ts +6 -0
  40. package/src/client.ts +26 -2
  41. package/src/control.ts +51 -0
  42. package/src/nodeWs.ts +7 -1
  43. package/src/otel.ts +140 -0
  44. package/src/otelMap.ts +661 -0
  45. package/src/otelTransport.ts +286 -0
  46. package/src/overlay.ts +239 -47
  47. package/src/probes.ts +155 -0
  48. package/src/protocol.ts +52 -4
  49. package/src/server.ts +83 -3
  50. package/dist/chunk-4N3NBFL3.js +0 -474
@@ -0,0 +1,38 @@
1
+ // Tiny toast helper for panel feedback: toast('Applied'), toast(err, 'error').
2
+ // Stacks bottom-right; each toast removes itself after `ms`.
3
+
4
+ let host = null;
5
+
6
+ const ensureHost = () => {
7
+ if (host?.isConnected) return host;
8
+ host = document.createElement('div');
9
+ host.setAttribute('aria-live', 'polite');
10
+ host.style.cssText =
11
+ 'position:fixed;right:16px;bottom:16px;z-index:9999;display:flex;flex-direction:column;gap:6px;align-items:flex-end;pointer-events:none';
12
+ document.body.appendChild(host);
13
+ return host;
14
+ };
15
+
16
+ const COLORS = {
17
+ ok: ['#0f2a1a', '#3fb950'],
18
+ error: ['#2d1214', '#f85149'],
19
+ info: ['#0d1d33', '#58a6ff'],
20
+ };
21
+
22
+ /** Show a transient message; `kind` is 'ok' | 'error' | 'info'. Errors accept an Error. */
23
+ export function toast(message, kind = 'ok', ms = kind === 'error' ? 5000 : 2600) {
24
+ const text = message instanceof Error ? message.message : String(message);
25
+ const [bg, fg] = COLORS[kind] ?? COLORS.info;
26
+ const el = document.createElement('div');
27
+ el.textContent = text;
28
+ el.style.cssText =
29
+ `background:${bg};color:#e6edf3;border:1px solid ${fg};border-left-width:4px;border-radius:6px;` +
30
+ 'padding:6px 10px;font:12px/1.4 system-ui,sans-serif;max-width:min(420px,calc(100vw - 24px));box-shadow:0 4px 14px #0008;' +
31
+ 'pointer-events:auto;transition:opacity .25s';
32
+ ensureHost().appendChild(el);
33
+ setTimeout(() => {
34
+ el.style.opacity = '0';
35
+ setTimeout(() => el.remove(), 300);
36
+ }, ms);
37
+ return el;
38
+ }