11// Copyright (c) Jupyter Development Team.
22// Distributed under the terms of the Modified BSD License.
33
4- import { Contents , Kernel } from '@jupyterlab/services' ;
5-
64import {
75 ArrayExt ,
86 ArrayIterator ,
@@ -34,6 +32,22 @@ import { IModelDB } from '@jupyterlab/observables';
3432
3533import { IRenderMime } from '@jupyterlab/rendermime-interfaces' ;
3634
35+ import { Contents , Kernel } from '@jupyterlab/services' ;
36+
37+ import {
38+ fileIcon ,
39+ folderIcon ,
40+ imageIcon ,
41+ JLIcon ,
42+ jsonIcon ,
43+ markdownIcon ,
44+ notebookIcon ,
45+ pythonIcon ,
46+ rKernelIcon ,
47+ spreadsheetIcon ,
48+ yamlIcon
49+ } from '@jupyterlab/ui-components' ;
50+
3751import { TextModelFactory } from './default' ;
3852
3953/**
@@ -1166,6 +1180,8 @@ export namespace DocumentRegistry {
11661180 */
11671181 readonly iconLabel ?: string ;
11681182
1183+ readonly iconPass ?: JLIcon . IPhosphor ;
1184+
11691185 /**
11701186 * The content type of the new file.
11711187 */
@@ -1184,7 +1200,7 @@ export namespace DocumentRegistry {
11841200 name : 'default' ,
11851201 extensions : [ ] ,
11861202 mimeTypes : [ ] ,
1187- iconClass : 'jp-MaterialIcon jp-FileIcon' ,
1203+ iconPass : fileIcon . phosphor ( { kind : 'dockPanelBar' , center : true } ) ,
11881204 iconLabel : '' ,
11891205 contentType : 'file' ,
11901206 fileFormat : 'text'
@@ -1235,7 +1251,7 @@ export namespace DocumentRegistry {
12351251 extensions : [ '.ipynb' ] ,
12361252 contentType : 'notebook' ,
12371253 fileFormat : 'json' ,
1238- iconClass : 'jp-MaterialIcon jp-NotebookIcon'
1254+ iconPass : notebookIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
12391255 } ;
12401256
12411257 /**
@@ -1247,7 +1263,7 @@ export namespace DocumentRegistry {
12471263 extensions : [ ] ,
12481264 mimeTypes : [ 'text/directory' ] ,
12491265 contentType : 'directory' ,
1250- iconClass : 'jp-MaterialIcon jp-FolderIcon'
1266+ iconPass : folderIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
12511267 } ;
12521268
12531269 /**
@@ -1262,56 +1278,56 @@ export namespace DocumentRegistry {
12621278 displayName : 'Markdown File' ,
12631279 extensions : [ '.md' ] ,
12641280 mimeTypes : [ 'text/markdown' ] ,
1265- iconClass : 'jp-MaterialIcon jp-MarkdownIcon'
1281+ iconPass : markdownIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
12661282 } ,
12671283 {
12681284 name : 'python' ,
12691285 displayName : 'Python File' ,
12701286 extensions : [ '.py' ] ,
12711287 mimeTypes : [ 'text/x-python' ] ,
1272- iconClass : 'jp-MaterialIcon jp-PythonIcon'
1288+ iconPass : pythonIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
12731289 } ,
12741290 {
12751291 name : 'json' ,
12761292 displayName : 'JSON File' ,
12771293 extensions : [ '.json' ] ,
12781294 mimeTypes : [ 'application/json' ] ,
1279- iconClass : 'jp-MaterialIcon jp-JsonIcon'
1295+ iconPass : jsonIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
12801296 } ,
12811297 {
12821298 name : 'csv' ,
12831299 displayName : 'CSV File' ,
12841300 extensions : [ '.csv' ] ,
12851301 mimeTypes : [ 'text/csv' ] ,
1286- iconClass : 'jp-MaterialIcon jp-SpreadsheetIcon'
1302+ iconPass : spreadsheetIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
12871303 } ,
12881304 {
12891305 name : 'tsv' ,
12901306 displayName : 'TSV File' ,
12911307 extensions : [ '.tsv' ] ,
12921308 mimeTypes : [ 'text/csv' ] ,
1293- iconClass : 'jp-MaterialIcon jp-SpreadsheetIcon'
1309+ iconPass : spreadsheetIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
12941310 } ,
12951311 {
12961312 name : 'r' ,
12971313 displayName : 'R File' ,
12981314 mimeTypes : [ 'text/x-rsrc' ] ,
12991315 extensions : [ '.r' ] ,
1300- iconClass : 'jp-MaterialIcon jp-RKernelIcon'
1316+ iconPass : rKernelIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
13011317 } ,
13021318 {
13031319 name : 'yaml' ,
13041320 displayName : 'YAML File' ,
13051321 mimeTypes : [ 'text/x-yaml' , 'text/yaml' ] ,
13061322 extensions : [ '.yaml' , '.yml' ] ,
1307- iconClass : 'jp-MaterialIcon jp-YamlIcon'
1323+ iconPass : yamlIcon . phosphor ( { kind : 'dockPanelBar' , center : true } )
13081324 } ,
13091325 {
13101326 name : 'svg' ,
13111327 displayName : 'Image' ,
13121328 mimeTypes : [ 'image/svg+xml' ] ,
13131329 extensions : [ '.svg' ] ,
1314- iconClass : 'jp-MaterialIcon jp-ImageIcon' ,
1330+ iconPass : imageIcon . phosphor ( { kind : 'dockPanelBar' , center : true } ) ,
13151331 fileFormat : 'base64'
13161332 } ,
13171333 {
@@ -1320,38 +1336,39 @@ export namespace DocumentRegistry {
13201336 mimeTypes : [ 'image/tiff' ] ,
13211337 extensions : [ '.tif' , '.tiff' ] ,
13221338 iconClass : 'jp-MaterialIcon jp-ImageIcon' ,
1339+ iconPass : imageIcon . phosphor ( { kind : 'dockPanelBar' , center : true } ) ,
13231340 fileFormat : 'base64'
13241341 } ,
13251342 {
13261343 name : 'jpeg' ,
13271344 displayName : 'Image' ,
13281345 mimeTypes : [ 'image/jpeg' ] ,
13291346 extensions : [ '.jpg' , '.jpeg' ] ,
1330- iconClass : 'jp-MaterialIcon jp-ImageIcon' ,
1347+ iconPass : imageIcon . phosphor ( { kind : 'dockPanelBar' , center : true } ) ,
13311348 fileFormat : 'base64'
13321349 } ,
13331350 {
13341351 name : 'gif' ,
13351352 displayName : 'Image' ,
13361353 mimeTypes : [ 'image/gif' ] ,
13371354 extensions : [ '.gif' ] ,
1338- iconClass : 'jp-MaterialIcon jp-ImageIcon' ,
1355+ iconPass : imageIcon . phosphor ( { kind : 'dockPanelBar' , center : true } ) ,
13391356 fileFormat : 'base64'
13401357 } ,
13411358 {
13421359 name : 'png' ,
13431360 displayName : 'Image' ,
13441361 mimeTypes : [ 'image/png' ] ,
13451362 extensions : [ '.png' ] ,
1346- iconClass : 'jp-MaterialIcon jp-ImageIcon' ,
1363+ iconPass : imageIcon . phosphor ( { kind : 'dockPanelBar' , center : true } ) ,
13471364 fileFormat : 'base64'
13481365 } ,
13491366 {
13501367 name : 'bmp' ,
13511368 displayName : 'Image' ,
13521369 mimeTypes : [ 'image/bmp' ] ,
13531370 extensions : [ '.bmp' ] ,
1354- iconClass : 'jp-MaterialIcon jp-ImageIcon' ,
1371+ iconPass : imageIcon . phosphor ( { kind : 'dockPanelBar' , center : true } ) ,
13551372 fileFormat : 'base64'
13561373 }
13571374 ] ;
0 commit comments