fixdog 0.0.1

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.
@@ -0,0 +1,597 @@
1
+ // This file exports the CSS content as a string for shadow DOM injection
2
+ const sidebarStyles = `/* UiDog Sidebar Styles */
3
+
4
+ /* Overlay */
5
+ .uidog-sidebar-overlay {
6
+ position: fixed;
7
+ top: 0;
8
+ right: 0;
9
+ bottom: 0;
10
+ left: 0;
11
+ z-index: 999999;
12
+ pointer-events: none;
13
+ }
14
+
15
+ /* Main Sidebar Container */
16
+ .uidog-sidebar {
17
+ position: fixed;
18
+ right: 0;
19
+ top: 0;
20
+ width: 420px;
21
+ max-width: 100vw;
22
+ height: 100vh;
23
+ background: #13140a;
24
+ box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
25
+ display: flex;
26
+ flex-direction: column;
27
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
28
+ font-size: 14px;
29
+ color: #ffffff;
30
+ pointer-events: auto;
31
+ animation: uidog-slide-in 0.3s ease-out;
32
+ overflow: hidden;
33
+ border-left: 1px solid rgba(255, 255, 255, 0.1);
34
+ }
35
+
36
+ @keyframes uidog-slide-in {
37
+ from {
38
+ transform: translateX(100%);
39
+ }
40
+ to {
41
+ transform: translateX(0);
42
+ }
43
+ }
44
+
45
+ /* Header */
46
+ .uidog-sidebar-header {
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: flex-end;
50
+ padding: 20px 24px;
51
+ border-bottom: 1px solid rgba(255, 255, 255, 0.15);
52
+ background: rgba(0, 0, 0, 0.3);
53
+ flex-shrink: 0;
54
+ }
55
+
56
+ .uidog-sidebar-title {
57
+ margin: 0;
58
+ font-size: 18px;
59
+ font-weight: 600;
60
+ color: #ffffff;
61
+ letter-spacing: -0.01em;
62
+ }
63
+
64
+ .uidog-close-btn {
65
+ width: 32px;
66
+ height: 32px;
67
+ border: none;
68
+ background: transparent;
69
+ font-size: 28px;
70
+ line-height: 1;
71
+ color: rgba(255, 255, 255, 0.7);
72
+ cursor: pointer;
73
+ border-radius: 4px;
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ transition: all 0.2s;
78
+ flex-shrink: 0;
79
+ margin-left: 12px;
80
+ }
81
+
82
+ .uidog-close-btn:hover {
83
+ background: rgba(255, 255, 255, 0.1);
84
+ color: #ffffff;
85
+ }
86
+
87
+ /* Content Area */
88
+ .uidog-sidebar-content {
89
+ flex: 1;
90
+ overflow-y: auto;
91
+ overflow-x: hidden;
92
+ padding: 24px;
93
+ scrollbar-width: thin;
94
+ scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
95
+ }
96
+
97
+ .uidog-sidebar-content::-webkit-scrollbar {
98
+ width: 8px;
99
+ }
100
+
101
+ .uidog-sidebar-content::-webkit-scrollbar-track {
102
+ background: transparent;
103
+ }
104
+
105
+ .uidog-sidebar-content::-webkit-scrollbar-thumb {
106
+ background: rgba(255, 255, 255, 0.2);
107
+ border-radius: 4px;
108
+ }
109
+
110
+ .uidog-sidebar-content::-webkit-scrollbar-thumb:hover {
111
+ background: rgba(255, 255, 255, 0.3);
112
+ }
113
+
114
+ /* Element Info Section */
115
+ .uidog-element-info-section {
116
+ padding: 20px 24px;
117
+ border-bottom: 1px solid rgba(255, 255, 255, 0.15);
118
+ flex-shrink: 0;
119
+ background: rgba(0, 0, 0, 0.2);
120
+ margin-top: 0;
121
+ padding-top: 20px;
122
+ }
123
+
124
+ /* Element Info Section */
125
+ .uidog-element-info {
126
+ margin-bottom: 0;
127
+ }
128
+
129
+ .uidog-element-info-header {
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: space-between;
133
+ margin-bottom: 12px;
134
+ }
135
+
136
+ .uidog-element-info-title {
137
+ margin: 0;
138
+ font-size: 14px;
139
+ font-weight: 600;
140
+ color: rgba(255, 255, 255, 0.9);
141
+ text-transform: uppercase;
142
+ letter-spacing: 0.05em;
143
+ }
144
+
145
+ .uidog-toggle-view-btn {
146
+ padding: 6px 14px;
147
+ font-size: 12px;
148
+ border: 1px solid rgba(255, 255, 255, 0.2);
149
+ background: rgba(255, 255, 255, 0.1);
150
+ color: #ffffff;
151
+ border-radius: 6px;
152
+ cursor: pointer;
153
+ transition: all 0.2s;
154
+ font-weight: 500;
155
+ }
156
+
157
+ .uidog-toggle-view-btn:hover {
158
+ background: rgba(255, 255, 255, 0.2);
159
+ border-color: rgba(255, 255, 255, 0.3);
160
+ }
161
+
162
+ .uidog-element-info-content {
163
+ background: rgba(0, 0, 0, 0.3);
164
+ border: 1px solid rgba(255, 255, 255, 0.15);
165
+ border-radius: 8px;
166
+ padding: 16px;
167
+ display: flex;
168
+ align-items: center;
169
+ justify-content: space-between;
170
+ position: relative;
171
+ }
172
+
173
+ .uidog-file-location {
174
+ font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
175
+ font-size: 13px;
176
+ color: #ffffff;
177
+ word-break: break-word;
178
+ }
179
+
180
+ .uidog-info-row {
181
+ display: flex;
182
+ margin-bottom: 12px;
183
+ line-height: 1.6;
184
+ }
185
+
186
+ .uidog-info-row:last-of-type {
187
+ margin-bottom: 0;
188
+ }
189
+
190
+ .uidog-info-row:last-child {
191
+ margin-bottom: 0;
192
+ }
193
+
194
+ .uidog-info-label {
195
+ flex-shrink: 0;
196
+ width: 100px;
197
+ font-weight: 500;
198
+ color: rgba(255, 255, 255, 0.75);
199
+ font-size: 13px;
200
+ }
201
+
202
+ .uidog-info-value {
203
+ flex: 1;
204
+ color: #ffffff;
205
+ word-break: break-word;
206
+ font-size: 13px;
207
+ }
208
+
209
+ .uidog-component-name {
210
+ font-weight: 600;
211
+ color: #60a5fa;
212
+ }
213
+
214
+ .uidog-file-path {
215
+ font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
216
+ font-size: 12px;
217
+ }
218
+
219
+ .uidog-dom-snapshot {
220
+ margin-top: 16px;
221
+ background: rgba(255, 255, 255, 0.03);
222
+ border: 1px solid rgba(255, 255, 255, 0.08);
223
+ border-radius: 8px;
224
+ padding: 12px;
225
+ display: flex;
226
+ flex-direction: column;
227
+ gap: 8px;
228
+ }
229
+
230
+ .uidog-dom-label {
231
+ color: rgba(255, 255, 255, 0.7);
232
+ font-size: 12px;
233
+ text-transform: uppercase;
234
+ letter-spacing: 0.05em;
235
+ }
236
+
237
+ .uidog-dom-snippet {
238
+ margin: 0;
239
+ background: rgba(0, 0, 0, 0.4);
240
+ border: 1px solid rgba(255, 255, 255, 0.08);
241
+ border-radius: 6px;
242
+ padding: 10px;
243
+ color: rgba(255, 255, 255, 0.85);
244
+ font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
245
+ font-size: 12px;
246
+ white-space: pre-wrap;
247
+ word-break: break-word;
248
+ }
249
+
250
+ .uidog-dom-attributes ul {
251
+ margin: 6px 0 0 0;
252
+ padding-left: 16px;
253
+ color: rgba(255, 255, 255, 0.85);
254
+ font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
255
+ font-size: 12px;
256
+ word-break: break-word;
257
+ }
258
+
259
+ .uidog-dom-attributes code {
260
+ background: rgba(255, 255, 255, 0.08);
261
+ padding: 2px 4px;
262
+ border-radius: 4px;
263
+ }
264
+
265
+ .uidog-dom-hint {
266
+ color: rgba(255, 255, 255, 0.6);
267
+ font-size: 12px;
268
+ line-height: 1.5;
269
+ }
270
+
271
+ .uidog-mono {
272
+ font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
273
+ font-size: 12px;
274
+ }
275
+
276
+ .uidog-detailed-section {
277
+ margin-top: 12px;
278
+ padding-top: 12px;
279
+ border-top: 1px solid rgba(255, 255, 255, 0.1);
280
+ }
281
+
282
+ .uidog-code-preview {
283
+ flex-direction: column;
284
+ }
285
+
286
+ .uidog-code-placeholder {
287
+ margin-top: 6px;
288
+ padding: 8px;
289
+ background: rgba(0, 0, 0, 0.3);
290
+ color: rgba(255, 255, 255, 0.8);
291
+ border-radius: 4px;
292
+ font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
293
+ font-size: 12px;
294
+ white-space: pre-wrap;
295
+ word-break: break-word;
296
+ }
297
+
298
+ /* Chat Container */
299
+ .uidog-chat-container {
300
+ flex: 1;
301
+ display: flex;
302
+ flex-direction: column;
303
+ overflow: hidden;
304
+ min-height: 0;
305
+ }
306
+
307
+ /* Messages Container */
308
+ .uidog-messages-container {
309
+ flex: 1;
310
+ overflow-y: auto;
311
+ overflow-x: hidden;
312
+ padding: 20px 24px;
313
+ scrollbar-width: thin;
314
+ scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
315
+ }
316
+
317
+ .uidog-dom-banner {
318
+ margin-bottom: 12px;
319
+ padding: 12px 14px;
320
+ background: rgba(255, 255, 255, 0.08);
321
+ border: 1px solid rgba(255, 255, 255, 0.15);
322
+ border-radius: 8px;
323
+ color: rgba(255, 255, 255, 0.85);
324
+ font-size: 13px;
325
+ line-height: 1.5;
326
+ }
327
+
328
+ .uidog-messages-container::-webkit-scrollbar {
329
+ width: 8px;
330
+ }
331
+
332
+ .uidog-messages-container::-webkit-scrollbar-track {
333
+ background: transparent;
334
+ }
335
+
336
+ .uidog-messages-container::-webkit-scrollbar-thumb {
337
+ background: rgba(255, 255, 255, 0.2);
338
+ border-radius: 4px;
339
+ }
340
+
341
+ .uidog-messages-container::-webkit-scrollbar-thumb:hover {
342
+ background: rgba(255, 255, 255, 0.3);
343
+ }
344
+
345
+ /* Empty State */
346
+ .uidog-empty-state {
347
+ display: flex;
348
+ align-items: center;
349
+ justify-content: center;
350
+ height: 100%;
351
+ min-height: 200px;
352
+ }
353
+
354
+ .uidog-empty-state-text {
355
+ color: rgba(255, 255, 255, 0.6);
356
+ font-size: 14px;
357
+ text-align: center;
358
+ }
359
+
360
+ /* Messages */
361
+ .uidog-message {
362
+ margin-bottom: 16px;
363
+ display: flex;
364
+ animation: uidog-message-fade-in 0.2s ease-out;
365
+ }
366
+
367
+ @keyframes uidog-message-fade-in {
368
+ from {
369
+ opacity: 0;
370
+ transform: translateY(4px);
371
+ }
372
+ to {
373
+ opacity: 1;
374
+ transform: translateY(0);
375
+ }
376
+ }
377
+
378
+ .uidog-message-user {
379
+ justify-content: flex-end;
380
+ }
381
+
382
+ .uidog-message-assistant {
383
+ justify-content: flex-start;
384
+ }
385
+
386
+ /* Message Bubbles */
387
+ .uidog-message-bubble {
388
+ max-width: 80%;
389
+ padding: 12px 16px;
390
+ border-radius: 12px;
391
+ word-wrap: break-word;
392
+ overflow-wrap: break-word;
393
+ }
394
+
395
+ .uidog-message-user .uidog-message-bubble {
396
+ background: rgba(59, 130, 246, 0.2);
397
+ border: 1px solid rgba(59, 130, 246, 0.3);
398
+ color: #93c5fd;
399
+ }
400
+
401
+ .uidog-message-assistant .uidog-message-bubble {
402
+ background: rgba(255, 255, 255, 0.08);
403
+ border: 1px solid rgba(255, 255, 255, 0.15);
404
+ color: rgba(255, 255, 255, 0.9);
405
+ }
406
+
407
+ .uidog-message-content {
408
+ line-height: 1.6;
409
+ white-space: pre-wrap;
410
+ word-break: break-word;
411
+ font-size: 14px;
412
+ }
413
+
414
+ .uidog-message-content.uidog-message-error {
415
+ color: #fca5a5;
416
+ }
417
+
418
+ /* Loading Message */
419
+ .uidog-message-loading {
420
+ display: flex;
421
+ align-items: center;
422
+ gap: 10px;
423
+ color: rgba(255, 255, 255, 0.7);
424
+ font-size: 14px;
425
+ }
426
+
427
+ .uidog-spinner {
428
+ width: 16px;
429
+ height: 16px;
430
+ border: 2px solid rgba(255, 255, 255, 0.2);
431
+ border-top-color: rgba(255, 255, 255, 0.8);
432
+ border-radius: 50%;
433
+ animation: uidog-spin 0.8s linear infinite;
434
+ }
435
+
436
+ .uidog-spinner-small {
437
+ width: 14px;
438
+ height: 14px;
439
+ border: 2px solid rgba(255, 255, 255, 0.3);
440
+ border-top-color: #ffffff;
441
+ border-radius: 50%;
442
+ animation: uidog-spin 0.8s linear infinite;
443
+ }
444
+
445
+ @keyframes uidog-spin {
446
+ to {
447
+ transform: rotate(360deg);
448
+ }
449
+ }
450
+
451
+ /* Fixed Input Footer */
452
+ .uidog-input-footer-fixed {
453
+ flex-shrink: 0;
454
+ padding: 16px 24px;
455
+ border-top: 1px solid rgba(255, 255, 255, 0.15);
456
+ background: rgba(0, 0, 0, 0.3);
457
+ }
458
+
459
+ .uidog-input-wrapper {
460
+ position: relative;
461
+ margin-bottom: 8px;
462
+ }
463
+
464
+ .uidog-textarea {
465
+ width: 100%;
466
+ padding: 10px 60px 10px 14px;
467
+ border: 1px solid rgba(255, 255, 255, 0.2);
468
+ border-radius: 8px;
469
+ font-family: inherit;
470
+ font-size: 14px;
471
+ line-height: 1.5;
472
+ resize: none;
473
+ min-height: 44px;
474
+ max-height: 200px;
475
+ background: rgba(0, 0, 0, 0.4);
476
+ color: #ffffff;
477
+ transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
478
+ box-sizing: border-box;
479
+ overflow-wrap: break-word;
480
+ word-wrap: break-word;
481
+ overflow-y: auto;
482
+ }
483
+
484
+ .uidog-textarea::placeholder {
485
+ color: rgba(255, 255, 255, 0.5);
486
+ }
487
+
488
+ .uidog-textarea:focus {
489
+ outline: none;
490
+ border-color: #60a5fa;
491
+ background: rgba(0, 0, 0, 0.5);
492
+ box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
493
+ }
494
+
495
+ .uidog-textarea:disabled {
496
+ background: rgba(0, 0, 0, 0.2);
497
+ color: rgba(255, 255, 255, 0.5);
498
+ cursor: not-allowed;
499
+ }
500
+
501
+ .uidog-submit-btn {
502
+ position: absolute;
503
+ bottom: 10px;
504
+ right: 6px;
505
+ width: 32px;
506
+ height: 32px;
507
+ display: flex;
508
+ align-items: center;
509
+ justify-content: center;
510
+ padding: 0;
511
+ font-size: 14px;
512
+ font-weight: 500;
513
+ color: #ffffff;
514
+ background: #3b82f6;
515
+ border: none;
516
+ border-radius: 6px;
517
+ cursor: pointer;
518
+ transition: all 0.2s;
519
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
520
+ }
521
+
522
+ .uidog-submit-btn:active {
523
+ transform: translateY(1px);
524
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
525
+ }
526
+
527
+ .uidog-submit-btn:hover:not(:disabled) {
528
+ background: #2563eb;
529
+ }
530
+
531
+ .uidog-submit-btn:disabled {
532
+ background: rgba(255, 255, 255, 0.1);
533
+ color: rgba(255, 255, 255, 0.3);
534
+ cursor: not-allowed;
535
+ }
536
+
537
+ .uidog-submit-btn svg {
538
+ stroke: currentColor;
539
+ }
540
+
541
+ .uidog-input-hint {
542
+ font-size: 11px;
543
+ color: rgba(255, 255, 255, 0.5);
544
+ text-align: center;
545
+ margin-top: 4px;
546
+ }
547
+
548
+ .uidog-retry-btn {
549
+ margin-top: 8px;
550
+ padding: 6px 12px;
551
+ font-size: 12px;
552
+ font-weight: 500;
553
+ color: #ffffff;
554
+ background: #ef4444;
555
+ border: none;
556
+ border-radius: 6px;
557
+ cursor: pointer;
558
+ transition: background 0.2s;
559
+ }
560
+
561
+ .uidog-retry-btn:hover {
562
+ background: #dc2626;
563
+ }
564
+
565
+ /* Footer */
566
+ .uidog-sidebar-footer {
567
+ padding: 16px 24px;
568
+ border-top: 1px solid rgba(255, 255, 255, 0.15);
569
+ background: rgba(0, 0, 0, 0.3);
570
+ text-align: center;
571
+ flex-shrink: 0;
572
+ }
573
+
574
+ .uidog-footer-text {
575
+ font-size: 12px;
576
+ color: rgba(255, 255, 255, 0.7);
577
+ }
578
+
579
+ .uidog-footer-link {
580
+ color: #60a5fa;
581
+ text-decoration: none;
582
+ font-weight: 500;
583
+ }
584
+
585
+ .uidog-footer-link:hover {
586
+ text-decoration: underline;
587
+ color: #93c5fd;
588
+ }
589
+
590
+ /* Mobile Responsive */
591
+ @media (max-width: 768px) {
592
+ .uidog-sidebar {
593
+ width: 100vw;
594
+ }
595
+ }`;
596
+
597
+ export default sidebarStyles;
@@ -0,0 +1,9 @@
1
+ declare module "*.css" {
2
+ const content: string;
3
+ export default content;
4
+ }
5
+
6
+ declare module "*.css?inline" {
7
+ const content: string;
8
+ export default content;
9
+ }
@@ -0,0 +1,56 @@
1
+ export interface ElementInfo {
2
+ componentName: string;
3
+ filePath: string;
4
+ line: number;
5
+ column: number;
6
+ box?: {
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ };
12
+ code?: string;
13
+ }
14
+
15
+ export interface SidebarState {
16
+ isOpen: boolean;
17
+ elementInfo: ElementInfo | null;
18
+ editorUrl: string | null;
19
+ }
20
+
21
+ export type ViewMode = "minimal" | "detailed";
22
+
23
+ export interface ApiConfig {
24
+ endpoint: string;
25
+ timeout?: number;
26
+ }
27
+
28
+ export interface UiDogSidebarEvent {
29
+ editorUrl: string;
30
+ linkProps?: {
31
+ filePath: string;
32
+ projectPath: string;
33
+ line: number;
34
+ column: number;
35
+ };
36
+ }
37
+
38
+ declare global {
39
+ interface Window {
40
+ __UIDOG_SIDEBAR__?: {
41
+ isOpen: boolean;
42
+ currentElement: any;
43
+ editorUrl: string | null;
44
+ };
45
+ __UIDOG_LAST_ELEMENT__?: {
46
+ filePath: string;
47
+ projectPath: string;
48
+ line: number;
49
+ column: number;
50
+ };
51
+ }
52
+
53
+ interface WindowEventMap {
54
+ "uidog:open-sidebar": CustomEvent<UiDogSidebarEvent>;
55
+ }
56
+ }