reviw 0.9.2 → 0.10.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.
- package/cli.cjs +149 -0
- package/package.json +6 -6
package/cli.cjs
CHANGED
|
@@ -839,6 +839,18 @@ function diffHtmlTemplate(diffData) {
|
|
|
839
839
|
z-index: 100;
|
|
840
840
|
}
|
|
841
841
|
.modal-overlay.visible { display: flex; }
|
|
842
|
+
/* Submit modal: top-right position, no blocking overlay */
|
|
843
|
+
#submit-modal {
|
|
844
|
+
background: transparent;
|
|
845
|
+
pointer-events: none;
|
|
846
|
+
align-items: flex-start;
|
|
847
|
+
justify-content: flex-end;
|
|
848
|
+
}
|
|
849
|
+
#submit-modal.visible { display: flex; }
|
|
850
|
+
#submit-modal .modal-dialog {
|
|
851
|
+
pointer-events: auto;
|
|
852
|
+
margin: 20px;
|
|
853
|
+
}
|
|
842
854
|
.modal-dialog {
|
|
843
855
|
background: var(--panel);
|
|
844
856
|
border: 1px solid var(--border);
|
|
@@ -1991,6 +2003,55 @@ function htmlTemplate(dataRows, cols, title, mode, previewHtml) {
|
|
|
1991
2003
|
border-radius: 8px;
|
|
1992
2004
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
|
|
1993
2005
|
}
|
|
2006
|
+
/* Video fullscreen overlay */
|
|
2007
|
+
.video-fullscreen-overlay {
|
|
2008
|
+
position: fixed;
|
|
2009
|
+
inset: 0;
|
|
2010
|
+
background: rgba(0, 0, 0, 0.95);
|
|
2011
|
+
z-index: 1001;
|
|
2012
|
+
display: none;
|
|
2013
|
+
justify-content: center;
|
|
2014
|
+
align-items: center;
|
|
2015
|
+
}
|
|
2016
|
+
.video-fullscreen-overlay.visible {
|
|
2017
|
+
display: flex;
|
|
2018
|
+
}
|
|
2019
|
+
.video-close-btn {
|
|
2020
|
+
position: absolute;
|
|
2021
|
+
top: 14px;
|
|
2022
|
+
right: 14px;
|
|
2023
|
+
width: 40px;
|
|
2024
|
+
height: 40px;
|
|
2025
|
+
display: flex;
|
|
2026
|
+
align-items: center;
|
|
2027
|
+
justify-content: center;
|
|
2028
|
+
background: rgba(0, 0, 0, 0.55);
|
|
2029
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
2030
|
+
border-radius: 50%;
|
|
2031
|
+
cursor: pointer;
|
|
2032
|
+
color: #fff;
|
|
2033
|
+
font-size: 18px;
|
|
2034
|
+
z-index: 10;
|
|
2035
|
+
backdrop-filter: blur(4px);
|
|
2036
|
+
transition: background 120ms ease, transform 120ms ease;
|
|
2037
|
+
}
|
|
2038
|
+
.video-close-btn:hover {
|
|
2039
|
+
background: rgba(0, 0, 0, 0.75);
|
|
2040
|
+
transform: scale(1.04);
|
|
2041
|
+
}
|
|
2042
|
+
.video-container {
|
|
2043
|
+
width: 90vw;
|
|
2044
|
+
height: 90vh;
|
|
2045
|
+
display: flex;
|
|
2046
|
+
justify-content: center;
|
|
2047
|
+
align-items: center;
|
|
2048
|
+
}
|
|
2049
|
+
.video-container video {
|
|
2050
|
+
max-width: 100%;
|
|
2051
|
+
max-height: 100%;
|
|
2052
|
+
border-radius: 8px;
|
|
2053
|
+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
|
|
2054
|
+
}
|
|
1994
2055
|
/* Copy notification toast */
|
|
1995
2056
|
.copy-toast {
|
|
1996
2057
|
position: fixed;
|
|
@@ -2051,6 +2112,18 @@ function htmlTemplate(dataRows, cols, title, mode, previewHtml) {
|
|
|
2051
2112
|
z-index: 100;
|
|
2052
2113
|
}
|
|
2053
2114
|
.modal-overlay.visible { display: flex; }
|
|
2115
|
+
/* Submit modal: top-right position, no blocking overlay */
|
|
2116
|
+
#submit-modal {
|
|
2117
|
+
background: transparent;
|
|
2118
|
+
pointer-events: none;
|
|
2119
|
+
align-items: flex-start;
|
|
2120
|
+
justify-content: flex-end;
|
|
2121
|
+
}
|
|
2122
|
+
#submit-modal.visible { display: flex; }
|
|
2123
|
+
#submit-modal .modal-dialog {
|
|
2124
|
+
pointer-events: auto;
|
|
2125
|
+
margin: 20px;
|
|
2126
|
+
}
|
|
2054
2127
|
.modal-dialog {
|
|
2055
2128
|
background: var(--panel-solid);
|
|
2056
2129
|
border: 1px solid var(--border);
|
|
@@ -2352,6 +2425,10 @@ function htmlTemplate(dataRows, cols, title, mode, previewHtml) {
|
|
|
2352
2425
|
<button class="image-close-btn" id="image-close" aria-label="Close image" title="Close (ESC)">✕</button>
|
|
2353
2426
|
<div class="image-container" id="image-container"></div>
|
|
2354
2427
|
</div>
|
|
2428
|
+
<div class="video-fullscreen-overlay" id="video-fullscreen">
|
|
2429
|
+
<button class="video-close-btn" id="video-close" aria-label="Close video" title="Close (ESC)">✕</button>
|
|
2430
|
+
<div class="video-container" id="video-container"></div>
|
|
2431
|
+
</div>
|
|
2355
2432
|
|
|
2356
2433
|
<script>
|
|
2357
2434
|
const DATA = ${serialized};
|
|
@@ -3652,6 +3729,78 @@ function htmlTemplate(dataRows, cols, title, mode, previewHtml) {
|
|
|
3652
3729
|
});
|
|
3653
3730
|
});
|
|
3654
3731
|
})();
|
|
3732
|
+
|
|
3733
|
+
// --- Video Fullscreen ---
|
|
3734
|
+
(function initVideoFullscreen() {
|
|
3735
|
+
const preview = document.querySelector('.md-preview');
|
|
3736
|
+
if (!preview) return;
|
|
3737
|
+
|
|
3738
|
+
const videoOverlay = document.getElementById('video-fullscreen');
|
|
3739
|
+
const videoContainer = document.getElementById('video-container');
|
|
3740
|
+
const videoClose = document.getElementById('video-close');
|
|
3741
|
+
if (!videoOverlay || !videoContainer) return;
|
|
3742
|
+
|
|
3743
|
+
const videoExtensions = /\\.(mp4|mov|webm|avi|mkv|m4v|ogv)$/i;
|
|
3744
|
+
|
|
3745
|
+
function closeVideoOverlay() {
|
|
3746
|
+
videoOverlay.classList.remove('visible');
|
|
3747
|
+
// Stop and remove video
|
|
3748
|
+
const video = videoContainer.querySelector('video');
|
|
3749
|
+
if (video) {
|
|
3750
|
+
video.pause();
|
|
3751
|
+
video.src = '';
|
|
3752
|
+
video.remove();
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3755
|
+
|
|
3756
|
+
if (videoClose) {
|
|
3757
|
+
videoClose.addEventListener('click', closeVideoOverlay);
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
if (videoOverlay) {
|
|
3761
|
+
videoOverlay.addEventListener('click', (e) => {
|
|
3762
|
+
if (e.target === videoOverlay) closeVideoOverlay();
|
|
3763
|
+
});
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
document.addEventListener('keydown', (e) => {
|
|
3767
|
+
if (e.key === 'Escape' && videoOverlay.classList.contains('visible')) {
|
|
3768
|
+
closeVideoOverlay();
|
|
3769
|
+
}
|
|
3770
|
+
});
|
|
3771
|
+
|
|
3772
|
+
// Intercept video link clicks
|
|
3773
|
+
preview.querySelectorAll('a').forEach(link => {
|
|
3774
|
+
const href = link.getAttribute('href');
|
|
3775
|
+
if (href && videoExtensions.test(href)) {
|
|
3776
|
+
link.style.cursor = 'pointer';
|
|
3777
|
+
link.title = 'Click to play video fullscreen';
|
|
3778
|
+
|
|
3779
|
+
link.addEventListener('click', (e) => {
|
|
3780
|
+
e.preventDefault();
|
|
3781
|
+
e.stopPropagation();
|
|
3782
|
+
|
|
3783
|
+
// Remove existing video if any
|
|
3784
|
+
const existingVideo = videoContainer.querySelector('video');
|
|
3785
|
+
if (existingVideo) {
|
|
3786
|
+
existingVideo.pause();
|
|
3787
|
+
existingVideo.src = '';
|
|
3788
|
+
existingVideo.remove();
|
|
3789
|
+
}
|
|
3790
|
+
|
|
3791
|
+
const video = document.createElement('video');
|
|
3792
|
+
video.src = href;
|
|
3793
|
+
video.controls = true;
|
|
3794
|
+
video.autoplay = true;
|
|
3795
|
+
video.style.maxWidth = '100%';
|
|
3796
|
+
video.style.maxHeight = '100%';
|
|
3797
|
+
videoContainer.appendChild(video);
|
|
3798
|
+
|
|
3799
|
+
videoOverlay.classList.add('visible');
|
|
3800
|
+
});
|
|
3801
|
+
}
|
|
3802
|
+
});
|
|
3803
|
+
})();
|
|
3655
3804
|
</script>
|
|
3656
3805
|
</body>
|
|
3657
3806
|
</html>`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reviw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Lightweight file reviewer with in-browser comments for CSV, TSV, Markdown, and Git diffs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"cli.cjs"
|
|
11
11
|
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"test": "vitest run",
|
|
14
|
-
"test:watch": "vitest"
|
|
15
|
-
},
|
|
16
12
|
"license": "MIT",
|
|
17
13
|
"author": "kazuph",
|
|
18
14
|
"publishConfig": {
|
|
@@ -31,5 +27,9 @@
|
|
|
31
27
|
"@playwright/test": "^1.57.0",
|
|
32
28
|
"playwright": "^1.57.0",
|
|
33
29
|
"vitest": "^4.0.14"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|