jupyterlab_vscode_icons_extension 1.0.102 → 1.0.112
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/index.js +43 -1
- package/package.json +1 -1
- package/src/index.ts +47 -1
package/lib/index.js
CHANGED
|
@@ -422,6 +422,8 @@ const plugin = {
|
|
|
422
422
|
const wordSvg = (wordIcon === null || wordIcon === void 0 ? void 0 : wordIcon.svgstr) || '';
|
|
423
423
|
const excelSvg = (excelIcon === null || excelIcon === void 0 ? void 0 : excelIcon.svgstr) || '';
|
|
424
424
|
const powerpointSvg = (powerpointIcon === null || powerpointIcon === void 0 ? void 0 : powerpointIcon.svgstr) || '';
|
|
425
|
+
const svgFileIcon = createLabIcon('file-type-image');
|
|
426
|
+
const svgFileSvg = (svgFileIcon === null || svgFileIcon === void 0 ? void 0 : svgFileIcon.svgstr) || '';
|
|
425
427
|
// Create base64 encoded data URIs
|
|
426
428
|
const pythonDataUri = `data:image/svg+xml;base64,${btoa(pythonSvg)}`;
|
|
427
429
|
const markdownDataUri = `data:image/svg+xml;base64,${btoa(markdownSvg)}`;
|
|
@@ -431,6 +433,7 @@ const plugin = {
|
|
|
431
433
|
const wordDataUri = wordSvg ? `data:image/svg+xml;base64,${btoa(wordSvg)}` : '';
|
|
432
434
|
const excelDataUri = excelSvg ? `data:image/svg+xml;base64,${btoa(excelSvg)}` : '';
|
|
433
435
|
const powerpointDataUri = powerpointSvg ? `data:image/svg+xml;base64,${btoa(powerpointSvg)}` : '';
|
|
436
|
+
const svgFileDataUri = svgFileSvg ? `data:image/svg+xml;base64,${btoa(svgFileSvg)}` : '';
|
|
434
437
|
// Inject CSS that overrides icons for .py and .md files
|
|
435
438
|
// Note: Jupytext marks .py and .md files as type="notebook", so we need to
|
|
436
439
|
// use JavaScript to detect and mark these files for CSS targeting
|
|
@@ -570,6 +573,22 @@ const plugin = {
|
|
|
570
573
|
background-repeat: no-repeat;
|
|
571
574
|
background-position: center;
|
|
572
575
|
}
|
|
576
|
+
|
|
577
|
+
/* Override any incorrect file type detection for SVG files */
|
|
578
|
+
.jp-DirListing-item[data-vscode-svg-override] .jp-DirListing-itemIcon svg,
|
|
579
|
+
.jp-DirListing-item[data-vscode-svg-override] .jp-DirListing-itemIcon img {
|
|
580
|
+
display: none !important;
|
|
581
|
+
}
|
|
582
|
+
.jp-DirListing-item[data-vscode-svg-override] .jp-DirListing-itemIcon::before {
|
|
583
|
+
content: '';
|
|
584
|
+
display: inline-block;
|
|
585
|
+
width: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
586
|
+
height: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
587
|
+
background-image: url('${svgFileDataUri}');
|
|
588
|
+
background-size: contain;
|
|
589
|
+
background-repeat: no-repeat;
|
|
590
|
+
background-position: center;
|
|
591
|
+
}
|
|
573
592
|
`;
|
|
574
593
|
// Add CSS to make JavaScript and .env icons less bright
|
|
575
594
|
style.textContent += `
|
|
@@ -676,6 +695,11 @@ const plugin = {
|
|
|
676
695
|
else if (nameLower.endsWith('.ppt') || nameLower.endsWith('.pptx')) {
|
|
677
696
|
item.setAttribute('data-vscode-powerpoint', 'true');
|
|
678
697
|
}
|
|
698
|
+
// Force SVG icon for .svg files (override any incorrect file type detection)
|
|
699
|
+
item.removeAttribute('data-vscode-svg-override');
|
|
700
|
+
if (nameLower.endsWith('.svg')) {
|
|
701
|
+
item.setAttribute('data-vscode-svg-override', 'true');
|
|
702
|
+
}
|
|
679
703
|
});
|
|
680
704
|
};
|
|
681
705
|
// Watch for changes in the file browser
|
|
@@ -756,7 +780,6 @@ const plugin = {
|
|
|
756
780
|
docRegistry.addFileType({
|
|
757
781
|
name: 'vscode-makefile',
|
|
758
782
|
displayName: 'Makefile',
|
|
759
|
-
mimeTypes: ['text/x-makefile'],
|
|
760
783
|
extensions: ['.mk', '.mak', '.make'],
|
|
761
784
|
pattern: '^(Makefile|makefile|GNUmakefile)$',
|
|
762
785
|
fileFormat: 'text',
|
|
@@ -832,6 +855,25 @@ const plugin = {
|
|
|
832
855
|
icon: drawioIcon
|
|
833
856
|
});
|
|
834
857
|
}
|
|
858
|
+
// Register MCP config files with custom icon
|
|
859
|
+
if (settings.enableConfigIcons) {
|
|
860
|
+
const mcpSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
861
|
+
<path fill="#eee" d="M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z"/>
|
|
862
|
+
<path fill="#eee" d="M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z"/>
|
|
863
|
+
</svg>`;
|
|
864
|
+
const mcpIcon = new LabIcon({
|
|
865
|
+
name: 'mcp-icon',
|
|
866
|
+
svgstr: mcpSvg
|
|
867
|
+
});
|
|
868
|
+
docRegistry.addFileType({
|
|
869
|
+
name: 'vscode-mcp',
|
|
870
|
+
displayName: 'MCP Configuration',
|
|
871
|
+
pattern: '^\\.mcp\\.json(\\..*)?$',
|
|
872
|
+
fileFormat: 'text',
|
|
873
|
+
contentType: 'file',
|
|
874
|
+
icon: mcpIcon
|
|
875
|
+
});
|
|
876
|
+
}
|
|
835
877
|
};
|
|
836
878
|
// Debounce timer for settings change alert
|
|
837
879
|
let settingsChangeTimeout = null;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -469,6 +469,8 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
469
469
|
const wordSvg = wordIcon?.svgstr || '';
|
|
470
470
|
const excelSvg = excelIcon?.svgstr || '';
|
|
471
471
|
const powerpointSvg = powerpointIcon?.svgstr || '';
|
|
472
|
+
const svgFileIcon = createLabIcon('file-type-image');
|
|
473
|
+
const svgFileSvg = svgFileIcon?.svgstr || '';
|
|
472
474
|
|
|
473
475
|
// Create base64 encoded data URIs
|
|
474
476
|
const pythonDataUri = `data:image/svg+xml;base64,${btoa(pythonSvg)}`;
|
|
@@ -479,6 +481,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
479
481
|
const wordDataUri = wordSvg ? `data:image/svg+xml;base64,${btoa(wordSvg)}` : '';
|
|
480
482
|
const excelDataUri = excelSvg ? `data:image/svg+xml;base64,${btoa(excelSvg)}` : '';
|
|
481
483
|
const powerpointDataUri = powerpointSvg ? `data:image/svg+xml;base64,${btoa(powerpointSvg)}` : '';
|
|
484
|
+
const svgFileDataUri = svgFileSvg ? `data:image/svg+xml;base64,${btoa(svgFileSvg)}` : '';
|
|
482
485
|
|
|
483
486
|
// Inject CSS that overrides icons for .py and .md files
|
|
484
487
|
// Note: Jupytext marks .py and .md files as type="notebook", so we need to
|
|
@@ -619,6 +622,22 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
619
622
|
background-repeat: no-repeat;
|
|
620
623
|
background-position: center;
|
|
621
624
|
}
|
|
625
|
+
|
|
626
|
+
/* Override any incorrect file type detection for SVG files */
|
|
627
|
+
.jp-DirListing-item[data-vscode-svg-override] .jp-DirListing-itemIcon svg,
|
|
628
|
+
.jp-DirListing-item[data-vscode-svg-override] .jp-DirListing-itemIcon img {
|
|
629
|
+
display: none !important;
|
|
630
|
+
}
|
|
631
|
+
.jp-DirListing-item[data-vscode-svg-override] .jp-DirListing-itemIcon::before {
|
|
632
|
+
content: '';
|
|
633
|
+
display: inline-block;
|
|
634
|
+
width: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
635
|
+
height: calc(var(--jp-ui-font-size1, 13px) * var(--jp-custom-icon-scale, 1.5));
|
|
636
|
+
background-image: url('${svgFileDataUri}');
|
|
637
|
+
background-size: contain;
|
|
638
|
+
background-repeat: no-repeat;
|
|
639
|
+
background-position: center;
|
|
640
|
+
}
|
|
622
641
|
`;
|
|
623
642
|
|
|
624
643
|
// Add CSS to make JavaScript and .env icons less bright
|
|
@@ -727,6 +746,12 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
727
746
|
} else if (nameLower.endsWith('.ppt') || nameLower.endsWith('.pptx')) {
|
|
728
747
|
item.setAttribute('data-vscode-powerpoint', 'true');
|
|
729
748
|
}
|
|
749
|
+
|
|
750
|
+
// Force SVG icon for .svg files (override any incorrect file type detection)
|
|
751
|
+
item.removeAttribute('data-vscode-svg-override');
|
|
752
|
+
if (nameLower.endsWith('.svg')) {
|
|
753
|
+
item.setAttribute('data-vscode-svg-override', 'true');
|
|
754
|
+
}
|
|
730
755
|
});
|
|
731
756
|
};
|
|
732
757
|
|
|
@@ -826,7 +851,6 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
826
851
|
docRegistry.addFileType({
|
|
827
852
|
name: 'vscode-makefile',
|
|
828
853
|
displayName: 'Makefile',
|
|
829
|
-
mimeTypes: ['text/x-makefile'],
|
|
830
854
|
extensions: ['.mk', '.mak', '.make'],
|
|
831
855
|
pattern: '^(Makefile|makefile|GNUmakefile)$',
|
|
832
856
|
fileFormat: 'text',
|
|
@@ -911,6 +935,28 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
911
935
|
icon: drawioIcon
|
|
912
936
|
});
|
|
913
937
|
}
|
|
938
|
+
|
|
939
|
+
// Register MCP config files with custom icon
|
|
940
|
+
if (settings.enableConfigIcons) {
|
|
941
|
+
const mcpSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
942
|
+
<path fill="#eee" d="M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z"/>
|
|
943
|
+
<path fill="#eee" d="M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z"/>
|
|
944
|
+
</svg>`;
|
|
945
|
+
|
|
946
|
+
const mcpIcon = new LabIcon({
|
|
947
|
+
name: 'mcp-icon',
|
|
948
|
+
svgstr: mcpSvg
|
|
949
|
+
});
|
|
950
|
+
|
|
951
|
+
docRegistry.addFileType({
|
|
952
|
+
name: 'vscode-mcp',
|
|
953
|
+
displayName: 'MCP Configuration',
|
|
954
|
+
pattern: '^\\.mcp\\.json(\\..*)?$',
|
|
955
|
+
fileFormat: 'text',
|
|
956
|
+
contentType: 'file',
|
|
957
|
+
icon: mcpIcon
|
|
958
|
+
});
|
|
959
|
+
}
|
|
914
960
|
};
|
|
915
961
|
|
|
916
962
|
// Debounce timer for settings change alert
|