@ytspar/devbar 1.0.0-canary.e1f65d0 → 1.0.0-canary.f2afc5a

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 (122) hide show
  1. package/README.md +9 -0
  2. package/dist/GlobalDevBar.d.ts +128 -130
  3. package/dist/GlobalDevBar.d.ts.map +1 -0
  4. package/dist/GlobalDevBar.js +223 -1732
  5. package/dist/GlobalDevBar.js.map +1 -0
  6. package/dist/accessibility.d.ts +85 -0
  7. package/dist/accessibility.d.ts.map +1 -0
  8. package/dist/accessibility.js +156 -0
  9. package/dist/accessibility.js.map +1 -0
  10. package/dist/constants.d.ts +132 -9
  11. package/dist/constants.d.ts.map +1 -0
  12. package/dist/constants.js +201 -120
  13. package/dist/constants.js.map +1 -0
  14. package/dist/debug.d.ts +40 -0
  15. package/dist/debug.d.ts.map +1 -0
  16. package/dist/debug.js +94 -0
  17. package/dist/debug.js.map +1 -0
  18. package/dist/earlyConsoleCapture.d.ts +4 -31
  19. package/dist/earlyConsoleCapture.d.ts.map +1 -0
  20. package/dist/earlyConsoleCapture.js +4 -74
  21. package/dist/earlyConsoleCapture.js.map +1 -0
  22. package/dist/index.d.ts +14 -5
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +25 -8
  25. package/dist/index.js.map +1 -0
  26. package/dist/lazy/index.d.ts +7 -0
  27. package/dist/lazy/index.d.ts.map +1 -0
  28. package/dist/lazy/index.js +7 -0
  29. package/dist/lazy/index.js.map +1 -0
  30. package/dist/lazy/lazyHtml2Canvas.d.ts +34 -0
  31. package/dist/lazy/lazyHtml2Canvas.d.ts.map +1 -0
  32. package/dist/lazy/lazyHtml2Canvas.js +38 -0
  33. package/dist/lazy/lazyHtml2Canvas.js.map +1 -0
  34. package/dist/modules/index.d.ts +15 -0
  35. package/dist/modules/index.d.ts.map +1 -0
  36. package/dist/modules/index.js +14 -0
  37. package/dist/modules/index.js.map +1 -0
  38. package/dist/modules/keyboard.d.ts +15 -0
  39. package/dist/modules/keyboard.d.ts.map +1 -0
  40. package/dist/modules/keyboard.js +60 -0
  41. package/dist/modules/keyboard.js.map +1 -0
  42. package/dist/modules/performance.d.ts +26 -0
  43. package/dist/modules/performance.d.ts.map +1 -0
  44. package/dist/modules/performance.js +197 -0
  45. package/dist/modules/performance.js.map +1 -0
  46. package/dist/modules/rendering.d.ts +20 -0
  47. package/dist/modules/rendering.d.ts.map +1 -0
  48. package/dist/modules/rendering.js +1997 -0
  49. package/dist/modules/rendering.js.map +1 -0
  50. package/dist/modules/screenshot.d.ts +54 -0
  51. package/dist/modules/screenshot.d.ts.map +1 -0
  52. package/dist/modules/screenshot.js +303 -0
  53. package/dist/modules/screenshot.js.map +1 -0
  54. package/dist/modules/theme.d.ts +20 -0
  55. package/dist/modules/theme.d.ts.map +1 -0
  56. package/dist/modules/theme.js +60 -0
  57. package/dist/modules/theme.js.map +1 -0
  58. package/dist/modules/tooltips.d.ts +74 -0
  59. package/dist/modules/tooltips.d.ts.map +1 -0
  60. package/dist/modules/tooltips.js +549 -0
  61. package/dist/modules/tooltips.js.map +1 -0
  62. package/dist/modules/types.d.ts +115 -0
  63. package/dist/modules/types.d.ts.map +1 -0
  64. package/dist/modules/types.js +9 -0
  65. package/dist/modules/types.js.map +1 -0
  66. package/dist/modules/websocket.d.ts +16 -0
  67. package/dist/modules/websocket.d.ts.map +1 -0
  68. package/dist/modules/websocket.js +296 -0
  69. package/dist/modules/websocket.js.map +1 -0
  70. package/dist/network.d.ts +93 -0
  71. package/dist/network.d.ts.map +1 -0
  72. package/dist/network.js +175 -0
  73. package/dist/network.js.map +1 -0
  74. package/dist/outline.d.ts +1 -0
  75. package/dist/outline.d.ts.map +1 -0
  76. package/dist/outline.js +44 -10
  77. package/dist/outline.js.map +1 -0
  78. package/dist/presets.d.ts +58 -0
  79. package/dist/presets.d.ts.map +1 -0
  80. package/dist/presets.js +134 -0
  81. package/dist/presets.js.map +1 -0
  82. package/dist/schema.d.ts +1 -0
  83. package/dist/schema.d.ts.map +1 -0
  84. package/dist/schema.js +7 -6
  85. package/dist/schema.js.map +1 -0
  86. package/dist/settings.d.ts +149 -0
  87. package/dist/settings.d.ts.map +1 -0
  88. package/dist/settings.js +296 -0
  89. package/dist/settings.js.map +1 -0
  90. package/dist/storage.d.ts +84 -0
  91. package/dist/storage.d.ts.map +1 -0
  92. package/dist/storage.js +183 -0
  93. package/dist/storage.js.map +1 -0
  94. package/dist/types.d.ts +29 -3
  95. package/dist/types.d.ts.map +1 -0
  96. package/dist/types.js +3 -2
  97. package/dist/types.js.map +1 -0
  98. package/dist/ui/buttons.d.ts +3 -2
  99. package/dist/ui/buttons.d.ts.map +1 -0
  100. package/dist/ui/buttons.js +3 -2
  101. package/dist/ui/buttons.js.map +1 -0
  102. package/dist/ui/cards.d.ts +37 -0
  103. package/dist/ui/cards.d.ts.map +1 -0
  104. package/dist/ui/cards.js +134 -0
  105. package/dist/ui/cards.js.map +1 -0
  106. package/dist/ui/icons.d.ts +71 -2
  107. package/dist/ui/icons.d.ts.map +1 -0
  108. package/dist/ui/icons.js +148 -2
  109. package/dist/ui/icons.js.map +1 -0
  110. package/dist/ui/index.d.ts +5 -3
  111. package/dist/ui/index.d.ts.map +1 -0
  112. package/dist/ui/index.js +5 -3
  113. package/dist/ui/index.js.map +1 -0
  114. package/dist/ui/modals.d.ts +7 -2
  115. package/dist/ui/modals.d.ts.map +1 -0
  116. package/dist/ui/modals.js +56 -9
  117. package/dist/ui/modals.js.map +1 -0
  118. package/dist/utils.d.ts +4 -3
  119. package/dist/utils.d.ts.map +1 -0
  120. package/dist/utils.js +4 -3
  121. package/dist/utils.js.map +1 -0
  122. package/package.json +17 -14
