jupyterlab_vscode_icons_extension 1.1.57 → 1.1.59
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/lib/hotfixes/jupytext-1.19.1.js +3 -0
- package/lib/index.js +65 -9
- package/package.json +1 -1
- package/src/hotfixes/jupytext-1.19.1.ts +3 -0
- package/src/index.ts +70 -10
package/lib/index.js
CHANGED
|
@@ -472,6 +472,22 @@ const plugin = {
|
|
|
472
472
|
// Executable file icon - JupyterLab standard file icon with play triangle overlay
|
|
473
473
|
const executableSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="#909090" d="m19.3 8.2-5.5-5.5c-.3-.3-.7-.5-1.2-.5H3.9c-.8.1-1.6.9-1.6 1.8v14.1c0 .9.7 1.6 1.6 1.6h14.2c.9 0 1.6-.7 1.6-1.6V9.4c.1-.5-.1-.9-.4-1.2m-5.8-3.3 3.4 3.6h-3.4zm3.9 12.7H4.7c-.1 0-.2 0-.2-.2V4.7c0-.2.1-.3.2-.3h7.2v4.4s0 .8.3 1.1 1.1.3 1.1.3h4.3v7.2s-.1.2-.2.2"/><path fill="#00e676" stroke="#1b5e20" stroke-width="0.8" d="M12,12 L20,16 L12,20 Z"/></svg>';
|
|
474
474
|
const executableDataUri = `data:image/svg+xml;base64,${btoa(executableSvg)}`;
|
|
475
|
+
// Executable shell script icon - shell icon with green play triangle
|
|
476
|
+
const executableShellSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
477
|
+
<rect x="1" y="3" width="30" height="26" rx="2" fill="#1a1a1a"/>
|
|
478
|
+
<path fill="#e8b070" d="M29.4 27.6H2.5V4.5h26.9Zm-25.9-1h24.9V5.5H3.5Z"/>
|
|
479
|
+
<path fill="#e8b070" d="m6.077 19.316l-.555-.832l4.844-3.229l-4.887-4.071l.641-.768l5.915 4.928zM12.7 18.2h7.8v1h-7.8zM2.5 5.5h26.9v1.9H2.5z"/>
|
|
480
|
+
<path fill="#00e676" stroke="#1b5e20" stroke-width="1" d="M18,18 L28,23 L18,28 Z"/>
|
|
481
|
+
</svg>`;
|
|
482
|
+
const executableShellDataUri = `data:image/svg+xml;base64,${btoa(executableShellSvg)}`;
|
|
483
|
+
// Executable batch script icon - batch icon with green play triangle
|
|
484
|
+
const executableBatchSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
485
|
+
<rect x="1" y="3" width="30" height="26" rx="2" fill="#1a1a1a"/>
|
|
486
|
+
<path fill="#80c8f0" d="M29.4 27.6H2.5V4.5h26.9Zm-25.9-1h24.9V5.5H3.5Z"/>
|
|
487
|
+
<path fill="#80c8f0" d="m6.077 19.316l-.555-.832l4.844-3.229l-4.887-4.071l.641-.768l5.915 4.928zM12.7 18.2h7.8v1h-7.8zM2.5 5.5h26.9v1.9H2.5z"/>
|
|
488
|
+
<path fill="#00e676" stroke="#1b5e20" stroke-width="1" d="M18,18 L28,23 L18,28 Z"/>
|
|
489
|
+
</svg>`;
|
|
490
|
+
const executableBatchDataUri = `data:image/svg+xml;base64,${btoa(executableBatchSvg)}`;
|
|
475
491
|
// Inject CSS that overrides icons for .py and .md files
|
|
476
492
|
// Note: Jupytext marks .py and .md files as type="notebook", so we need to
|
|
477
493
|
// use JavaScript to detect and mark these files for CSS targeting
|
|
@@ -692,7 +708,7 @@ const plugin = {
|
|
|
692
708
|
background-position: center;
|
|
693
709
|
}
|
|
694
710
|
|
|
695
|
-
/* Override executable file icons */
|
|
711
|
+
/* Override executable file icons (generic files) */
|
|
696
712
|
.jp-DirListing-item[data-executable] .jp-DirListing-itemIcon svg,
|
|
697
713
|
.jp-DirListing-item[data-executable] .jp-DirListing-itemIcon img {
|
|
698
714
|
display: none !important;
|
|
@@ -707,6 +723,38 @@ const plugin = {
|
|
|
707
723
|
background-repeat: no-repeat;
|
|
708
724
|
background-position: center;
|
|
709
725
|
}
|
|
726
|
+
|
|
727
|
+
/* Override executable shell script icons (.sh, .bash, .zsh, etc.) */
|
|
728
|
+
.jp-DirListing-item[data-executable-shell] .jp-DirListing-itemIcon svg,
|
|
729
|
+
.jp-DirListing-item[data-executable-shell] .jp-DirListing-itemIcon img {
|
|
730
|
+
display: none !important;
|
|
731
|
+
}
|
|
732
|
+
.jp-DirListing-item[data-executable-shell] .jp-DirListing-itemIcon::before {
|
|
733
|
+
content: '';
|
|
734
|
+
display: inline-block;
|
|
735
|
+
width: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
736
|
+
height: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
737
|
+
background-image: url('${executableShellDataUri}');
|
|
738
|
+
background-size: contain;
|
|
739
|
+
background-repeat: no-repeat;
|
|
740
|
+
background-position: center;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/* Override executable batch script icons (.bat, .cmd) */
|
|
744
|
+
.jp-DirListing-item[data-executable-batch] .jp-DirListing-itemIcon svg,
|
|
745
|
+
.jp-DirListing-item[data-executable-batch] .jp-DirListing-itemIcon img {
|
|
746
|
+
display: none !important;
|
|
747
|
+
}
|
|
748
|
+
.jp-DirListing-item[data-executable-batch] .jp-DirListing-itemIcon::before {
|
|
749
|
+
content: '';
|
|
750
|
+
display: inline-block;
|
|
751
|
+
width: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
752
|
+
height: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
753
|
+
background-image: url('${executableBatchDataUri}');
|
|
754
|
+
background-size: contain;
|
|
755
|
+
background-repeat: no-repeat;
|
|
756
|
+
background-position: center;
|
|
757
|
+
}
|
|
710
758
|
`;
|
|
711
759
|
// Add CSS to make JavaScript and .env icons less bright
|
|
712
760
|
style.textContent += `
|
|
@@ -892,17 +940,25 @@ const plugin = {
|
|
|
892
940
|
item.setAttribute('data-pytest', 'true');
|
|
893
941
|
}
|
|
894
942
|
// Mark executable files if setting is enabled (uses server API for +x detection)
|
|
895
|
-
//
|
|
943
|
+
// Shell scripts get shell+play icon, batch scripts get batch+play icon, others get generic executable icon
|
|
896
944
|
item.removeAttribute('data-executable');
|
|
945
|
+
item.removeAttribute('data-executable-shell');
|
|
946
|
+
item.removeAttribute('data-executable-batch');
|
|
897
947
|
if (settings.enableExecutableIcons && executables.has(name)) {
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
948
|
+
const shellExtensions = ['.sh', '.bash', '.zsh', '.fish', '.csh', '.nu'];
|
|
949
|
+
const batchExtensions = ['.bat', '.cmd'];
|
|
950
|
+
const isShellScript = fileType === 'vscode-shell' ||
|
|
951
|
+
shellExtensions.some(ext => nameLower.endsWith(ext));
|
|
952
|
+
const isBatchScript = fileType === 'vscode-batch' ||
|
|
953
|
+
batchExtensions.some(ext => nameLower.endsWith(ext));
|
|
904
954
|
const hasNoSpecificType = !fileType || fileType === 'file' || fileType === '';
|
|
905
|
-
if (isShellScript
|
|
955
|
+
if (isShellScript) {
|
|
956
|
+
item.setAttribute('data-executable-shell', 'true');
|
|
957
|
+
}
|
|
958
|
+
else if (isBatchScript) {
|
|
959
|
+
item.setAttribute('data-executable-batch', 'true');
|
|
960
|
+
}
|
|
961
|
+
else if (hasNoSpecificType) {
|
|
906
962
|
item.setAttribute('data-executable', 'true');
|
|
907
963
|
}
|
|
908
964
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -528,6 +528,24 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
528
528
|
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="#909090" d="m19.3 8.2-5.5-5.5c-.3-.3-.7-.5-1.2-.5H3.9c-.8.1-1.6.9-1.6 1.8v14.1c0 .9.7 1.6 1.6 1.6h14.2c.9 0 1.6-.7 1.6-1.6V9.4c.1-.5-.1-.9-.4-1.2m-5.8-3.3 3.4 3.6h-3.4zm3.9 12.7H4.7c-.1 0-.2 0-.2-.2V4.7c0-.2.1-.3.2-.3h7.2v4.4s0 .8.3 1.1 1.1.3 1.1.3h4.3v7.2s-.1.2-.2.2"/><path fill="#00e676" stroke="#1b5e20" stroke-width="0.8" d="M12,12 L20,16 L12,20 Z"/></svg>';
|
|
529
529
|
const executableDataUri = `data:image/svg+xml;base64,${btoa(executableSvg)}`;
|
|
530
530
|
|
|
531
|
+
// Executable shell script icon - shell icon with green play triangle
|
|
532
|
+
const executableShellSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
533
|
+
<rect x="1" y="3" width="30" height="26" rx="2" fill="#1a1a1a"/>
|
|
534
|
+
<path fill="#e8b070" d="M29.4 27.6H2.5V4.5h26.9Zm-25.9-1h24.9V5.5H3.5Z"/>
|
|
535
|
+
<path fill="#e8b070" d="m6.077 19.316l-.555-.832l4.844-3.229l-4.887-4.071l.641-.768l5.915 4.928zM12.7 18.2h7.8v1h-7.8zM2.5 5.5h26.9v1.9H2.5z"/>
|
|
536
|
+
<path fill="#00e676" stroke="#1b5e20" stroke-width="1" d="M18,18 L28,23 L18,28 Z"/>
|
|
537
|
+
</svg>`;
|
|
538
|
+
const executableShellDataUri = `data:image/svg+xml;base64,${btoa(executableShellSvg)}`;
|
|
539
|
+
|
|
540
|
+
// Executable batch script icon - batch icon with green play triangle
|
|
541
|
+
const executableBatchSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
542
|
+
<rect x="1" y="3" width="30" height="26" rx="2" fill="#1a1a1a"/>
|
|
543
|
+
<path fill="#80c8f0" d="M29.4 27.6H2.5V4.5h26.9Zm-25.9-1h24.9V5.5H3.5Z"/>
|
|
544
|
+
<path fill="#80c8f0" d="m6.077 19.316l-.555-.832l4.844-3.229l-4.887-4.071l.641-.768l5.915 4.928zM12.7 18.2h7.8v1h-7.8zM2.5 5.5h26.9v1.9H2.5z"/>
|
|
545
|
+
<path fill="#00e676" stroke="#1b5e20" stroke-width="1" d="M18,18 L28,23 L18,28 Z"/>
|
|
546
|
+
</svg>`;
|
|
547
|
+
const executableBatchDataUri = `data:image/svg+xml;base64,${btoa(executableBatchSvg)}`;
|
|
548
|
+
|
|
531
549
|
// Inject CSS that overrides icons for .py and .md files
|
|
532
550
|
// Note: Jupytext marks .py and .md files as type="notebook", so we need to
|
|
533
551
|
// use JavaScript to detect and mark these files for CSS targeting
|
|
@@ -748,7 +766,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
748
766
|
background-position: center;
|
|
749
767
|
}
|
|
750
768
|
|
|
751
|
-
/* Override executable file icons */
|
|
769
|
+
/* Override executable file icons (generic files) */
|
|
752
770
|
.jp-DirListing-item[data-executable] .jp-DirListing-itemIcon svg,
|
|
753
771
|
.jp-DirListing-item[data-executable] .jp-DirListing-itemIcon img {
|
|
754
772
|
display: none !important;
|
|
@@ -763,6 +781,38 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
763
781
|
background-repeat: no-repeat;
|
|
764
782
|
background-position: center;
|
|
765
783
|
}
|
|
784
|
+
|
|
785
|
+
/* Override executable shell script icons (.sh, .bash, .zsh, etc.) */
|
|
786
|
+
.jp-DirListing-item[data-executable-shell] .jp-DirListing-itemIcon svg,
|
|
787
|
+
.jp-DirListing-item[data-executable-shell] .jp-DirListing-itemIcon img {
|
|
788
|
+
display: none !important;
|
|
789
|
+
}
|
|
790
|
+
.jp-DirListing-item[data-executable-shell] .jp-DirListing-itemIcon::before {
|
|
791
|
+
content: '';
|
|
792
|
+
display: inline-block;
|
|
793
|
+
width: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
794
|
+
height: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
795
|
+
background-image: url('${executableShellDataUri}');
|
|
796
|
+
background-size: contain;
|
|
797
|
+
background-repeat: no-repeat;
|
|
798
|
+
background-position: center;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/* Override executable batch script icons (.bat, .cmd) */
|
|
802
|
+
.jp-DirListing-item[data-executable-batch] .jp-DirListing-itemIcon svg,
|
|
803
|
+
.jp-DirListing-item[data-executable-batch] .jp-DirListing-itemIcon img {
|
|
804
|
+
display: none !important;
|
|
805
|
+
}
|
|
806
|
+
.jp-DirListing-item[data-executable-batch] .jp-DirListing-itemIcon::before {
|
|
807
|
+
content: '';
|
|
808
|
+
display: inline-block;
|
|
809
|
+
width: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
810
|
+
height: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
811
|
+
background-image: url('${executableBatchDataUri}');
|
|
812
|
+
background-size: contain;
|
|
813
|
+
background-repeat: no-repeat;
|
|
814
|
+
background-position: center;
|
|
815
|
+
}
|
|
766
816
|
`;
|
|
767
817
|
|
|
768
818
|
// Add CSS to make JavaScript and .env icons less bright
|
|
@@ -985,17 +1035,27 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
985
1035
|
}
|
|
986
1036
|
|
|
987
1037
|
// Mark executable files if setting is enabled (uses server API for +x detection)
|
|
988
|
-
//
|
|
1038
|
+
// Shell scripts get shell+play icon, batch scripts get batch+play icon, others get generic executable icon
|
|
989
1039
|
item.removeAttribute('data-executable');
|
|
1040
|
+
item.removeAttribute('data-executable-shell');
|
|
1041
|
+
item.removeAttribute('data-executable-batch');
|
|
990
1042
|
if (settings.enableExecutableIcons && executables.has(name)) {
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
'vscode-
|
|
995
|
-
|
|
996
|
-
const
|
|
997
|
-
|
|
998
|
-
|
|
1043
|
+
const shellExtensions = ['.sh', '.bash', '.zsh', '.fish', '.csh', '.nu'];
|
|
1044
|
+
const batchExtensions = ['.bat', '.cmd'];
|
|
1045
|
+
const isShellScript =
|
|
1046
|
+
fileType === 'vscode-shell' ||
|
|
1047
|
+
shellExtensions.some(ext => nameLower.endsWith(ext));
|
|
1048
|
+
const isBatchScript =
|
|
1049
|
+
fileType === 'vscode-batch' ||
|
|
1050
|
+
batchExtensions.some(ext => nameLower.endsWith(ext));
|
|
1051
|
+
const hasNoSpecificType =
|
|
1052
|
+
!fileType || fileType === 'file' || fileType === '';
|
|
1053
|
+
|
|
1054
|
+
if (isShellScript) {
|
|
1055
|
+
item.setAttribute('data-executable-shell', 'true');
|
|
1056
|
+
} else if (isBatchScript) {
|
|
1057
|
+
item.setAttribute('data-executable-batch', 'true');
|
|
1058
|
+
} else if (hasNoSpecificType) {
|
|
999
1059
|
item.setAttribute('data-executable', 'true');
|
|
1000
1060
|
}
|
|
1001
1061
|
}
|