@oxog/reactscope 1.0.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.
Files changed (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +230 -0
  3. package/dist/chunk-4TZAECHG.cjs +160 -0
  4. package/dist/chunk-4TZAECHG.cjs.map +1 -0
  5. package/dist/chunk-6L3WUS6V.cjs +160 -0
  6. package/dist/chunk-6L3WUS6V.cjs.map +1 -0
  7. package/dist/chunk-6LHJL6MV.js +1176 -0
  8. package/dist/chunk-6LHJL6MV.js.map +1 -0
  9. package/dist/chunk-ALGKN7FA.cjs +192 -0
  10. package/dist/chunk-ALGKN7FA.cjs.map +1 -0
  11. package/dist/chunk-DVRJ7PFB.cjs +185 -0
  12. package/dist/chunk-DVRJ7PFB.cjs.map +1 -0
  13. package/dist/chunk-E4MB5KJQ.js +98 -0
  14. package/dist/chunk-E4MB5KJQ.js.map +1 -0
  15. package/dist/chunk-H4W4UBLZ.cjs +149 -0
  16. package/dist/chunk-H4W4UBLZ.cjs.map +1 -0
  17. package/dist/chunk-I427KZYN.cjs +29 -0
  18. package/dist/chunk-I427KZYN.cjs.map +1 -0
  19. package/dist/chunk-IFCS6ABF.cjs +1180 -0
  20. package/dist/chunk-IFCS6ABF.cjs.map +1 -0
  21. package/dist/chunk-JESQX3XO.js +157 -0
  22. package/dist/chunk-JESQX3XO.js.map +1 -0
  23. package/dist/chunk-KCUWALXE.cjs +252 -0
  24. package/dist/chunk-KCUWALXE.cjs.map +1 -0
  25. package/dist/chunk-LZO35OCP.js +26 -0
  26. package/dist/chunk-LZO35OCP.js.map +1 -0
  27. package/dist/chunk-M65L55OT.js +146 -0
  28. package/dist/chunk-M65L55OT.js.map +1 -0
  29. package/dist/chunk-MPOQNCGP.js +157 -0
  30. package/dist/chunk-MPOQNCGP.js.map +1 -0
  31. package/dist/chunk-MTCOZBRI.js +115 -0
  32. package/dist/chunk-MTCOZBRI.js.map +1 -0
  33. package/dist/chunk-MVK2UT4Z.js +182 -0
  34. package/dist/chunk-MVK2UT4Z.js.map +1 -0
  35. package/dist/chunk-OJGWFS55.cjs +173 -0
  36. package/dist/chunk-OJGWFS55.cjs.map +1 -0
  37. package/dist/chunk-QYMRRTSN.cjs +134 -0
  38. package/dist/chunk-QYMRRTSN.cjs.map +1 -0
  39. package/dist/chunk-QZ5T7HPO.cjs +118 -0
  40. package/dist/chunk-QZ5T7HPO.cjs.map +1 -0
  41. package/dist/chunk-RYAIO3BO.js +131 -0
  42. package/dist/chunk-RYAIO3BO.js.map +1 -0
  43. package/dist/chunk-U2OPUU5R.js +170 -0
  44. package/dist/chunk-U2OPUU5R.js.map +1 -0
  45. package/dist/chunk-WQRBHD23.cjs +105 -0
  46. package/dist/chunk-WQRBHD23.cjs.map +1 -0
  47. package/dist/chunk-XNNGOQH2.js +189 -0
  48. package/dist/chunk-XNNGOQH2.js.map +1 -0
  49. package/dist/chunk-ZTO5ZZVE.js +248 -0
  50. package/dist/chunk-ZTO5ZZVE.js.map +1 -0
  51. package/dist/index.cjs +1521 -0
  52. package/dist/index.cjs.map +1 -0
  53. package/dist/index.d.cts +198 -0
  54. package/dist/index.d.ts +198 -0
  55. package/dist/index.js +1381 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/plugins/console-reporter/index.cjs +17 -0
  58. package/dist/plugins/console-reporter/index.cjs.map +1 -0
  59. package/dist/plugins/console-reporter/index.d.cts +54 -0
  60. package/dist/plugins/console-reporter/index.d.ts +54 -0
  61. package/dist/plugins/console-reporter/index.js +4 -0
  62. package/dist/plugins/console-reporter/index.js.map +1 -0
  63. package/dist/plugins/dashboard-ui/index.cjs +17 -0
  64. package/dist/plugins/dashboard-ui/index.cjs.map +1 -0
  65. package/dist/plugins/dashboard-ui/index.d.cts +68 -0
  66. package/dist/plugins/dashboard-ui/index.d.ts +68 -0
  67. package/dist/plugins/dashboard-ui/index.js +4 -0
  68. package/dist/plugins/dashboard-ui/index.js.map +1 -0
  69. package/dist/plugins/json-exporter/index.cjs +16 -0
  70. package/dist/plugins/json-exporter/index.cjs.map +1 -0
  71. package/dist/plugins/json-exporter/index.d.cts +34 -0
  72. package/dist/plugins/json-exporter/index.d.ts +34 -0
  73. package/dist/plugins/json-exporter/index.js +3 -0
  74. package/dist/plugins/json-exporter/index.js.map +1 -0
  75. package/dist/plugins/lifecycle-tracker/index.cjs +16 -0
  76. package/dist/plugins/lifecycle-tracker/index.cjs.map +1 -0
  77. package/dist/plugins/lifecycle-tracker/index.d.cts +42 -0
  78. package/dist/plugins/lifecycle-tracker/index.d.ts +42 -0
  79. package/dist/plugins/lifecycle-tracker/index.js +3 -0
  80. package/dist/plugins/lifecycle-tracker/index.js.map +1 -0
  81. package/dist/plugins/memory-tracker/index.cjs +16 -0
  82. package/dist/plugins/memory-tracker/index.cjs.map +1 -0
  83. package/dist/plugins/memory-tracker/index.d.cts +56 -0
  84. package/dist/plugins/memory-tracker/index.d.ts +56 -0
  85. package/dist/plugins/memory-tracker/index.js +3 -0
  86. package/dist/plugins/memory-tracker/index.js.map +1 -0
  87. package/dist/plugins/network-correlator/index.cjs +17 -0
  88. package/dist/plugins/network-correlator/index.cjs.map +1 -0
  89. package/dist/plugins/network-correlator/index.d.cts +48 -0
  90. package/dist/plugins/network-correlator/index.d.ts +48 -0
  91. package/dist/plugins/network-correlator/index.js +4 -0
  92. package/dist/plugins/network-correlator/index.js.map +1 -0
  93. package/dist/plugins/props-differ/index.cjs +16 -0
  94. package/dist/plugins/props-differ/index.cjs.map +1 -0
  95. package/dist/plugins/props-differ/index.d.cts +41 -0
  96. package/dist/plugins/props-differ/index.d.ts +41 -0
  97. package/dist/plugins/props-differ/index.js +3 -0
  98. package/dist/plugins/props-differ/index.js.map +1 -0
  99. package/dist/plugins/render-tracker/index.cjs +16 -0
  100. package/dist/plugins/render-tracker/index.cjs.map +1 -0
  101. package/dist/plugins/render-tracker/index.d.cts +36 -0
  102. package/dist/plugins/render-tracker/index.d.ts +36 -0
  103. package/dist/plugins/render-tracker/index.js +3 -0
  104. package/dist/plugins/render-tracker/index.js.map +1 -0
  105. package/dist/plugins/timeline-recorder/index.cjs +17 -0
  106. package/dist/plugins/timeline-recorder/index.cjs.map +1 -0
  107. package/dist/plugins/timeline-recorder/index.d.cts +52 -0
  108. package/dist/plugins/timeline-recorder/index.d.ts +52 -0
  109. package/dist/plugins/timeline-recorder/index.js +4 -0
  110. package/dist/plugins/timeline-recorder/index.js.map +1 -0
  111. package/dist/plugins/wasted-render-detector/index.cjs +16 -0
  112. package/dist/plugins/wasted-render-detector/index.cjs.map +1 -0
  113. package/dist/plugins/wasted-render-detector/index.d.cts +44 -0
  114. package/dist/plugins/wasted-render-detector/index.d.ts +44 -0
  115. package/dist/plugins/wasted-render-detector/index.js +3 -0
  116. package/dist/plugins/wasted-render-detector/index.js.map +1 -0
  117. package/dist/types-DKPG_emi.d.cts +396 -0
  118. package/dist/types-DKPG_emi.d.ts +396 -0
  119. package/package.json +173 -0
@@ -0,0 +1,1176 @@
1
+ import { formatDuration } from './chunk-E4MB5KJQ.js';
2
+
3
+ // src/plugins/dashboard-ui/styles/dashboard.css.ts
4
+ var DASHBOARD_CSS = `
5
+ :host {
6
+ --bg-primary: #0a0a0a;
7
+ --bg-secondary: #141414;
8
+ --bg-tertiary: #1f1f1f;
9
+ --text-primary: #fafafa;
10
+ --text-secondary: #a1a1aa;
11
+ --accent: #3b82f6;
12
+ --success: #22c55e;
13
+ --warning: #eab308;
14
+ --error: #ef4444;
15
+ --border: #27272a;
16
+ --fast: #22c55e;
17
+ --medium: #eab308;
18
+ --slow: #ef4444;
19
+ --wasted: #f97316;
20
+
21
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
22
+ font-size: 12px;
23
+ line-height: 1.5;
24
+ }
25
+
26
+ * {
27
+ box-sizing: border-box;
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+
32
+ .dashboard {
33
+ position: fixed;
34
+ background: var(--bg-primary);
35
+ border: 1px solid var(--border);
36
+ border-radius: 8px;
37
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
38
+ color: var(--text-primary);
39
+ z-index: 99999;
40
+ display: flex;
41
+ flex-direction: column;
42
+ overflow: hidden;
43
+ }
44
+
45
+ .dashboard.collapsed {
46
+ width: auto !important;
47
+ height: auto !important;
48
+ }
49
+
50
+ .dashboard.collapsed .dashboard-content {
51
+ display: none;
52
+ }
53
+
54
+ .dashboard-header {
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: space-between;
58
+ padding: 8px 12px;
59
+ background: var(--bg-secondary);
60
+ border-bottom: 1px solid var(--border);
61
+ cursor: move;
62
+ user-select: none;
63
+ }
64
+
65
+ .dashboard-title {
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 8px;
69
+ font-weight: 600;
70
+ font-size: 13px;
71
+ }
72
+
73
+ .dashboard-title-icon {
74
+ font-size: 14px;
75
+ }
76
+
77
+ .dashboard-controls {
78
+ display: flex;
79
+ align-items: center;
80
+ gap: 4px;
81
+ }
82
+
83
+ .dashboard-btn {
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ width: 24px;
88
+ height: 24px;
89
+ background: transparent;
90
+ border: none;
91
+ border-radius: 4px;
92
+ color: var(--text-secondary);
93
+ cursor: pointer;
94
+ font-size: 14px;
95
+ }
96
+
97
+ .dashboard-btn:hover {
98
+ background: var(--bg-tertiary);
99
+ color: var(--text-primary);
100
+ }
101
+
102
+ .dashboard-content {
103
+ flex: 1;
104
+ display: flex;
105
+ flex-direction: column;
106
+ overflow: hidden;
107
+ }
108
+
109
+ .dashboard-tabs {
110
+ display: flex;
111
+ border-bottom: 1px solid var(--border);
112
+ background: var(--bg-secondary);
113
+ }
114
+
115
+ .dashboard-tab {
116
+ padding: 8px 16px;
117
+ background: transparent;
118
+ border: none;
119
+ color: var(--text-secondary);
120
+ cursor: pointer;
121
+ font-size: 12px;
122
+ border-bottom: 2px solid transparent;
123
+ }
124
+
125
+ .dashboard-tab:hover {
126
+ color: var(--text-primary);
127
+ }
128
+
129
+ .dashboard-tab.active {
130
+ color: var(--accent);
131
+ border-bottom-color: var(--accent);
132
+ }
133
+
134
+ .dashboard-panel {
135
+ flex: 1;
136
+ padding: 12px;
137
+ overflow: auto;
138
+ }
139
+
140
+ .search-input {
141
+ width: 100%;
142
+ padding: 8px 12px;
143
+ background: var(--bg-tertiary);
144
+ border: 1px solid var(--border);
145
+ border-radius: 4px;
146
+ color: var(--text-primary);
147
+ font-size: 12px;
148
+ margin-bottom: 12px;
149
+ }
150
+
151
+ .search-input:focus {
152
+ outline: none;
153
+ border-color: var(--accent);
154
+ }
155
+
156
+ .tree-view {
157
+ font-family: inherit;
158
+ }
159
+
160
+ .tree-node {
161
+ display: flex;
162
+ flex-direction: column;
163
+ }
164
+
165
+ .tree-node-content {
166
+ display: flex;
167
+ align-items: center;
168
+ padding: 4px 8px;
169
+ border-radius: 4px;
170
+ cursor: pointer;
171
+ }
172
+
173
+ .tree-node-content:hover {
174
+ background: var(--bg-tertiary);
175
+ }
176
+
177
+ .tree-node-content.selected {
178
+ background: var(--accent);
179
+ background-opacity: 0.2;
180
+ }
181
+
182
+ .tree-node-toggle {
183
+ width: 16px;
184
+ height: 16px;
185
+ display: flex;
186
+ align-items: center;
187
+ justify-content: center;
188
+ margin-right: 4px;
189
+ color: var(--text-secondary);
190
+ cursor: pointer;
191
+ }
192
+
193
+ .tree-node-toggle:hover {
194
+ color: var(--text-primary);
195
+ }
196
+
197
+ .tree-node-name {
198
+ flex: 1;
199
+ margin-right: 8px;
200
+ }
201
+
202
+ .tree-node-metrics {
203
+ display: flex;
204
+ align-items: center;
205
+ gap: 8px;
206
+ font-size: 11px;
207
+ color: var(--text-secondary);
208
+ }
209
+
210
+ .tree-node-children {
211
+ padding-left: 20px;
212
+ }
213
+
214
+ .metric-badge {
215
+ display: inline-flex;
216
+ align-items: center;
217
+ gap: 4px;
218
+ padding: 2px 6px;
219
+ border-radius: 4px;
220
+ font-size: 10px;
221
+ font-weight: 500;
222
+ }
223
+
224
+ .metric-badge.renders {
225
+ background: rgba(59, 130, 246, 0.2);
226
+ color: var(--accent);
227
+ }
228
+
229
+ .metric-badge.time {
230
+ background: rgba(34, 197, 94, 0.2);
231
+ color: var(--success);
232
+ }
233
+
234
+ .metric-badge.time.slow {
235
+ background: rgba(239, 68, 68, 0.2);
236
+ color: var(--error);
237
+ }
238
+
239
+ .metric-badge.wasted {
240
+ background: rgba(249, 115, 22, 0.2);
241
+ color: var(--wasted);
242
+ }
243
+
244
+ .alert-item {
245
+ display: flex;
246
+ align-items: flex-start;
247
+ gap: 8px;
248
+ padding: 8px;
249
+ background: var(--bg-tertiary);
250
+ border-radius: 4px;
251
+ margin-bottom: 8px;
252
+ }
253
+
254
+ .alert-icon {
255
+ font-size: 14px;
256
+ }
257
+
258
+ .alert-icon.warning {
259
+ color: var(--warning);
260
+ }
261
+
262
+ .alert-icon.error {
263
+ color: var(--error);
264
+ }
265
+
266
+ .alert-content {
267
+ flex: 1;
268
+ }
269
+
270
+ .alert-title {
271
+ font-weight: 500;
272
+ margin-bottom: 2px;
273
+ }
274
+
275
+ .alert-description {
276
+ font-size: 11px;
277
+ color: var(--text-secondary);
278
+ }
279
+
280
+ .details-panel {
281
+ display: flex;
282
+ flex-direction: column;
283
+ gap: 16px;
284
+ }
285
+
286
+ .details-section {
287
+ background: var(--bg-tertiary);
288
+ border-radius: 4px;
289
+ padding: 12px;
290
+ }
291
+
292
+ .details-section-title {
293
+ font-weight: 600;
294
+ margin-bottom: 8px;
295
+ color: var(--text-secondary);
296
+ font-size: 11px;
297
+ text-transform: uppercase;
298
+ letter-spacing: 0.5px;
299
+ }
300
+
301
+ .details-row {
302
+ display: flex;
303
+ justify-content: space-between;
304
+ padding: 4px 0;
305
+ }
306
+
307
+ .details-label {
308
+ color: var(--text-secondary);
309
+ }
310
+
311
+ .details-value {
312
+ font-weight: 500;
313
+ }
314
+
315
+ .timeline-chart {
316
+ height: 100px;
317
+ background: var(--bg-tertiary);
318
+ border-radius: 4px;
319
+ position: relative;
320
+ overflow: hidden;
321
+ }
322
+
323
+ .timeline-bar {
324
+ position: absolute;
325
+ bottom: 0;
326
+ width: 2px;
327
+ background: var(--accent);
328
+ border-radius: 1px 1px 0 0;
329
+ }
330
+
331
+ .memory-chart {
332
+ height: 100px;
333
+ background: var(--bg-tertiary);
334
+ border-radius: 4px;
335
+ position: relative;
336
+ padding: 8px;
337
+ }
338
+
339
+ .memory-chart-line {
340
+ stroke: var(--accent);
341
+ stroke-width: 2;
342
+ fill: none;
343
+ }
344
+
345
+ .memory-chart-area {
346
+ fill: rgba(59, 130, 246, 0.1);
347
+ }
348
+
349
+ .network-item {
350
+ display: flex;
351
+ align-items: center;
352
+ gap: 8px;
353
+ padding: 8px;
354
+ background: var(--bg-tertiary);
355
+ border-radius: 4px;
356
+ margin-bottom: 8px;
357
+ }
358
+
359
+ .network-method {
360
+ font-weight: 600;
361
+ font-size: 10px;
362
+ padding: 2px 6px;
363
+ border-radius: 4px;
364
+ background: var(--accent);
365
+ color: white;
366
+ }
367
+
368
+ .network-url {
369
+ flex: 1;
370
+ overflow: hidden;
371
+ text-overflow: ellipsis;
372
+ white-space: nowrap;
373
+ color: var(--text-secondary);
374
+ }
375
+
376
+ .network-time {
377
+ font-size: 11px;
378
+ color: var(--text-secondary);
379
+ }
380
+
381
+ .empty-state {
382
+ display: flex;
383
+ flex-direction: column;
384
+ align-items: center;
385
+ justify-content: center;
386
+ padding: 32px;
387
+ color: var(--text-secondary);
388
+ text-align: center;
389
+ }
390
+
391
+ .empty-state-icon {
392
+ font-size: 32px;
393
+ margin-bottom: 8px;
394
+ }
395
+
396
+ .resize-handle {
397
+ position: absolute;
398
+ background: transparent;
399
+ }
400
+
401
+ .resize-handle-se {
402
+ right: 0;
403
+ bottom: 0;
404
+ width: 16px;
405
+ height: 16px;
406
+ cursor: nwse-resize;
407
+ }
408
+
409
+ .resize-handle-e {
410
+ right: 0;
411
+ top: 16px;
412
+ bottom: 16px;
413
+ width: 4px;
414
+ cursor: ew-resize;
415
+ }
416
+
417
+ .resize-handle-s {
418
+ left: 16px;
419
+ right: 16px;
420
+ bottom: 0;
421
+ height: 4px;
422
+ cursor: ns-resize;
423
+ }
424
+ `;
425
+
426
+ // src/plugins/dashboard-ui/utils/shadow-dom.ts
427
+ function createShadowContainer() {
428
+ const host = document.createElement("div");
429
+ host.id = "reactscope-dashboard-host";
430
+ host.style.cssText = "position: fixed; z-index: 99999; pointer-events: none;";
431
+ const shadow = host.attachShadow({ mode: "open" });
432
+ const style = document.createElement("style");
433
+ style.textContent = DASHBOARD_CSS;
434
+ shadow.appendChild(style);
435
+ const root = document.createElement("div");
436
+ root.id = "reactscope-dashboard-root";
437
+ root.style.cssText = "pointer-events: auto;";
438
+ shadow.appendChild(root);
439
+ document.body.appendChild(host);
440
+ return { host, shadow, root };
441
+ }
442
+ function removeShadowContainer(host) {
443
+ if (host.parentNode) {
444
+ host.parentNode.removeChild(host);
445
+ }
446
+ }
447
+ function createElement(tag, className, textContent) {
448
+ const el = document.createElement(tag);
449
+ if (className) {
450
+ el.className = className;
451
+ }
452
+ return el;
453
+ }
454
+
455
+ // src/plugins/dashboard-ui/utils/draggable.ts
456
+ function makeDraggable(element, handle, options = {}) {
457
+ let isDragging = false;
458
+ let startX = 0;
459
+ let startY = 0;
460
+ let offsetX = 0;
461
+ let offsetY = 0;
462
+ const handleMouseDown = (e) => {
463
+ if (e.button !== 0) return;
464
+ isDragging = true;
465
+ startX = e.clientX;
466
+ startY = e.clientY;
467
+ const rect = element.getBoundingClientRect();
468
+ offsetX = rect.left;
469
+ offsetY = rect.top;
470
+ handle.style.cursor = "grabbing";
471
+ options.onDragStart?.(offsetX, offsetY);
472
+ e.preventDefault();
473
+ };
474
+ const handleMouseMove = (e) => {
475
+ if (!isDragging) return;
476
+ const deltaX = e.clientX - startX;
477
+ const deltaY = e.clientY - startY;
478
+ let newX = offsetX + deltaX;
479
+ let newY = offsetY + deltaY;
480
+ if (options.bounds) {
481
+ newX = Math.max(options.bounds.minX, Math.min(newX, options.bounds.maxX));
482
+ newY = Math.max(options.bounds.minY, Math.min(newY, options.bounds.maxY));
483
+ }
484
+ element.style.left = `${newX}px`;
485
+ element.style.top = `${newY}px`;
486
+ element.style.right = "auto";
487
+ element.style.bottom = "auto";
488
+ options.onDrag?.(newX, newY);
489
+ };
490
+ const handleMouseUp = () => {
491
+ if (!isDragging) return;
492
+ isDragging = false;
493
+ handle.style.cursor = "move";
494
+ const rect = element.getBoundingClientRect();
495
+ options.onDragEnd?.(rect.left, rect.top);
496
+ };
497
+ handle.style.cursor = "move";
498
+ handle.addEventListener("mousedown", handleMouseDown);
499
+ document.addEventListener("mousemove", handleMouseMove);
500
+ document.addEventListener("mouseup", handleMouseUp);
501
+ return () => {
502
+ handle.removeEventListener("mousedown", handleMouseDown);
503
+ document.removeEventListener("mousemove", handleMouseMove);
504
+ document.removeEventListener("mouseup", handleMouseUp);
505
+ };
506
+ }
507
+ function getInitialPosition(position, width, height) {
508
+ const margin = 16;
509
+ switch (position) {
510
+ case "top-left":
511
+ return { x: margin, y: margin };
512
+ case "top-right":
513
+ return { x: window.innerWidth - width - margin, y: margin };
514
+ case "bottom-left":
515
+ return { x: margin, y: window.innerHeight - height - margin };
516
+ case "bottom-right":
517
+ return { x: window.innerWidth - width - margin, y: window.innerHeight - height - margin };
518
+ }
519
+ }
520
+
521
+ // src/plugins/dashboard-ui/utils/resizable.ts
522
+ function makeResizable(element, options = {}) {
523
+ const {
524
+ minWidth = 200,
525
+ minHeight = 150,
526
+ maxWidth = window.innerWidth - 32,
527
+ maxHeight = window.innerHeight - 32,
528
+ onResize,
529
+ onResizeEnd
530
+ } = options;
531
+ const cleanups = [];
532
+ const handleSE = document.createElement("div");
533
+ handleSE.className = "resize-handle resize-handle-se";
534
+ element.appendChild(handleSE);
535
+ const handleE = document.createElement("div");
536
+ handleE.className = "resize-handle resize-handle-e";
537
+ element.appendChild(handleE);
538
+ const handleS = document.createElement("div");
539
+ handleS.className = "resize-handle resize-handle-s";
540
+ element.appendChild(handleS);
541
+ const createResizeHandler = (handle, resizeWidth, resizeHeight) => {
542
+ let isResizing = false;
543
+ let startX = 0;
544
+ let startY = 0;
545
+ let startWidth = 0;
546
+ let startHeight = 0;
547
+ const onMouseDown = (e) => {
548
+ if (e.button !== 0) return;
549
+ isResizing = true;
550
+ startX = e.clientX;
551
+ startY = e.clientY;
552
+ startWidth = element.offsetWidth;
553
+ startHeight = element.offsetHeight;
554
+ e.preventDefault();
555
+ e.stopPropagation();
556
+ };
557
+ const onMouseMove = (e) => {
558
+ if (!isResizing) return;
559
+ let newWidth = startWidth;
560
+ let newHeight = startHeight;
561
+ if (resizeWidth) {
562
+ newWidth = startWidth + (e.clientX - startX);
563
+ newWidth = Math.max(minWidth, Math.min(newWidth, maxWidth));
564
+ }
565
+ if (resizeHeight) {
566
+ newHeight = startHeight + (e.clientY - startY);
567
+ newHeight = Math.max(minHeight, Math.min(newHeight, maxHeight));
568
+ }
569
+ element.style.width = `${newWidth}px`;
570
+ element.style.height = `${newHeight}px`;
571
+ onResize?.(newWidth, newHeight);
572
+ };
573
+ const onMouseUp = () => {
574
+ if (!isResizing) return;
575
+ isResizing = false;
576
+ onResizeEnd?.(element.offsetWidth, element.offsetHeight);
577
+ };
578
+ handle.addEventListener("mousedown", onMouseDown);
579
+ document.addEventListener("mousemove", onMouseMove);
580
+ document.addEventListener("mouseup", onMouseUp);
581
+ cleanups.push(() => {
582
+ handle.removeEventListener("mousedown", onMouseDown);
583
+ document.removeEventListener("mousemove", onMouseMove);
584
+ document.removeEventListener("mouseup", onMouseUp);
585
+ });
586
+ };
587
+ createResizeHandler(handleSE, true, true);
588
+ createResizeHandler(handleE, true, false);
589
+ createResizeHandler(handleS, false, true);
590
+ return () => {
591
+ for (const cleanup of cleanups) {
592
+ cleanup();
593
+ }
594
+ handleSE.remove();
595
+ handleE.remove();
596
+ handleS.remove();
597
+ };
598
+ }
599
+
600
+ // src/utils/throttle.ts
601
+ function throttle(fn, wait, options = {}) {
602
+ const { leading = true, trailing = true } = options;
603
+ let lastCallTime;
604
+ let lastInvokeTime = 0;
605
+ let timerId;
606
+ let lastArgs;
607
+ let lastThis;
608
+ let result;
609
+ function invokeFunc(time) {
610
+ const args = lastArgs;
611
+ const thisArg = lastThis;
612
+ lastArgs = void 0;
613
+ lastThis = void 0;
614
+ lastInvokeTime = time;
615
+ result = fn.apply(thisArg, args);
616
+ return result;
617
+ }
618
+ function shouldInvoke(time) {
619
+ const timeSinceLastCall = lastCallTime === void 0 ? wait : time - lastCallTime;
620
+ const timeSinceLastInvoke = time - lastInvokeTime;
621
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || timeSinceLastInvoke >= wait;
622
+ }
623
+ function remainingWait(time) {
624
+ const timeSinceLastCall = lastCallTime === void 0 ? 0 : time - lastCallTime;
625
+ const timeSinceLastInvoke = time - lastInvokeTime;
626
+ const timeWaiting = wait - timeSinceLastCall;
627
+ return Math.max(0, Math.min(timeWaiting, wait - timeSinceLastInvoke));
628
+ }
629
+ function trailingEdge(time) {
630
+ timerId = void 0;
631
+ if (trailing && lastArgs) {
632
+ return invokeFunc(time);
633
+ }
634
+ lastArgs = void 0;
635
+ lastThis = void 0;
636
+ return result;
637
+ }
638
+ function timerExpired() {
639
+ const time = Date.now();
640
+ if (shouldInvoke(time)) {
641
+ trailingEdge(time);
642
+ return;
643
+ }
644
+ timerId = setTimeout(timerExpired, remainingWait(time));
645
+ }
646
+ function leadingEdge(time) {
647
+ lastInvokeTime = time;
648
+ timerId = setTimeout(timerExpired, wait);
649
+ if (leading) {
650
+ return invokeFunc(time);
651
+ }
652
+ return result;
653
+ }
654
+ function throttled(...args) {
655
+ const time = Date.now();
656
+ const isInvoking = shouldInvoke(time);
657
+ lastArgs = args;
658
+ lastThis = this;
659
+ lastCallTime = time;
660
+ if (isInvoking) {
661
+ if (timerId === void 0) {
662
+ return leadingEdge(time);
663
+ }
664
+ if (trailing) {
665
+ timerId = setTimeout(timerExpired, wait);
666
+ return invokeFunc(time);
667
+ }
668
+ }
669
+ if (timerId === void 0 && trailing) {
670
+ timerId = setTimeout(timerExpired, wait);
671
+ }
672
+ return result;
673
+ }
674
+ function cancel() {
675
+ if (timerId !== void 0) {
676
+ clearTimeout(timerId);
677
+ }
678
+ lastInvokeTime = 0;
679
+ lastArgs = void 0;
680
+ lastCallTime = void 0;
681
+ lastThis = void 0;
682
+ timerId = void 0;
683
+ }
684
+ function flush() {
685
+ if (timerId === void 0) {
686
+ return result;
687
+ }
688
+ return trailingEdge(Date.now());
689
+ }
690
+ throttled.cancel = cancel;
691
+ throttled.flush = flush;
692
+ return throttled;
693
+ }
694
+
695
+ // src/plugins/dashboard-ui/dashboard-ui.ts
696
+ var DEFAULT_OPTIONS = {
697
+ position: "bottom-right",
698
+ shortcut: "ctrl+shift+r",
699
+ draggable: true,
700
+ resizable: true,
701
+ defaultWidth: 400,
702
+ defaultHeight: 500,
703
+ defaultCollapsed: false,
704
+ theme: "dark"
705
+ };
706
+ var DashboardUIPlugin = class {
707
+ constructor(options = {}) {
708
+ this.name = "dashboard-ui";
709
+ this.version = "1.0.0";
710
+ this.kernel = null;
711
+ this.host = null;
712
+ this.root = null;
713
+ this.dashboard = null;
714
+ this.cleanups = [];
715
+ this.updateThrottled = null;
716
+ this.api = {
717
+ show: () => this.show(),
718
+ hide: () => this.hide(),
719
+ toggle: () => this.toggle(),
720
+ isVisible: () => this.state.isVisible,
721
+ setPosition: (position) => this.setPosition(position),
722
+ setTheme: (theme) => this.setTheme(theme),
723
+ expand: () => this.expand(),
724
+ collapse: () => this.collapse(),
725
+ isCollapsed: () => this.state.isCollapsed,
726
+ focusSearch: () => this.focusSearch(),
727
+ selectComponent: (id) => this.selectComponent(id),
728
+ refresh: () => this.render()
729
+ };
730
+ this.options = { ...DEFAULT_OPTIONS, ...options };
731
+ this.state = {
732
+ isVisible: false,
733
+ isCollapsed: this.options.defaultCollapsed,
734
+ position: this.options.position,
735
+ width: this.options.defaultWidth,
736
+ height: this.options.defaultHeight,
737
+ x: 0,
738
+ y: 0,
739
+ theme: this.options.theme,
740
+ selectedComponentId: null,
741
+ searchQuery: "",
742
+ activeTab: "tree"
743
+ };
744
+ }
745
+ install(kernel) {
746
+ this.kernel = kernel;
747
+ this.setupKeyboardShortcut();
748
+ this.setupEventListeners();
749
+ this.updateThrottled = throttle(() => this.render(), 100);
750
+ }
751
+ uninstall() {
752
+ this.hide();
753
+ this.cleanup();
754
+ this.kernel = null;
755
+ }
756
+ cleanup() {
757
+ for (const cleanup of this.cleanups) {
758
+ cleanup();
759
+ }
760
+ this.cleanups = [];
761
+ if (this.host) {
762
+ removeShadowContainer(this.host);
763
+ this.host = null;
764
+ this.root = null;
765
+ this.dashboard = null;
766
+ }
767
+ }
768
+ setupKeyboardShortcut() {
769
+ const handleKeyDown = (e) => {
770
+ const shortcut = this.options.shortcut.toLowerCase();
771
+ const parts = shortcut.split("+");
772
+ const ctrlRequired = parts.includes("ctrl");
773
+ const shiftRequired = parts.includes("shift");
774
+ const altRequired = parts.includes("alt");
775
+ const key = parts.find((p) => !["ctrl", "shift", "alt"].includes(p)) ?? "";
776
+ if (e.ctrlKey === ctrlRequired && e.shiftKey === shiftRequired && e.altKey === altRequired && e.key.toLowerCase() === key) {
777
+ e.preventDefault();
778
+ this.toggle();
779
+ }
780
+ };
781
+ document.addEventListener("keydown", handleKeyDown);
782
+ this.cleanups.push(() => document.removeEventListener("keydown", handleKeyDown));
783
+ }
784
+ setupEventListeners() {
785
+ if (!this.kernel) return;
786
+ const unsubscribe = this.kernel.on("metrics-update", () => {
787
+ if (this.state.isVisible && this.updateThrottled) {
788
+ this.updateThrottled();
789
+ }
790
+ });
791
+ this.cleanups.push(unsubscribe);
792
+ }
793
+ show() {
794
+ if (this.state.isVisible) return;
795
+ this.state.isVisible = true;
796
+ this.createDashboard();
797
+ this.render();
798
+ }
799
+ hide() {
800
+ if (!this.state.isVisible) return;
801
+ this.state.isVisible = false;
802
+ if (this.host) {
803
+ removeShadowContainer(this.host);
804
+ this.host = null;
805
+ this.root = null;
806
+ this.dashboard = null;
807
+ }
808
+ }
809
+ toggle() {
810
+ if (this.state.isVisible) {
811
+ this.hide();
812
+ } else {
813
+ this.show();
814
+ }
815
+ }
816
+ setPosition(position) {
817
+ this.state.position = position;
818
+ const pos = getInitialPosition(position, this.state.width, this.state.height);
819
+ this.state.x = pos.x;
820
+ this.state.y = pos.y;
821
+ if (this.dashboard) {
822
+ this.dashboard.style.left = `${pos.x}px`;
823
+ this.dashboard.style.top = `${pos.y}px`;
824
+ }
825
+ }
826
+ setTheme(theme) {
827
+ this.state.theme = theme;
828
+ }
829
+ expand() {
830
+ this.state.isCollapsed = false;
831
+ if (this.dashboard) {
832
+ this.dashboard.classList.remove("collapsed");
833
+ }
834
+ }
835
+ collapse() {
836
+ this.state.isCollapsed = true;
837
+ if (this.dashboard) {
838
+ this.dashboard.classList.add("collapsed");
839
+ }
840
+ }
841
+ focusSearch() {
842
+ if (this.root) {
843
+ const searchInput = this.root.querySelector(".search-input");
844
+ searchInput?.focus();
845
+ }
846
+ }
847
+ selectComponent(componentId) {
848
+ this.state.selectedComponentId = componentId;
849
+ this.render();
850
+ }
851
+ createDashboard() {
852
+ const { host, root } = createShadowContainer();
853
+ this.host = host;
854
+ this.root = root;
855
+ const pos = getInitialPosition(this.state.position, this.state.width, this.state.height);
856
+ this.state.x = pos.x;
857
+ this.state.y = pos.y;
858
+ this.dashboard = createElement("div", "dashboard");
859
+ this.dashboard.style.width = `${this.state.width}px`;
860
+ this.dashboard.style.height = `${this.state.height}px`;
861
+ this.dashboard.style.left = `${pos.x}px`;
862
+ this.dashboard.style.top = `${pos.y}px`;
863
+ if (this.state.isCollapsed) {
864
+ this.dashboard.classList.add("collapsed");
865
+ }
866
+ root.appendChild(this.dashboard);
867
+ if (this.options.resizable) {
868
+ const cleanupResize = makeResizable(this.dashboard, {
869
+ minWidth: 300,
870
+ minHeight: 200,
871
+ onResizeEnd: (width, height) => {
872
+ this.state.width = width;
873
+ this.state.height = height;
874
+ }
875
+ });
876
+ this.cleanups.push(cleanupResize);
877
+ }
878
+ }
879
+ render() {
880
+ if (!this.dashboard || !this.kernel) return;
881
+ while (this.dashboard.firstChild) {
882
+ this.dashboard.removeChild(this.dashboard.firstChild);
883
+ }
884
+ const header = this.renderHeader();
885
+ this.dashboard.appendChild(header);
886
+ if (this.options.draggable) {
887
+ const cleanupDrag = makeDraggable(this.dashboard, header, {
888
+ onDragEnd: (x, y) => {
889
+ this.state.x = x;
890
+ this.state.y = y;
891
+ }
892
+ });
893
+ this.cleanups.push(cleanupDrag);
894
+ }
895
+ if (!this.state.isCollapsed) {
896
+ const content = this.renderContent();
897
+ this.dashboard.appendChild(content);
898
+ }
899
+ }
900
+ renderHeader() {
901
+ const header = createElement("div", "dashboard-header");
902
+ const title = createElement("div", "dashboard-title");
903
+ const icon = createElement("span", "dashboard-title-icon");
904
+ icon.textContent = "\u26A1";
905
+ const text = createElement("span");
906
+ text.textContent = "ReactScope";
907
+ title.appendChild(icon);
908
+ title.appendChild(text);
909
+ header.appendChild(title);
910
+ const controls = createElement("div", "dashboard-controls");
911
+ const collapseBtn = createElement("button", "dashboard-btn");
912
+ collapseBtn.textContent = this.state.isCollapsed ? "\u25A2" : "\u2581";
913
+ collapseBtn.title = this.state.isCollapsed ? "Expand" : "Collapse";
914
+ collapseBtn.onclick = () => {
915
+ if (this.state.isCollapsed) {
916
+ this.expand();
917
+ } else {
918
+ this.collapse();
919
+ }
920
+ this.render();
921
+ };
922
+ controls.appendChild(collapseBtn);
923
+ const closeBtn = createElement("button", "dashboard-btn");
924
+ closeBtn.textContent = "\u2715";
925
+ closeBtn.title = "Close";
926
+ closeBtn.onclick = () => this.hide();
927
+ controls.appendChild(closeBtn);
928
+ header.appendChild(controls);
929
+ return header;
930
+ }
931
+ renderContent() {
932
+ const content = createElement("div", "dashboard-content");
933
+ const tabs = this.renderTabs();
934
+ content.appendChild(tabs);
935
+ const panel = this.renderPanel();
936
+ content.appendChild(panel);
937
+ return content;
938
+ }
939
+ renderTabs() {
940
+ const tabs = createElement("div", "dashboard-tabs");
941
+ const tabItems = [
942
+ { id: "tree", label: "Tree" },
943
+ { id: "alerts", label: "Alerts" },
944
+ { id: "details", label: "Details" }
945
+ ];
946
+ for (const item of tabItems) {
947
+ const tab = createElement("button", "dashboard-tab");
948
+ tab.textContent = item.label;
949
+ if (this.state.activeTab === item.id) {
950
+ tab.classList.add("active");
951
+ }
952
+ tab.onclick = () => {
953
+ this.state.activeTab = item.id;
954
+ this.render();
955
+ };
956
+ tabs.appendChild(tab);
957
+ }
958
+ return tabs;
959
+ }
960
+ renderPanel() {
961
+ const panel = createElement("div", "dashboard-panel");
962
+ switch (this.state.activeTab) {
963
+ case "tree":
964
+ this.renderTreePanel(panel);
965
+ break;
966
+ case "alerts":
967
+ this.renderAlertsPanel(panel);
968
+ break;
969
+ case "details":
970
+ this.renderDetailsPanel(panel);
971
+ break;
972
+ }
973
+ return panel;
974
+ }
975
+ renderTreePanel(panel) {
976
+ const searchInput = createElement("input", "search-input");
977
+ searchInput.type = "text";
978
+ searchInput.placeholder = "Search components...";
979
+ searchInput.value = this.state.searchQuery;
980
+ searchInput.oninput = (e) => {
981
+ this.state.searchQuery = e.target.value;
982
+ this.render();
983
+ };
984
+ panel.appendChild(searchInput);
985
+ const treeView = createElement("div", "tree-view");
986
+ const tree = this.kernel?.getMetrics().getTree();
987
+ if (tree?.root) {
988
+ this.renderTreeNode(treeView, tree.root);
989
+ } else {
990
+ const empty = this.createEmptyState("\u{1F4CA}", "No components tracked yet");
991
+ treeView.appendChild(empty);
992
+ }
993
+ panel.appendChild(treeView);
994
+ }
995
+ renderTreeNode(container, node) {
996
+ const query = this.state.searchQuery.toLowerCase();
997
+ const matchesSearch = !query || node.name.toLowerCase().includes(query);
998
+ const hasMatchingChildren = node.children.some(
999
+ (child) => this.nodeMatchesSearch(child, query)
1000
+ );
1001
+ if (!matchesSearch && !hasMatchingChildren) {
1002
+ return;
1003
+ }
1004
+ const nodeEl = createElement("div", "tree-node");
1005
+ const contentEl = createElement("div", "tree-node-content");
1006
+ if (this.state.selectedComponentId === node.id) {
1007
+ contentEl.classList.add("selected");
1008
+ }
1009
+ contentEl.onclick = () => {
1010
+ this.state.selectedComponentId = node.id;
1011
+ this.state.activeTab = "details";
1012
+ this.render();
1013
+ };
1014
+ if (node.children.length > 0) {
1015
+ const toggle = createElement("span", "tree-node-toggle");
1016
+ toggle.textContent = node.isExpanded ? "\u25BC" : "\u25B6";
1017
+ toggle.onclick = (e) => {
1018
+ e.stopPropagation();
1019
+ node.isExpanded = !node.isExpanded;
1020
+ this.render();
1021
+ };
1022
+ contentEl.appendChild(toggle);
1023
+ } else {
1024
+ const spacer = createElement("span", "tree-node-toggle");
1025
+ contentEl.appendChild(spacer);
1026
+ }
1027
+ const name = createElement("span", "tree-node-name");
1028
+ name.textContent = node.name;
1029
+ contentEl.appendChild(name);
1030
+ if (node.metrics) {
1031
+ const metrics = createElement("span", "tree-node-metrics");
1032
+ const rendersBadge = createElement("span", "metric-badge renders");
1033
+ rendersBadge.textContent = String(node.metrics.renderCount);
1034
+ metrics.appendChild(rendersBadge);
1035
+ const timeBadge = createElement("span", `metric-badge time${node.metrics.averageRenderTime > 16 ? " slow" : ""}`);
1036
+ timeBadge.textContent = formatDuration(node.metrics.averageRenderTime);
1037
+ metrics.appendChild(timeBadge);
1038
+ if (node.metrics.wastedRenderCount > 0) {
1039
+ const wastedBadge = createElement("span", "metric-badge wasted");
1040
+ wastedBadge.textContent = `\u26A0\uFE0F ${node.metrics.wastedRenderCount}`;
1041
+ metrics.appendChild(wastedBadge);
1042
+ }
1043
+ contentEl.appendChild(metrics);
1044
+ }
1045
+ nodeEl.appendChild(contentEl);
1046
+ if (node.isExpanded && node.children.length > 0) {
1047
+ const childrenEl = createElement("div", "tree-node-children");
1048
+ for (const child of node.children) {
1049
+ this.renderTreeNode(childrenEl, child);
1050
+ }
1051
+ nodeEl.appendChild(childrenEl);
1052
+ }
1053
+ container.appendChild(nodeEl);
1054
+ }
1055
+ nodeMatchesSearch(node, query) {
1056
+ if (!query) return true;
1057
+ if (node.name.toLowerCase().includes(query)) return true;
1058
+ return node.children.some((child) => this.nodeMatchesSearch(child, query));
1059
+ }
1060
+ renderAlertsPanel(panel) {
1061
+ const allMetrics = this.kernel?.getMetrics().getAll();
1062
+ if (!allMetrics || allMetrics.size === 0) {
1063
+ const empty = this.createEmptyState("\u2713", "No alerts");
1064
+ panel.appendChild(empty);
1065
+ return;
1066
+ }
1067
+ const alerts = [];
1068
+ for (const metrics of allMetrics.values()) {
1069
+ if (metrics.averageRenderTime > 16) {
1070
+ alerts.push({
1071
+ type: "error",
1072
+ title: `${metrics.componentName} is slow`,
1073
+ description: `Average render time: ${formatDuration(metrics.averageRenderTime)}`
1074
+ });
1075
+ }
1076
+ if (metrics.wastedRenderCount > 0 && metrics.renderCount > 0) {
1077
+ const percentage = (metrics.wastedRenderCount / metrics.renderCount * 100).toFixed(0);
1078
+ if (parseInt(percentage) > 30) {
1079
+ alerts.push({
1080
+ type: "warning",
1081
+ title: `${metrics.componentName} has wasted renders`,
1082
+ description: `${metrics.wastedRenderCount} wasted renders (${percentage}%)`
1083
+ });
1084
+ }
1085
+ }
1086
+ }
1087
+ if (alerts.length === 0) {
1088
+ const empty = this.createEmptyState("\u2713", "No alerts - everything looks good!");
1089
+ panel.appendChild(empty);
1090
+ return;
1091
+ }
1092
+ for (const alert of alerts) {
1093
+ const alertEl = createElement("div", "alert-item");
1094
+ const icon = createElement("span", `alert-icon ${alert.type}`);
1095
+ icon.textContent = alert.type === "warning" ? "\u26A0\uFE0F" : "\u{1F534}";
1096
+ alertEl.appendChild(icon);
1097
+ const content = createElement("div", "alert-content");
1098
+ const title = createElement("div", "alert-title");
1099
+ title.textContent = alert.title;
1100
+ const description = createElement("div", "alert-description");
1101
+ description.textContent = alert.description;
1102
+ content.appendChild(title);
1103
+ content.appendChild(description);
1104
+ alertEl.appendChild(content);
1105
+ panel.appendChild(alertEl);
1106
+ }
1107
+ }
1108
+ renderDetailsPanel(panel) {
1109
+ const componentId = this.state.selectedComponentId;
1110
+ if (!componentId) {
1111
+ const empty = this.createEmptyState("\u{1F446}", "Select a component to view details");
1112
+ panel.appendChild(empty);
1113
+ return;
1114
+ }
1115
+ const metrics = this.kernel?.getMetrics().get(componentId);
1116
+ if (!metrics) {
1117
+ const empty = this.createEmptyState("\u2753", "Component not found");
1118
+ panel.appendChild(empty);
1119
+ return;
1120
+ }
1121
+ const details = createElement("div", "details-panel");
1122
+ const infoSection = createElement("div", "details-section");
1123
+ const infoTitle = createElement("div", "details-section-title");
1124
+ infoTitle.textContent = "Component";
1125
+ infoSection.appendChild(infoTitle);
1126
+ infoSection.appendChild(this.createRow("Name", metrics.componentName));
1127
+ infoSection.appendChild(this.createRow("ID", metrics.componentId));
1128
+ infoSection.appendChild(this.createRow("Status", metrics.isCurrentlyMounted ? "\u{1F7E2} Mounted" : "\u{1F534} Unmounted"));
1129
+ details.appendChild(infoSection);
1130
+ const renderSection = createElement("div", "details-section");
1131
+ const renderTitle = createElement("div", "details-section-title");
1132
+ renderTitle.textContent = "Renders";
1133
+ renderSection.appendChild(renderTitle);
1134
+ renderSection.appendChild(this.createRow("Count", metrics.renderCount.toString()));
1135
+ renderSection.appendChild(this.createRow("Average Time", formatDuration(metrics.averageRenderTime)));
1136
+ renderSection.appendChild(this.createRow("Total Time", formatDuration(metrics.totalRenderTime)));
1137
+ renderSection.appendChild(this.createRow("Last Render", formatDuration(metrics.lastRenderTime)));
1138
+ renderSection.appendChild(this.createRow("Wasted Renders", metrics.wastedRenderCount.toString()));
1139
+ details.appendChild(renderSection);
1140
+ const lifecycleSection = createElement("div", "details-section");
1141
+ const lifecycleTitle = createElement("div", "details-section-title");
1142
+ lifecycleTitle.textContent = "Lifecycle";
1143
+ lifecycleSection.appendChild(lifecycleTitle);
1144
+ lifecycleSection.appendChild(this.createRow("Mount Count", metrics.mountCount.toString()));
1145
+ lifecycleSection.appendChild(this.createRow("Props Changes", metrics.propsChangeCount.toString()));
1146
+ details.appendChild(lifecycleSection);
1147
+ panel.appendChild(details);
1148
+ }
1149
+ createEmptyState(iconText, message) {
1150
+ const empty = createElement("div", "empty-state");
1151
+ const icon = createElement("div", "empty-state-icon");
1152
+ icon.textContent = iconText;
1153
+ const text = createElement("div");
1154
+ text.textContent = message;
1155
+ empty.appendChild(icon);
1156
+ empty.appendChild(text);
1157
+ return empty;
1158
+ }
1159
+ createRow(label, value) {
1160
+ const row = createElement("div", "details-row");
1161
+ const labelEl = createElement("span", "details-label");
1162
+ labelEl.textContent = label;
1163
+ const valueEl = createElement("span", "details-value");
1164
+ valueEl.textContent = value;
1165
+ row.appendChild(labelEl);
1166
+ row.appendChild(valueEl);
1167
+ return row;
1168
+ }
1169
+ };
1170
+ function createDashboardUIPlugin(options) {
1171
+ return new DashboardUIPlugin(options);
1172
+ }
1173
+
1174
+ export { DashboardUIPlugin, createDashboardUIPlugin, throttle };
1175
+ //# sourceMappingURL=chunk-6LHJL6MV.js.map
1176
+ //# sourceMappingURL=chunk-6LHJL6MV.js.map