jupyterlab_vscode_icons_extension 1.0.99 → 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 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',
@@ -815,9 +838,9 @@ const plugin = {
815
838
  // Register Draw.io files with custom orange diagram icon
816
839
  if (settings.enableConfigIcons) {
817
840
  const drawioSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 161.6 161.6">
818
- <path fill="#F08705" d="M161.6,154.7c0,3.9-3.2,6.9-6.9,6.9H6.9c-3.9,0-6.9-3.2-6.9-6.9V6.9C0,3,3.2,0,6.9,0h147.8c3.9,0,6.9,3.2,6.9,6.9L161.6,154.7z"/>
819
- <path fill="#DF6C0C" d="M161.6,154.7c0,3.9-3.2,6.9-6.9,6.9H55.3l-32.2-32.7l20-32.7l59.4-73.8l58.9,60.7L161.6,154.7z"/>
820
- <path fill="#fff" d="M132.7,90.3h-17l-18-30.6c4-0.8,7-4.4,7-8.6V28c0-4.9-3.9-8.8-8.8-8.8h-30c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.3,3,7.8,6.9,8.6L46,90.4H29c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.9,3.9,8.8,8.8,8.8h30c4.9,0,8.8-3.9,8.8-8.8V99.2c0-4.9-3.9-8.8-8.8-8.8h-2.9L73.9,60h13.9l17.9,30.4h-3c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.9,3.9,8.8,8.8,8.8h30c4.9,0,8.8-3.9,8.8-8.8V99.2C141.5,94.3,137.6,90.3,132.7,90.3z"/>
841
+ <path fill="#D07005" d="M161.6,154.7c0,3.9-3.2,6.9-6.9,6.9H6.9c-3.9,0-6.9-3.2-6.9-6.9V6.9C0,3,3.2,0,6.9,0h147.8c3.9,0,6.9,3.2,6.9,6.9L161.6,154.7z"/>
842
+ <path fill="#B85A0A" d="M161.6,154.7c0,3.9-3.2,6.9-6.9,6.9H55.3l-32.2-32.7l20-32.7l59.4-73.8l58.9,60.7L161.6,154.7z"/>
843
+ <path fill="#e0e0e0" d="M132.7,90.3h-17l-18-30.6c4-0.8,7-4.4,7-8.6V28c0-4.9-3.9-8.8-8.8-8.8h-30c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.3,3,7.8,6.9,8.6L46,90.4H29c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.9,3.9,8.8,8.8,8.8h30c4.9,0,8.8-3.9,8.8-8.8V99.2c0-4.9-3.9-8.8-8.8-8.8h-2.9L73.9,60h13.9l17.9,30.4h-3c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.9,3.9,8.8,8.8,8.8h30c4.9,0,8.8-3.9,8.8-8.8V99.2C141.5,94.3,137.6,90.3,132.7,90.3z"/>
821
844
  </svg>`;
822
845
  const drawioIcon = new LabIcon({
823
846
  name: 'drawio-icon',
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jupyterlab_vscode_icons_extension",
3
- "version": "1.0.99",
3
+ "version": "1.0.112",
4
4
  "description": "Jupyterlab extension with a shameless rip-off of the vscode-icons into our beloved environment",
5
5
  "keywords": [
6
6
  "jupyter",
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',
@@ -892,9 +916,9 @@ const plugin: JupyterFrontEndPlugin<void> = {
892
916
  // Register Draw.io files with custom orange diagram icon
893
917
  if (settings.enableConfigIcons) {
894
918
  const drawioSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 161.6 161.6">
895
- <path fill="#F08705" d="M161.6,154.7c0,3.9-3.2,6.9-6.9,6.9H6.9c-3.9,0-6.9-3.2-6.9-6.9V6.9C0,3,3.2,0,6.9,0h147.8c3.9,0,6.9,3.2,6.9,6.9L161.6,154.7z"/>
896
- <path fill="#DF6C0C" d="M161.6,154.7c0,3.9-3.2,6.9-6.9,6.9H55.3l-32.2-32.7l20-32.7l59.4-73.8l58.9,60.7L161.6,154.7z"/>
897
- <path fill="#fff" d="M132.7,90.3h-17l-18-30.6c4-0.8,7-4.4,7-8.6V28c0-4.9-3.9-8.8-8.8-8.8h-30c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.3,3,7.8,6.9,8.6L46,90.4H29c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.9,3.9,8.8,8.8,8.8h30c4.9,0,8.8-3.9,8.8-8.8V99.2c0-4.9-3.9-8.8-8.8-8.8h-2.9L73.9,60h13.9l17.9,30.4h-3c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.9,3.9,8.8,8.8,8.8h30c4.9,0,8.8-3.9,8.8-8.8V99.2C141.5,94.3,137.6,90.3,132.7,90.3z"/>
919
+ <path fill="#D07005" d="M161.6,154.7c0,3.9-3.2,6.9-6.9,6.9H6.9c-3.9,0-6.9-3.2-6.9-6.9V6.9C0,3,3.2,0,6.9,0h147.8c3.9,0,6.9,3.2,6.9,6.9L161.6,154.7z"/>
920
+ <path fill="#B85A0A" d="M161.6,154.7c0,3.9-3.2,6.9-6.9,6.9H55.3l-32.2-32.7l20-32.7l59.4-73.8l58.9,60.7L161.6,154.7z"/>
921
+ <path fill="#e0e0e0" d="M132.7,90.3h-17l-18-30.6c4-0.8,7-4.4,7-8.6V28c0-4.9-3.9-8.8-8.8-8.8h-30c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.3,3,7.8,6.9,8.6L46,90.4H29c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.9,3.9,8.8,8.8,8.8h30c4.9,0,8.8-3.9,8.8-8.8V99.2c0-4.9-3.9-8.8-8.8-8.8h-2.9L73.9,60h13.9l17.9,30.4h-3c-4.9,0-8.8,3.9-8.8,8.8v23.1c0,4.9,3.9,8.8,8.8,8.8h30c4.9,0,8.8-3.9,8.8-8.8V99.2C141.5,94.3,137.6,90.3,132.7,90.3z"/>
898
922
  </svg>`;
899
923
 
900
924
  const drawioIcon = new LabIcon({
@@ -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