jupyterlab_vscode_icons_extension 1.0.92 → 1.0.98
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 +34 -0
- package/package.json +1 -1
- package/src/index.ts +40 -0
package/lib/index.js
CHANGED
|
@@ -249,6 +249,7 @@ const fileTypeConfigs = [
|
|
|
249
249
|
extensions: ['.env'],
|
|
250
250
|
pattern: '^(\\.env\\.(?!zip|tar|gz|bz2|xz|7z|rar)[^.]+|[^.]+\\.env)$',
|
|
251
251
|
iconName: 'file-type-dotenv',
|
|
252
|
+
mimeTypes: ['text/x-sh'],
|
|
252
253
|
group: 'enableConfigIcons'
|
|
253
254
|
},
|
|
254
255
|
{
|
|
@@ -343,6 +344,12 @@ const fileTypeConfigs = [
|
|
|
343
344
|
iconName: 'file-type-terraform',
|
|
344
345
|
group: 'enableConfigIcons'
|
|
345
346
|
},
|
|
347
|
+
// Draw.io diagrams (custom icon registered separately)
|
|
348
|
+
{
|
|
349
|
+
extensions: ['.drawio', '.dio'],
|
|
350
|
+
iconName: 'custom-drawio',
|
|
351
|
+
group: 'enableConfigIcons'
|
|
352
|
+
},
|
|
346
353
|
// Images
|
|
347
354
|
{
|
|
348
355
|
extensions: ['.png', '.jpg', '.jpeg', '.gif', '.ico', '.webp', '.bmp'],
|
|
@@ -714,6 +721,10 @@ const plugin = {
|
|
|
714
721
|
if (!settings[config.group]) {
|
|
715
722
|
return;
|
|
716
723
|
}
|
|
724
|
+
// Skip custom icons that are registered separately
|
|
725
|
+
if (config.iconName.startsWith('custom-')) {
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
717
728
|
const icon = createLabIcon(config.iconName);
|
|
718
729
|
const fileTypeName = `vscode-${config.iconName}`;
|
|
719
730
|
// Register file type
|
|
@@ -729,6 +740,9 @@ const plugin = {
|
|
|
729
740
|
if (config.pattern) {
|
|
730
741
|
fileTypeOptions.pattern = config.pattern;
|
|
731
742
|
}
|
|
743
|
+
if (config.mimeTypes) {
|
|
744
|
+
fileTypeOptions.mimeTypes = config.mimeTypes;
|
|
745
|
+
}
|
|
732
746
|
docRegistry.addFileType(fileTypeOptions);
|
|
733
747
|
});
|
|
734
748
|
// Register Makefile with custom icon (document with gears, from text-x-makefile-svgrepo-com.svg)
|
|
@@ -798,6 +812,26 @@ const plugin = {
|
|
|
798
812
|
contentType: 'file',
|
|
799
813
|
icon: readmeIcon
|
|
800
814
|
});
|
|
815
|
+
// Register Draw.io files with custom orange diagram icon
|
|
816
|
+
if (settings.enableConfigIcons) {
|
|
817
|
+
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"/>
|
|
821
|
+
</svg>`;
|
|
822
|
+
const drawioIcon = new LabIcon({
|
|
823
|
+
name: 'drawio-icon',
|
|
824
|
+
svgstr: drawioSvg
|
|
825
|
+
});
|
|
826
|
+
docRegistry.addFileType({
|
|
827
|
+
name: 'vscode-drawio',
|
|
828
|
+
displayName: 'Draw.io Diagram',
|
|
829
|
+
extensions: ['.drawio', '.dio'],
|
|
830
|
+
fileFormat: 'text',
|
|
831
|
+
contentType: 'file',
|
|
832
|
+
icon: drawioIcon
|
|
833
|
+
});
|
|
834
|
+
}
|
|
801
835
|
};
|
|
802
836
|
// Debounce timer for settings change alert
|
|
803
837
|
let settingsChangeTimeout = null;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -38,6 +38,7 @@ interface IFileTypeConfig {
|
|
|
38
38
|
extensions: string[];
|
|
39
39
|
pattern?: string;
|
|
40
40
|
iconName: string;
|
|
41
|
+
mimeTypes?: string[];
|
|
41
42
|
group: keyof IIconSettings;
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -281,6 +282,7 @@ const fileTypeConfigs: IFileTypeConfig[] = [
|
|
|
281
282
|
extensions: ['.env'],
|
|
282
283
|
pattern: '^(\\.env\\.(?!zip|tar|gz|bz2|xz|7z|rar)[^.]+|[^.]+\\.env)$',
|
|
283
284
|
iconName: 'file-type-dotenv',
|
|
285
|
+
mimeTypes: ['text/x-sh'],
|
|
284
286
|
group: 'enableConfigIcons'
|
|
285
287
|
},
|
|
286
288
|
{
|
|
@@ -376,6 +378,12 @@ const fileTypeConfigs: IFileTypeConfig[] = [
|
|
|
376
378
|
iconName: 'file-type-terraform',
|
|
377
379
|
group: 'enableConfigIcons'
|
|
378
380
|
},
|
|
381
|
+
// Draw.io diagrams (custom icon registered separately)
|
|
382
|
+
{
|
|
383
|
+
extensions: ['.drawio', '.dio'],
|
|
384
|
+
iconName: 'custom-drawio',
|
|
385
|
+
group: 'enableConfigIcons'
|
|
386
|
+
},
|
|
379
387
|
|
|
380
388
|
// Images
|
|
381
389
|
{
|
|
@@ -774,6 +782,11 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
774
782
|
return;
|
|
775
783
|
}
|
|
776
784
|
|
|
785
|
+
// Skip custom icons that are registered separately
|
|
786
|
+
if (config.iconName.startsWith('custom-')) {
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
|
|
777
790
|
const icon = createLabIcon(config.iconName);
|
|
778
791
|
const fileTypeName = `vscode-${config.iconName}`;
|
|
779
792
|
|
|
@@ -793,6 +806,10 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
793
806
|
fileTypeOptions.pattern = config.pattern;
|
|
794
807
|
}
|
|
795
808
|
|
|
809
|
+
if (config.mimeTypes) {
|
|
810
|
+
fileTypeOptions.mimeTypes = config.mimeTypes;
|
|
811
|
+
}
|
|
812
|
+
|
|
796
813
|
docRegistry.addFileType(fileTypeOptions);
|
|
797
814
|
});
|
|
798
815
|
|
|
@@ -871,6 +888,29 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
871
888
|
contentType: 'file',
|
|
872
889
|
icon: readmeIcon
|
|
873
890
|
});
|
|
891
|
+
|
|
892
|
+
// Register Draw.io files with custom orange diagram icon
|
|
893
|
+
if (settings.enableConfigIcons) {
|
|
894
|
+
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"/>
|
|
898
|
+
</svg>`;
|
|
899
|
+
|
|
900
|
+
const drawioIcon = new LabIcon({
|
|
901
|
+
name: 'drawio-icon',
|
|
902
|
+
svgstr: drawioSvg
|
|
903
|
+
});
|
|
904
|
+
|
|
905
|
+
docRegistry.addFileType({
|
|
906
|
+
name: 'vscode-drawio',
|
|
907
|
+
displayName: 'Draw.io Diagram',
|
|
908
|
+
extensions: ['.drawio', '.dio'],
|
|
909
|
+
fileFormat: 'text',
|
|
910
|
+
contentType: 'file',
|
|
911
|
+
icon: drawioIcon
|
|
912
|
+
});
|
|
913
|
+
}
|
|
874
914
|
};
|
|
875
915
|
|
|
876
916
|
// Debounce timer for settings change alert
|