package/dist/constants.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * DevBar Constants
2
+ * devbar Constants
3
3
  *
4
- * Shared constants used by the DevBar components.
4
+ * Shared constants used by the devbar components.
5
5
  */
6
6
  // Re-export shared constants from sweetlink's browser modules to avoid pulling in Node.js-only code
7
7
  export { MAX_CONSOLE_LOGS } from '@ytspar/sweetlink/browser/consoleCapture';
@@ -18,8 +18,14 @@ export const MAX_RECONNECT_DELAY_MS = 30000;
18
18
  // ============================================================================
19
19
  // WebSocket Settings
20
20
  // ============================================================================
21
- /** Default WebSocket port for Sweetlink connection */
22
- export const WS_PORT = 9223;
21
+ // Re-export port constants from sweetlink
22
+ export { DEFAULT_WS_PORT as WS_PORT, WS_PORT_OFFSET } from '@ytspar/sweetlink/types';
23
+ /** Maximum ports to try when scanning for matching server */
24
+ export const MAX_PORT_RETRIES = 10;
25
+ /** Delay between port scan attempts (ms) */
26
+ export const PORT_RETRY_DELAY_MS = 100;
27
+ /** Delay before restarting port scan from base after all ports fail (ms) */
28
+ export const PORT_SCAN_RESTART_DELAY_MS = 3000;
23
29
  // ============================================================================
24
30
  // Notification Durations
25
31
  // ============================================================================
@@ -41,11 +47,11 @@ export const SCREENSHOT_SCALE = 0.75;
41
47
  // ============================================================================
42
48
  /** Tailwind CSS breakpoint definitions */
