mdv-live 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +3 -3
- package/bin/mdv.js +140 -57
- package/package.json +4 -4
- package/scripts/setup-macos-app.sh +3 -3
- package/src/api/file.js +140 -111
- package/src/api/pdf.js +24 -27
- package/src/api/tree.js +35 -28
- package/src/api/upload.js +26 -25
- package/src/rendering/index.js +26 -25
- package/src/rendering/markdown.js +27 -40
- package/src/server.js +53 -66
- package/src/static/app.js +107 -140
- package/src/static/index.html +48 -25
- package/src/static/styles.css +95 -169
- package/src/utils/fileTypes.js +99 -90
- package/src/utils/path.js +11 -14
- package/src/watcher.js +38 -48
- package/src/websocket.js +17 -13
package/src/static/styles.css
CHANGED
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
--scrollbar-hover: #585b70;
|
|
21
21
|
--tab-active: #313244;
|
|
22
22
|
--tab-hover: #262637;
|
|
23
|
+
--success: #a6e3a1;
|
|
24
|
+
--warning: #f9e2af;
|
|
25
|
+
--danger: #f38ba8;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
[data-theme="light"] {
|
|
@@ -57,11 +60,35 @@ body {
|
|
|
57
60
|
transition: background 0.2s, color 0.2s;
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
/* Utility Classes */
|
|
64
|
+
.hidden { display: none !important; }
|
|
65
|
+
|
|
60
66
|
.container {
|
|
61
67
|
display: flex;
|
|
62
68
|
height: 100vh;
|
|
63
69
|
}
|
|
64
70
|
|
|
71
|
+
/* ============================================================
|
|
72
|
+
Scrollbar (Shared)
|
|
73
|
+
============================================================ */
|
|
74
|
+
|
|
75
|
+
.file-tree::-webkit-scrollbar { width: 8px; }
|
|
76
|
+
.content::-webkit-scrollbar { width: 10px; }
|
|
77
|
+
.tab-bar::-webkit-scrollbar { height: 4px; }
|
|
78
|
+
|
|
79
|
+
.file-tree::-webkit-scrollbar-track { background: transparent; }
|
|
80
|
+
.content::-webkit-scrollbar-track { background: var(--bg-primary); }
|
|
81
|
+
|
|
82
|
+
.file-tree::-webkit-scrollbar-thumb,
|
|
83
|
+
.content::-webkit-scrollbar-thumb,
|
|
84
|
+
.tab-bar::-webkit-scrollbar-thumb { background: var(--scrollbar); }
|
|
85
|
+
|
|
86
|
+
.file-tree::-webkit-scrollbar-thumb { border-radius: 4px; }
|
|
87
|
+
.content::-webkit-scrollbar-thumb { border-radius: 5px; }
|
|
88
|
+
|
|
89
|
+
.file-tree::-webkit-scrollbar-thumb:hover,
|
|
90
|
+
.content::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
|
|
91
|
+
|
|
65
92
|
/* ============================================================
|
|
66
93
|
Sidebar
|
|
67
94
|
============================================================ */
|
|
@@ -111,11 +138,6 @@ body {
|
|
|
111
138
|
padding: 8px 0;
|
|
112
139
|
}
|
|
113
140
|
|
|
114
|
-
.file-tree::-webkit-scrollbar { width: 8px; }
|
|
115
|
-
.file-tree::-webkit-scrollbar-track { background: transparent; }
|
|
116
|
-
.file-tree::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
|
|
117
|
-
.file-tree::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
|
|
118
|
-
|
|
119
141
|
.tree-item { user-select: none; }
|
|
120
142
|
|
|
121
143
|
.tree-item-content {
|
|
@@ -231,10 +253,10 @@ body {
|
|
|
231
253
|
width: 8px;
|
|
232
254
|
height: 8px;
|
|
233
255
|
border-radius: 50%;
|
|
234
|
-
background:
|
|
256
|
+
background: var(--success);
|
|
235
257
|
}
|
|
236
258
|
|
|
237
|
-
.status-dot.disconnected { background:
|
|
259
|
+
.status-dot.disconnected { background: var(--danger); }
|
|
238
260
|
|
|
239
261
|
.shutdown-btn {
|
|
240
262
|
background: none;
|
|
@@ -258,7 +280,7 @@ body {
|
|
|
258
280
|
}
|
|
259
281
|
|
|
260
282
|
.shutdown-btn:hover {
|
|
261
|
-
color:
|
|
283
|
+
color: var(--danger);
|
|
262
284
|
background: rgba(243, 139, 168, 0.1);
|
|
263
285
|
}
|
|
264
286
|
|
|
@@ -273,12 +295,7 @@ body {
|
|
|
273
295
|
overflow-x: auto;
|
|
274
296
|
}
|
|
275
297
|
|
|
276
|
-
.tab-bar:empty {
|
|
277
|
-
display: none;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.tab-bar::-webkit-scrollbar { height: 4px; }
|
|
281
|
-
.tab-bar::-webkit-scrollbar-thumb { background: var(--scrollbar); }
|
|
298
|
+
.tab-bar:empty { display: none; }
|
|
282
299
|
|
|
283
300
|
.tab {
|
|
284
301
|
display: flex;
|
|
@@ -339,11 +356,6 @@ body {
|
|
|
339
356
|
padding: 32px 48px;
|
|
340
357
|
}
|
|
341
358
|
|
|
342
|
-
.content::-webkit-scrollbar { width: 10px; }
|
|
343
|
-
.content::-webkit-scrollbar-track { background: var(--bg-primary); }
|
|
344
|
-
.content::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 5px; }
|
|
345
|
-
.content::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
|
|
346
|
-
|
|
347
359
|
/* ============================================================
|
|
348
360
|
Markdown Body
|
|
349
361
|
============================================================ */
|
|
@@ -399,13 +411,17 @@ body {
|
|
|
399
411
|
border: 1px solid var(--border);
|
|
400
412
|
}
|
|
401
413
|
|
|
402
|
-
.markdown-body pre code {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
414
|
+
.markdown-body pre code {
|
|
415
|
+
padding: 0;
|
|
416
|
+
margin: 0;
|
|
417
|
+
font-size: 100%;
|
|
418
|
+
background: transparent;
|
|
419
|
+
border-radius: 0;
|
|
420
|
+
white-space: pre;
|
|
407
421
|
}
|
|
408
422
|
|
|
423
|
+
.code-view-container { max-width: 100%; }
|
|
424
|
+
|
|
409
425
|
.markdown-body table { margin-bottom: 16px; border-collapse: collapse; width: 100%; }
|
|
410
426
|
.markdown-body table th, .markdown-body table td { padding: 8px 16px; border: 1px solid var(--border); }
|
|
411
427
|
.markdown-body table th { background: var(--bg-secondary); font-weight: 600; }
|
|
@@ -413,11 +429,12 @@ body {
|
|
|
413
429
|
.markdown-body hr { height: 1px; margin: 24px 0; background: var(--border); border: 0; }
|
|
414
430
|
.markdown-body img { max-width: 100%; border-radius: 8px; }
|
|
415
431
|
|
|
416
|
-
/* Task List
|
|
432
|
+
/* Task List */
|
|
417
433
|
.markdown-body .task-list-item {
|
|
418
434
|
list-style-type: none;
|
|
419
435
|
margin-left: -1.5em;
|
|
420
436
|
}
|
|
437
|
+
|
|
421
438
|
.markdown-body .task-list-item input[type="checkbox"] {
|
|
422
439
|
margin-right: 0.5em;
|
|
423
440
|
vertical-align: middle;
|
|
@@ -439,10 +456,13 @@ body {
|
|
|
439
456
|
}
|
|
440
457
|
|
|
441
458
|
/* ============================================================
|
|
442
|
-
Image
|
|
459
|
+
Media Preview (Image, Video, Audio, Binary)
|
|
443
460
|
============================================================ */
|
|
444
461
|
|
|
445
|
-
.image-preview
|
|
462
|
+
.image-preview,
|
|
463
|
+
.video-preview,
|
|
464
|
+
.audio-preview,
|
|
465
|
+
.binary-preview {
|
|
446
466
|
display: flex;
|
|
447
467
|
flex-direction: column;
|
|
448
468
|
align-items: center;
|
|
@@ -450,17 +470,28 @@ body {
|
|
|
450
470
|
padding: 32px;
|
|
451
471
|
}
|
|
452
472
|
|
|
453
|
-
.
|
|
473
|
+
.binary-preview {
|
|
474
|
+
justify-content: center;
|
|
475
|
+
padding: 48px;
|
|
476
|
+
height: 100%;
|
|
477
|
+
color: var(--text-muted);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.image-preview img,
|
|
481
|
+
.video-preview video {
|
|
454
482
|
max-width: 100%;
|
|
455
483
|
max-height: 70vh;
|
|
456
484
|
border-radius: 8px;
|
|
457
485
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
458
486
|
}
|
|
459
487
|
|
|
460
|
-
.
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
488
|
+
.audio-preview audio { width: 100%; max-width: 500px; }
|
|
489
|
+
|
|
490
|
+
.image-preview .image-info,
|
|
491
|
+
.media-info { font-size: 13px; color: var(--text-muted); }
|
|
492
|
+
|
|
493
|
+
.binary-icon svg { width: 64px; height: 64px; }
|
|
494
|
+
.binary-info { font-size: 16px; }
|
|
464
495
|
|
|
465
496
|
/* ============================================================
|
|
466
497
|
PDF Viewer
|
|
@@ -527,13 +558,8 @@ body {
|
|
|
527
558
|
color: var(--text-muted);
|
|
528
559
|
}
|
|
529
560
|
|
|
530
|
-
.editor-status.modified {
|
|
531
|
-
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
.editor-status.saved {
|
|
535
|
-
color: #a6e3a1;
|
|
536
|
-
}
|
|
561
|
+
.editor-status.modified { color: var(--warning); }
|
|
562
|
+
.editor-status.saved { color: var(--success); }
|
|
537
563
|
|
|
538
564
|
/* ============================================================
|
|
539
565
|
File Icons
|
|
@@ -595,7 +621,6 @@ body {
|
|
|
595
621
|
z-index: 1000;
|
|
596
622
|
padding: 4px 0;
|
|
597
623
|
}
|
|
598
|
-
.context-menu.hidden { display: none; }
|
|
599
624
|
.context-menu-item {
|
|
600
625
|
display: flex;
|
|
601
626
|
align-items: center;
|
|
@@ -609,7 +634,7 @@ body {
|
|
|
609
634
|
background: var(--bg-tertiary);
|
|
610
635
|
color: var(--text-primary);
|
|
611
636
|
}
|
|
612
|
-
.context-menu-item.danger { color:
|
|
637
|
+
.context-menu-item.danger { color: var(--danger); }
|
|
613
638
|
.context-menu-item.danger:hover { background: rgba(243, 139, 168, 0.1); }
|
|
614
639
|
.context-menu-separator {
|
|
615
640
|
height: 1px;
|
|
@@ -618,10 +643,11 @@ body {
|
|
|
618
643
|
}
|
|
619
644
|
|
|
620
645
|
/* ============================================================
|
|
621
|
-
Dialog
|
|
646
|
+
Dialog & Overlay (Shared)
|
|
622
647
|
============================================================ */
|
|
623
648
|
|
|
624
|
-
.dialog-overlay
|
|
649
|
+
.dialog-overlay,
|
|
650
|
+
.upload-progress-overlay {
|
|
625
651
|
position: fixed;
|
|
626
652
|
top: 0; left: 0; right: 0; bottom: 0;
|
|
627
653
|
background: rgba(0, 0, 0, 0.5);
|
|
@@ -630,7 +656,7 @@ body {
|
|
|
630
656
|
justify-content: center;
|
|
631
657
|
z-index: 2000;
|
|
632
658
|
}
|
|
633
|
-
|
|
659
|
+
|
|
634
660
|
.dialog-content {
|
|
635
661
|
background: var(--bg-secondary);
|
|
636
662
|
padding: 24px;
|
|
@@ -654,6 +680,10 @@ body {
|
|
|
654
680
|
outline: none;
|
|
655
681
|
}
|
|
656
682
|
.dialog-content input:focus { border-color: var(--accent); }
|
|
683
|
+
.dialog-content p {
|
|
684
|
+
margin: 0;
|
|
685
|
+
color: var(--text-secondary);
|
|
686
|
+
}
|
|
657
687
|
.dialog-actions {
|
|
658
688
|
display: flex;
|
|
659
689
|
justify-content: flex-end;
|
|
@@ -671,7 +701,7 @@ body {
|
|
|
671
701
|
.btn-cancel:hover { background: var(--border); }
|
|
672
702
|
.btn-confirm { background: var(--accent); color: white; }
|
|
673
703
|
.btn-confirm:hover { opacity: 0.9; }
|
|
674
|
-
.btn-danger { background:
|
|
704
|
+
.btn-danger { background: var(--danger); color: white; }
|
|
675
705
|
.btn-danger:hover { opacity: 0.9; }
|
|
676
706
|
|
|
677
707
|
/* ============================================================
|
|
@@ -688,56 +718,10 @@ body {
|
|
|
688
718
|
border-radius: 8px;
|
|
689
719
|
}
|
|
690
720
|
|
|
691
|
-
/* ============================================================
|
|
692
|
-
Video/Audio Preview
|
|
693
|
-
============================================================ */
|
|
694
|
-
|
|
695
|
-
.video-preview, .audio-preview {
|
|
696
|
-
display: flex;
|
|
697
|
-
flex-direction: column;
|
|
698
|
-
align-items: center;
|
|
699
|
-
gap: 16px;
|
|
700
|
-
padding: 32px;
|
|
701
|
-
}
|
|
702
|
-
.video-preview video {
|
|
703
|
-
max-width: 100%;
|
|
704
|
-
max-height: 70vh;
|
|
705
|
-
border-radius: 8px;
|
|
706
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
707
|
-
}
|
|
708
|
-
.audio-preview audio { width: 100%; max-width: 500px; }
|
|
709
|
-
.media-info { font-size: 13px; color: var(--text-muted); }
|
|
710
|
-
|
|
711
|
-
.binary-preview {
|
|
712
|
-
display: flex;
|
|
713
|
-
flex-direction: column;
|
|
714
|
-
align-items: center;
|
|
715
|
-
justify-content: center;
|
|
716
|
-
gap: 16px;
|
|
717
|
-
padding: 48px;
|
|
718
|
-
height: 100%;
|
|
719
|
-
color: var(--text-muted);
|
|
720
|
-
}
|
|
721
|
-
.binary-icon svg {
|
|
722
|
-
width: 64px;
|
|
723
|
-
height: 64px;
|
|
724
|
-
}
|
|
725
|
-
.binary-info { font-size: 16px; }
|
|
726
|
-
|
|
727
721
|
/* ============================================================
|
|
728
722
|
Upload Progress
|
|
729
723
|
============================================================ */
|
|
730
724
|
|
|
731
|
-
.upload-progress-overlay {
|
|
732
|
-
position: fixed;
|
|
733
|
-
top: 0; left: 0; right: 0; bottom: 0;
|
|
734
|
-
background: rgba(0, 0, 0, 0.5);
|
|
735
|
-
display: flex;
|
|
736
|
-
align-items: center;
|
|
737
|
-
justify-content: center;
|
|
738
|
-
z-index: 2000;
|
|
739
|
-
}
|
|
740
|
-
.upload-progress-overlay.hidden { display: none; }
|
|
741
725
|
.upload-progress-box {
|
|
742
726
|
background: var(--bg-secondary);
|
|
743
727
|
padding: 24px 32px;
|
|
@@ -764,13 +748,9 @@ body {
|
|
|
764
748
|
============================================================ */
|
|
765
749
|
|
|
766
750
|
@media print {
|
|
767
|
-
@page {
|
|
768
|
-
margin: 15mm;
|
|
769
|
-
}
|
|
751
|
+
@page { margin: 15mm; }
|
|
770
752
|
|
|
771
|
-
* {
|
|
772
|
-
box-sizing: border-box !important;
|
|
773
|
-
}
|
|
753
|
+
* { box-sizing: border-box !important; }
|
|
774
754
|
|
|
775
755
|
html, body {
|
|
776
756
|
width: 100% !important;
|
|
@@ -787,7 +767,7 @@ body {
|
|
|
787
767
|
color: black !important;
|
|
788
768
|
}
|
|
789
769
|
|
|
790
|
-
.container {
|
|
770
|
+
.container, .main, .content {
|
|
791
771
|
height: auto !important;
|
|
792
772
|
overflow: visible !important;
|
|
793
773
|
display: block !important;
|
|
@@ -795,33 +775,10 @@ body {
|
|
|
795
775
|
padding: 0 !important;
|
|
796
776
|
}
|
|
797
777
|
|
|
798
|
-
.main {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
display: block !important;
|
|
803
|
-
padding: 0 !important;
|
|
804
|
-
margin: 0 !important;
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
.content {
|
|
808
|
-
height: auto !important;
|
|
809
|
-
overflow: visible !important;
|
|
810
|
-
flex: none !important;
|
|
811
|
-
padding: 0 !important;
|
|
812
|
-
margin: 0 !important;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
.markdown-body {
|
|
816
|
-
max-width: 100% !important;
|
|
817
|
-
padding: 0 !important;
|
|
818
|
-
margin: 0 !important;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
.markdown-body img {
|
|
822
|
-
max-width: 100% !important;
|
|
823
|
-
}
|
|
824
|
-
|
|
778
|
+
.main { width: 100% !important; }
|
|
779
|
+
.content { flex: none !important; }
|
|
780
|
+
.markdown-body { max-width: 100% !important; }
|
|
781
|
+
.markdown-body img { max-width: 100% !important; }
|
|
825
782
|
.markdown-body code { background: #f0f0f0 !important; }
|
|
826
783
|
.markdown-body pre { background: #f8f8f8 !important; border: 1px solid #ddd !important; }
|
|
827
784
|
|
|
@@ -829,6 +786,7 @@ body {
|
|
|
829
786
|
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
|
|
830
787
|
page-break-after: avoid;
|
|
831
788
|
}
|
|
789
|
+
|
|
832
790
|
.markdown-body pre, .markdown-body table, .markdown-body img,
|
|
833
791
|
.markdown-body ul, .markdown-body ol, .markdown-body li, .markdown-body p {
|
|
834
792
|
page-break-inside: avoid;
|
|
@@ -889,40 +847,19 @@ body {
|
|
|
889
847
|
margin-bottom: 12px;
|
|
890
848
|
}
|
|
891
849
|
|
|
892
|
-
.marp-slide p
|
|
850
|
+
.marp-slide p,
|
|
851
|
+
.marp-slide ul,
|
|
852
|
+
.marp-slide ol {
|
|
893
853
|
font-size: 1.25em;
|
|
894
854
|
line-height: 1.6;
|
|
895
855
|
margin-bottom: 16px;
|
|
896
856
|
}
|
|
897
857
|
|
|
898
|
-
.marp-slide
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
.marp-slide li {
|
|
905
|
-
margin-bottom: 8px;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
.marp-slide pre {
|
|
909
|
-
font-size: 0.9em;
|
|
910
|
-
max-width: 100%;
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
.marp-slide code {
|
|
914
|
-
font-size: 0.95em;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
.marp-slide img {
|
|
918
|
-
max-width: 100%;
|
|
919
|
-
max-height: 60vh;
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
/* Mermaid in slides */
|
|
923
|
-
.marp-slide .mermaid {
|
|
924
|
-
margin: 16px 0;
|
|
925
|
-
}
|
|
858
|
+
.marp-slide li { margin-bottom: 8px; }
|
|
859
|
+
.marp-slide pre { font-size: 0.9em; max-width: 100%; }
|
|
860
|
+
.marp-slide code { font-size: 0.95em; }
|
|
861
|
+
.marp-slide img { max-width: 100%; max-height: 60vh; }
|
|
862
|
+
.marp-slide .mermaid { margin: 16px 0; }
|
|
926
863
|
|
|
927
864
|
/* Navigation Controls */
|
|
928
865
|
.marp-nav {
|
|
@@ -965,10 +902,7 @@ body {
|
|
|
965
902
|
cursor: not-allowed;
|
|
966
903
|
}
|
|
967
904
|
|
|
968
|
-
.marp-nav button svg {
|
|
969
|
-
width: 16px;
|
|
970
|
-
height: 16px;
|
|
971
|
-
}
|
|
905
|
+
.marp-nav button svg { width: 16px; height: 16px; }
|
|
972
906
|
|
|
973
907
|
.marp-nav .slide-counter {
|
|
974
908
|
font-size: 13px;
|
|
@@ -977,7 +911,6 @@ body {
|
|
|
977
911
|
text-align: center;
|
|
978
912
|
}
|
|
979
913
|
|
|
980
|
-
/* Keyboard hint */
|
|
981
914
|
.marp-nav .keyboard-hint {
|
|
982
915
|
font-size: 11px;
|
|
983
916
|
color: var(--text-muted);
|
|
@@ -1004,14 +937,9 @@ body {
|
|
|
1004
937
|
page-break-inside: avoid;
|
|
1005
938
|
}
|
|
1006
939
|
|
|
1007
|
-
.marpit > svg[data-marpit-svg]:last-child {
|
|
1008
|
-
page-break-after: avoid;
|
|
1009
|
-
}
|
|
940
|
+
.marpit > svg[data-marpit-svg]:last-child { page-break-after: avoid; }
|
|
1010
941
|
|
|
1011
|
-
|
|
1012
|
-
.marp-presentation {
|
|
1013
|
-
height: auto !important;
|
|
1014
|
-
}
|
|
942
|
+
.marp-presentation { height: auto !important; }
|
|
1015
943
|
|
|
1016
944
|
.marp-slide {
|
|
1017
945
|
display: block !important;
|
|
@@ -1020,7 +948,5 @@ body {
|
|
|
1020
948
|
min-height: 100vh;
|
|
1021
949
|
}
|
|
1022
950
|
|
|
1023
|
-
.marp-slide:last-child {
|
|
1024
|
-
page-break-after: avoid;
|
|
1025
|
-
}
|
|
951
|
+
.marp-slide:last-child { page-break-after: avoid; }
|
|
1026
952
|
}
|