43
49
  export const TAILWIND_BREAKPOINTS = {
44
- 'base': { min: 0, label: 'Tailwind base: <640px' },
45
- 'sm': { min: 640, label: 'Tailwind sm: >=640px' },
46
- 'md': { min: 768, label: 'Tailwind md: >=768px' },
47
- 'lg': { min: 1024, label: 'Tailwind lg: >=1024px' },
48
- 'xl': { min: 1280, label: 'Tailwind xl: >=1280px' },
50
+ base: { min: 0, label: 'Tailwind base: <640px' },
51
+ sm: { min: 640, label: 'Tailwind sm: >=640px' },
52
+ md: { min: 768, label: 'Tailwind md: >=768px' },
53
+ lg: { min: 1024, label: 'Tailwind lg: >=1024px' },
54
+ xl: { min: 1280, label: 'Tailwind xl: >=1280px' },
49
55
  '2xl': { min: 1536, label: 'Tailwind 2xl: >=1536px' },
50
56
  };
51
57
  // ============================================================================
@@ -76,6 +82,7 @@ export const BUTTON_COLORS = {
76
82
  schema: PALETTE.amber,
77
83
  error: PALETTE.red,
78
84
  warning: PALETTE.amber,
85
+ info: PALETTE.blue,
79
86
  };
80
87
  /** Category colors for outline display */
81
88
  export const CATEGORY_COLORS = {
@@ -89,9 +96,19 @@ export const CATEGORY_COLORS = {
89
96
  other: PALETTE.gray,
90
97
  };
91
98
  // ============================================================================
99
+ // Storage Keys
100
+ // ============================================================================
101
+ /** LocalStorage keys for devbar persistence */
102
+ export const STORAGE_KEYS = {
103
+ /** Theme mode preference: 'dark' | 'light' | 'system' */
104
+ themeMode: 'devbar-theme-mode',
105
+ /** Compact mode preference: 'true' | 'false' */
106
+ compactMode: 'devbar-compact-mode',
107
+ };
108
+ // ============================================================================
92
109
  // Design System Theme
93
110
  // ============================================================================
94
- /** Complete DevBar design system theme */
111
+ /** Complete devbar design system theme */
95
112
  export const DEVBAR_THEME = {
96
113
  colors: {
97
114
  // Primary accent
@@ -125,7 +142,7 @@ export const DEVBAR_THEME = {
125
142
  // Falls back to system monospace if not loaded
126
143
  mono: "'Departure Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
127
144
  },
128
- // Typography scale (matches DevBar UI)
145
+ // Typography scale (matches devbar UI)
129
146
  typography: {
130
147
  // Font sizes
131
148
  sizeXs: '0.625rem', // 10px - badges, tiny labels
@@ -164,13 +181,167 @@ export const DEVBAR_THEME = {
164
181
  fast: '150ms',
165
182
  },
166
183
  };
184
+ /** Light theme variant - terminal aesthetic with light green tones */
185
+ export const DEVBAR_THEME_LIGHT = {
186
+ colors: {
187
+ // Primary accent (darker emerald for contrast)
188
+ primary: '#047857', // darker emerald for better contrast
189
+ primaryHover: '#065f46',
190
+ primaryGlow: 'rgba(4, 120, 87, 0.25)',
191
+ // Semantic colors (adjusted for light bg)
192
+ error: '#dc2626',
193
+ warning: '#d97706',
194
+ info: '#2563eb',
195
+ // Extended palette (darker for light mode)
196
+ purple: '#7c3aed',
197
+ cyan: '#0891b2',
198
+ pink: '#db2777',
199
+ lime: '#65a30d',
200
+ // Backgrounds - terminal light green aesthetic
201
+ bg: '#ecfdf5', // very light mint/green
202
+ bgCard: 'rgba(255, 255, 255, 0.85)',
203
+ bgElevated: 'rgba(255, 255, 255, 0.95)',
204
+ bgInput: 'rgba(236, 253, 245, 0.9)', // light mint input
205
+ // Text (dark on light)
206
+ text: '#064e3b', // dark emerald text
207
+ textSecondary: '#065f46',
208
+ textMuted: '#047857',
209
+ // Borders (emerald-tinted)
210
+ border: 'rgba(4, 120, 87, 0.3)',
211
+ borderSubtle: 'rgba(4, 120, 87, 0.1)',
212
+ },
213
+ // Other properties same as dark theme
214
+ fonts: DEVBAR_THEME.fonts,
215
+ typography: DEVBAR_THEME.typography,
216
+ radius: DEVBAR_THEME.radius,
217
+ shadows: {
218
+ sm: '0 1px 2px rgba(4, 120, 87, 0.1)',
219
+ md: '0 4px 12px rgba(4, 120, 87, 0.12), 0 0 0 1px rgba(4, 120, 87, 0.15)',
220
+ lg: '0 8px 32px rgba(4, 120, 87, 0.15), 0 0 0 1px rgba(4, 120, 87, 0.2)',
221
+ glow: '0 0 20px rgba(4, 120, 87, 0.15)',
222
+ },
223
+ transitions: DEVBAR_THEME.transitions,
224
+ };
167
225
  // ============================================================================
168
226
  // Shorthand Exports (for cleaner imports)
169
227
  // ============================================================================
170
- /** Shorthand for common colors */
228
+ /** Shorthand for common colors (static dark theme - use CSS_COLORS for theming) */
171
229
  export const COLORS = DEVBAR_THEME.colors;
172
230
  /** Shorthand for font stack */
173
231
  export const FONT_MONO = DEVBAR_THEME.fonts.mono;
232
+ /**
233
+ * CSS variable references for dynamic theming.
234
+ * Use these instead of COLORS for inline styles that should respond to theme changes.
235
+ */
236
+ export const CSS_COLORS = {
237
+ // Primary accent
238
+ primary: 'var(--devbar-color-primary)',
239
+ primaryHover: 'var(--devbar-color-primary-hover)',
240
+ primaryGlow: 'var(--devbar-color-primary-glow)',
241
+ // Semantic colors
242
+ error: 'var(--devbar-color-error)',
243
+ warning: 'var(--devbar-color-warning)',
244
+ info: 'var(--devbar-color-info)',
245
+ // Extended palette
246
+ purple: 'var(--devbar-color-purple)',
247
+ cyan: 'var(--devbar-color-cyan)',
248
+ pink: 'var(--devbar-color-pink)',
249
+ lime: 'var(--devbar-color-lime)',
250
+ // Backgrounds
251
+ bg: 'var(--devbar-color-bg)',
252
+ bgCard: 'var(--devbar-color-bg-card)',
253
+ bgElevated: 'var(--devbar-color-bg-elevated)',
254
+ bgInput: 'var(--devbar-color-bg-input)',
255
+ // Text
256
+ text: 'var(--devbar-color-text)',
257
+ textSecondary: 'var(--devbar-color-text-secondary)',
258
+ textMuted: 'var(--devbar-color-text-muted)',
259
+ // Borders
260
+ border: 'var(--devbar-color-border)',
261
+ borderSubtle: 'var(--devbar-color-border-subtle)',
262
+ };
263
+ // ============================================================================
264
+ // Theme Mode Utilities
265
+ // ============================================================================
266
+ /**
267
+ * Safely get item from localStorage with error handling
268
+ */
269
+ function safeGetItem(key) {
270
+ if (typeof localStorage === 'undefined')
271
+ return null;
272
+ try {
273
+ return localStorage.getItem(key);
274
+ }
275
+ catch (error) {
276
+ // Handle SecurityError in private browsing or iframe contexts
277
+ console.warn('[devbar] localStorage access failed:', error);
278
+ return null;
279
+ }
280
+ }
281
+ /**
282
+ * Safely set item in localStorage with error handling
283
+ */
284
+ function safeSetItem(key, value) {
285
+ if (typeof localStorage === 'undefined')
286
+ return false;
287
+ try {
288
+ localStorage.setItem(key, value);
289
+ return true;
290
+ }
291
+ catch (error) {
292
+ // Handle QuotaExceededError or SecurityError
293
+ if (error instanceof Error) {
294
+ if (error.name === 'QuotaExceededError') {
295
+ console.warn('[devbar] localStorage quota exceeded');
296
+ }
297
+ else {
298
+ console.warn('[devbar] localStorage access failed:', error.message);
299
+ }
300
+ }
301
+ return false;
302
+ }
303
+ }
304
+ /**
305
+ * Get the stored theme mode preference
306
+ */
307
+ export function getStoredThemeMode() {
308
+ const stored = safeGetItem(STORAGE_KEYS.themeMode);
309
+ if (stored === 'dark' || stored === 'light' || stored === 'system') {
310
+ return stored;
311
+ }
312
+ return 'system';
313
+ }
314
+ /**
315
+ * Store the theme mode preference
316
+ */
317
+ export function setStoredThemeMode(mode) {
318
+ safeSetItem(STORAGE_KEYS.themeMode, mode);
319
+ }
320
+ /**
321
+ * Get the effective theme (resolves 'system' to 'dark' or 'light')
322
+ */
323
+ export function getEffectiveTheme(mode) {
324
+ if (mode === 'system') {
325
+ if (typeof window === 'undefined')
326
+ return 'dark';
327
+ return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
328
+ }
329
+ return mode;
330
+ }
331
+ /**
332
+ * Get theme colors based on the current effective theme
333
+ */
334
+ export function getThemeColors(mode) {
335
+ const effectiveTheme = getEffectiveTheme(mode);
336
+ return effectiveTheme === 'light' ? DEVBAR_THEME_LIGHT.colors : DEVBAR_THEME.colors;
337
+ }
338
+ /**
339
+ * Get full theme based on the current effective theme
340
+ */
341
+ export function getTheme(mode) {
342
+ const effectiveTheme = getEffectiveTheme(mode);
343
+ return effectiveTheme === 'light' ? DEVBAR_THEME_LIGHT : DEVBAR_THEME;
344
+ }
174
345
  /**
175
346
  * Generate CSS custom properties from the theme
176
347
  */
@@ -330,9 +501,9 @@ export const MODAL_OVERLAY_STYLES = {
330
501
  alignItems: 'center',
331
502
  justifyContent: 'center',
332
503
  };
333
- /** Common modal box styles */
504
+ /** Common modal box styles (uses CSS variables for theming) */
334
505
  export const MODAL_BOX_BASE_STYLES = {
335
- backgroundColor: COLORS.bgElevated,
506
+ backgroundColor: 'var(--devbar-color-bg-elevated)',
336
507
  borderRadius: '12px',
337
508
  width: '90%',
338
509
  maxWidth: '700px',
@@ -344,105 +515,22 @@ export const MODAL_BOX_BASE_STYLES = {
344
515
  // ============================================================================
345
516
  // CSS Styles
346
517
  // ============================================================================
347
- /** Tooltip and animation CSS styles */
348
- export const TOOLTIP_STYLES = `
349
- .devbar-tooltip {
350
- position: relative;
351
- }
352
- /* Invisible bridge to keep tooltip open when moving mouse to it */
353
- .devbar-tooltip::before {
354
- content: '';
355
- position: absolute;
356
- bottom: 100%;
357
- left: 0;
358
- right: 0;
359
- height: 16px;
360
- pointer-events: none;
361
- }
362
- .devbar-tooltip:hover::before {
363
- pointer-events: auto;
364
- }
365
- /* Extend bridge for right-aligned tooltips (tooltip extends left) */
366
- .devbar-tooltip-right::before {
367
- left: -400px;
368
- right: 0;
369
- }
370
- /* Extend bridge for left-aligned tooltips (tooltip extends right) */
371
- .devbar-tooltip-left::before {
372
- left: 0;
373
- right: -400px;
374
- }
375
- .devbar-tooltip::after {
376
- content: attr(data-tooltip);
377
- position: absolute;
378
- bottom: calc(100% + 8px);
379
- left: 50%;
380
- transform: translateX(-50%) scale(0.95);
381
- padding: 0.625rem 1rem;
382
- background: ${COLORS.bgElevated};
383
- color: ${COLORS.primary};
384
- font-family: ${FONT_MONO};
385
- font-size: 0.75rem;
386
- line-height: 1.5;
387
- border-radius: 6px;
388
- border: 1px solid ${COLORS.border};
389
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(16, 185, 129, 0.1);
390
- backdrop-filter: blur(8px);
391
- -webkit-backdrop-filter: blur(8px);
392
- min-width: min(200px, calc(100vw - 32px));
393
- max-width: min(400px, calc(100vw - 32px));
394
- white-space: pre-wrap;
395
- z-index: 10001;
396
- pointer-events: none;
397
- opacity: 0;
398
- visibility: hidden;
399
- will-change: opacity, transform;
400
- transition: opacity 150ms ease-out, transform 150ms ease-out, visibility 150ms;
401
- user-select: text;
402
- cursor: text;
403
- }
404
- .devbar-tooltip:hover::after {
405
- opacity: 1;
406
- visibility: visible;
407
- transform: translateX(-50%) scale(1);
408
- pointer-events: auto;
409
- }
410
- .devbar-tooltip-left::after {
411
- left: 8px !important;
412
- right: auto !important;
413
- transform: translateX(0) scale(0.95) !important;
414
- }
415
- .devbar-tooltip-left:hover::after {
416
- transform: translateX(0) scale(1) !important;
417
- }
418
- .devbar-tooltip-right::after {
419
- left: auto !important;
420
- right: 8px !important;
421
- transform: translateX(0) scale(0.95) !important;
422
- }
423
- .devbar-tooltip-right:hover::after {
424
- transform: translateX(0) scale(1) !important;
425
- }
426
- .devbar-capturing .devbar-tooltip::after,
427
- .devbar-capturing .devbar-tooltip:hover::after {
428
- display: none !important;
429
- opacity: 0 !important;
430
- visibility: hidden !important;
431
- }
518
+ /** Animation and utility CSS styles (uses CSS variables for theming) */
519
+ export const DEVBAR_STYLES = `
432
520
  .devbar-item {
433
521
  transition: opacity 150ms ease-out, color 150ms ease-out;
434
522
  }
435
523
  .devbar-item:hover {
436
524
  opacity: 1 !important;
437
- color: ${COLORS.primary};
525
+ color: var(--devbar-color-primary);
438
526
  }
439
527
  .devbar-clickable {
440
528
  transition: transform 150ms ease-out, background-color 150ms ease-out, box-shadow 150ms ease-out;
441
529
  }
442
530
  .devbar-clickable:hover {
443
531
  transform: scale(1.1);
444
- background-color: rgba(16, 185, 129, 0.15);
445
- box-shadow: 0 0 8px ${COLORS.primaryGlow};
532
+ background-color: var(--devbar-color-primary-glow);
533
+ box-shadow: 0 0 8px var(--devbar-color-primary-glow);
446
534
  }
447
535
  .devbar-badge {
448
536
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
@@ -456,9 +544,9 @@ export const TOOLTIP_STYLES = `
456
544
  }
457
545
  .devbar-collapse:hover {
458
546
  transform: scale(1.08);
459
- background-color: rgba(16, 185, 129, 0.15);
460
- box-shadow: 0 0 12px ${COLORS.primaryGlow};
461
- border-color: ${COLORS.primary};
547
+ background-color: var(--devbar-color-primary-glow);
548
+ box-shadow: 0 0 12px var(--devbar-color-primary-glow);
549
+ border-color: var(--devbar-color-primary);
462
550
  }
463
551
  @keyframes pulse {
464
552
  0%, 100% { opacity: 1; }
@@ -468,6 +556,10 @@ export const TOOLTIP_STYLES = `
468
556
  0% { transform: scale(0.8); opacity: 0; }
469
557
  100% { transform: scale(1); opacity: 1; }
470
558
  }
559
+ @keyframes devbar-collapsed-pulse {
560
+ 0%, 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(16, 185, 129, 0.1); }
561
+ 50% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 8px rgba(16, 185, 129, 0.4); }
562
+ }
471
563
  /* Main row - single row by default (SM, MD, LG, XL) */
472
564
  .devbar-main {
473
565
  flex-wrap: nowrap;
@@ -489,7 +581,8 @@ export const TOOLTIP_STYLES = `
489
581
  }
490
582
  /* BASE only (< 640px): fit content, centered horizontally */
491
583
  @media (max-width: 639px) {
492
- [data-devbar] {
584
+ /* Expanded state: center and constrain width */
585
+ [data-devbar]:not(.devbar-collapse) {
493
586
  width: auto !important;
494
587
  min-width: auto !important;
495
588
  max-width: calc(100vw - 32px) !important;
@@ -497,6 +590,7 @@ export const TOOLTIP_STYLES = `
497
590
  right: auto !important;
498
591
  transform: translateX(-50%) !important;
499
592
  }
593
+ /* Collapsed state: JS handles positioning based on captured dot location */
500
594
  .devbar-main {
501
595
  flex-wrap: wrap;
502
596
  justify-content: center;
@@ -517,19 +611,6 @@ export const TOOLTIP_STYLES = `
517
611
  flex-wrap: nowrap;
518
612
  width: 100%;
519
613
  }
520
- /* Constrain tooltips to viewport on mobile */
521
- .devbar-tooltip::after {
522
- left: auto !important;
523
- right: 0 !important;
524
- transform: translateX(0) scale(0.95) !important;
525
- max-width: calc(100vw - 24px) !important;
526
- }
527
- .devbar-tooltip:hover::after {
528
- transform: translateX(0) scale(1) !important;
529
- }
530
- .devbar-tooltip-left::after {
531
- left: 0 !important;
532
- right: auto !important;
533
- }
534
614
  }
535
615
  `;
616
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,oGAAoG;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E,qDAAqD;AACrD,MAAM,CAAC,MA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AK;IACZ,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,MAAM;IACjB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEF,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,wEAAwE;AACxE,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgG5B,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * devbar Debug Utilities
3
+ *
4
+ * Debug logging system for devbar lifecycle, state, and events.
5
+ */
6
+ import type { DebugConfig } from './types.js';
7
+ /**
8
+ * Normalize debug option to DebugConfig
9
+ */
10
+ export declare function normalizeDebugConfig(debug: boolean | DebugConfig | undefined): DebugConfig;
11
+ /**
12
+ * Debug logger for devbar
13
+ */
14
+ export declare class DebugLogger {
15
+ private config;
16
+ private prefix;
17
+ constructor(config: DebugConfig);
18
+ /**
19
+ * Update debug configuration
20
+ */
21
+ setConfig(config: DebugConfig): void;
22
+ /**
23
+ * Log lifecycle events (init, destroy, etc.)
24
+ */
25
+ lifecycle(message: string, data?: unknown): void;
26
+ /**
27
+ * Log state changes (collapse, modal open/close, etc.)
28
+ */
29
+ state(message: string, data?: unknown): void;
30
+ /**
31
+ * Log WebSocket events (connect, disconnect, messages)
32
+ */
33
+ ws(message: string, data?: unknown): void;
34
+ /**
35
+ * Log performance measurements (FCP, LCP, CLS, INP)
36
+ */
37
+ perf(message: string, data?: unknown): void;
38
+ private log;
39
+ }
40
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAoB1F;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,MAAM,CAAc;gBAEhB,MAAM,EAAE,WAAW;IAI/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAIpC;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAMhD;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAM5C;;OAEG;IACH,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAMzC;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAM3C,OAAO,CAAC,GAAG;CA6BZ"}
package/dist/debug.js ADDED
@@ -0,0 +1,94 @@
1
+ /**
2
+ * devbar Debug Utilities
3
+ *
4
+ * Debug logging system for devbar lifecycle, state, and events.
5
+ */
6
+ /**
7
+ * Normalize debug option to DebugConfig
8
+ */
9
+ export function normalizeDebugConfig(debug) {
10
+ if (!debug) {
11
+ return { enabled: false };
12
+ }
13
+ if (debug === true) {
14
+ return {
15
+ enabled: true,
16
+ logLifecycle: true,
17
+ logStateChanges: true,
18
+ logWebSocket: true,
19
+ logPerformance: true,
20
+ };
21
+ }
22
+ return {
23
+ enabled: debug.enabled,
24
+ logLifecycle: debug.logLifecycle ?? true,
25
+ logStateChanges: debug.logStateChanges ?? true,
26
+ logWebSocket: debug.logWebSocket ?? true,
27
+ logPerformance: debug.logPerformance ?? true,
28
+ };
29
+ }
30
+ /**
31
+ * Debug logger for devbar
32
+ */
33
+ export class DebugLogger {
34
+ config;
35
+ prefix = '[devbar]';
36
+ constructor(config) {
37
+ this.config = config;
38
+ }
39
+ /**
40
+ * Update debug configuration
41
+ */
42
+ setConfig(config) {
43
+ this.config = config;
44
+ }
45
+ /**
46
+ * Log lifecycle events (init, destroy, etc.)
47
+ */
48
+ lifecycle(message, data) {
49
+ if (this.config.enabled && this.config.logLifecycle) {
50
+ this.log('lifecycle', message, data);
51
+ }
52
+ }
53
+ /**
54
+ * Log state changes (collapse, modal open/close, etc.)
55
+ */
56
+ state(message, data) {
57
+ if (this.config.enabled && this.config.logStateChanges) {
58
+ this.log('state', message, data);
59
+ }
60
+ }
61
+ /**
62
+ * Log WebSocket events (connect, disconnect, messages)
63
+ */
64
+ ws(message, data) {
65
+ if (this.config.enabled && this.config.logWebSocket) {
66
+ this.log('ws', message, data);
67
+ }
68
+ }
69
+ /**
70
+ * Log performance measurements (FCP, LCP, CLS, INP)
71
+ */
72
+ perf(message, data) {
73
+ if (this.config.enabled && this.config.logPerformance) {
74
+ this.log('perf', message, data);
75
+ }
76
+ }
77
+ log(category, message, data) {
78
+ const timestamp = new Date().toISOString().split('T')[1].slice(0, -1);
79
+ const categoryColors = {
80
+ lifecycle: '#10b981', // emerald
81
+ state: '#3b82f6', // blue
82
+ ws: '#a855f7', // purple
83
+ perf: '#f59e0b', // amber
84
+ };
85
+ const color = categoryColors[category] || '#6b7280';
86
+ if (data !== undefined) {
87
+ console.log(`%c${this.prefix}%c [${category}] %c${timestamp}%c ${message}`, 'color: #10b981; font-weight: bold', `color: ${color}`, 'color: #6b7280', 'color: inherit', data);
88
+ }
89
+ else {
90
+ console.log(`%c${this.prefix}%c [${category}] %c${timestamp}%c ${message}`, 'color: #10b981; font-weight: bold', `color: ${color}`, 'color: #6b7280', 'color: inherit');
91
+ }
92
+ }
93
+ }
94
+ //# sourceMappingURL=debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA;;;;GAIG;A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IAAI,CACL,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CACT,KAAK,IAAI,CAAC,MAAM,OAAO,QAAQ,OAAO,SAAS,MAAM,OAAO,EAAE,EAC9D,mCAAmC,EACnC,UAAU,KAAK,EAAE,EACjB,gBAAgB,EAChB,gBAAgB,CACjB,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -1,34 +1,7 @@
1
1
  /**
2
- * Early Console Capture Script
2
+ * Early Console Capture Script - Re-exported from @ytspar/sweetlink
3
3
  *
4
- * This script captures console logs BEFORE React hydrates, which is critical for
5
- * catching hydration errors and other early-stage issues. It must be injected
6
- * into the HTML <head> as an inline script.
7
- *
8
- * The script creates `window.__sweetlinkEarlyLogs` which GlobalDevBar will pick up
9
- * when it mounts, merging these early logs with subsequent console output.
10
- *
11
- * @example
12
- * ```tsx
13
- * // In your Document component (Remix) or _document.tsx (Next.js)
14
- * import { EARLY_CONSOLE_CAPTURE_SCRIPT } from '@ytspar/devbar';
15
- *
16
- * <head>
17
- * <script dangerouslySetInnerHTML={{ __html: EARLY_CONSOLE_CAPTURE_SCRIPT }} />
18
- * </head>
19
- * ```
20
- */
21
- export declare const EARLY_CONSOLE_CAPTURE_SCRIPT = "\n(function() {\n if (window.__sweetlinkEarlyLogs) return;\n window.__sweetlinkEarlyLogs = [];\n var orig = {\n log: console.log,\n error: console.error,\n warn: console.warn,\n info: console.info\n };\n function formatArg(a) {\n if (a instanceof Error) {\n return a.name + ': ' + a.message + (a.stack ? '\\n' + a.stack : '');\n }\n if (typeof a === 'object' && a !== null) {\n try {\n return JSON.stringify(a, function(key, val) {\n if (val instanceof Error) {\n return val.name + ': ' + val.message;\n }\n return val;\n });\n } catch(e) {\n return String(a);\n }\n }\n return String(a);\n }\n function capture(level, args) {\n window.__sweetlinkEarlyLogs.push({\n level: level,\n message: Array.from(args).map(formatArg).join(' '),\n timestamp: new Date().toISOString()\n });\n }\n console.log = function() { capture('log', arguments); orig.log.apply(console, arguments); };\n console.error = function() { capture('error', arguments); orig.error.apply(console, arguments); };\n console.warn = function() { capture('warn', arguments); orig.warn.apply(console, arguments); };\n console.info = function() { capture('info', arguments); orig.info.apply(console, arguments); };\n // Capture uncaught errors\n window.addEventListener('error', function(e) {\n window.__sweetlinkEarlyLogs.push({\n level: 'error',\n message: 'Uncaught ' + (e.error ? formatArg(e.error) : e.message) + ' at ' + e.filename + ':' + e.lineno + ':' + e.colno,\n timestamp: new Date().toISOString()\n });\n });\n // Capture unhandled promise rejections\n window.addEventListener('unhandledrejection', function(e) {\n window.__sweetlinkEarlyLogs.push({\n level: 'error',\n message: 'Unhandled Promise Rejection: ' + formatArg(e.reason),\n timestamp: new Date().toISOString()\n });\n });\n})();\n";
22
- /**
23
- * Type declaration for the window object with early logs
24
- * Use this to type-check access to early logs in your app
4
+ * @see {@link @ytspar/sweetlink/browser/earlyConsoleCapture}
25
5
  */
26
- declare global {
27
- interface Window {
28
- __sweetlinkEarlyLogs?: Array<{
29
- level: string;
30
- message: string;
31
- timestamp: string;
32
- }>;
33
- }
34
- }
6
+ export { EARLY_CONSOLE_CAPTURE_SCRIPT } from '@ytspar/sweetlink/browser/earlyConsoleCapture';
7
+ //# sourceMappingURL=earlyConsoleCapture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"earlyConsoleCapture.d.ts","sourceRoot":"","sources":["../src/earlyConsoleCapture.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC"}