1
1
import {
2
2
JupyterFrontEnd ,
3
- JupyterFrontEndPlugin ,
4
- ILayoutRestorer
3
+ JupyterFrontEndPlugin
5
4
} from '@jupyterlab/application' ;
6
- import { IRenderMimeRegistry } from '@jupyterlab/rendermime' ;
7
- import { IEditorServices } from '@jupyterlab/codeeditor' ;
8
- import { ICommandPalette } from '@jupyterlab/apputils' ;
9
- import { IFileBrowserFactory } from '@jupyterlab/filebrowser' ;
10
- import { ILauncher } from '@jupyterlab/launcher' ;
11
- import { ITranslator } from '@jupyterlab/translation' ;
12
- import { ISettingRegistry } from '@jupyterlab/settingregistry' ;
13
5
14
- import { IBlocklyRegisty } from 'jupyterlab-blockly/lib/token' ;
15
- import Blocklyplugin from 'jupyterlab-blockly' ;
6
+ import { IBlocklyRegisty } from 'jupyterlab-blockly' ;
16
7
17
8
import BlocklyNiryo from './niryo_one_python_generators' ;
18
9
@@ -22,46 +13,12 @@ import BlocklyNiryo from './niryo_one_python_generators';
22
13
const plugin : JupyterFrontEndPlugin < void > = {
23
14
id : 'jupyterlab-niryo-one:plugin' ,
24
15
autoStart : true ,
25
- requires : [
26
- ILayoutRestorer ,
27
- IRenderMimeRegistry ,
28
- IEditorServices ,
29
- IFileBrowserFactory ,
30
- ISettingRegistry ,
31
- ITranslator
32
- ] ,
33
- optional : [ ILauncher , ICommandPalette ] ,
34
- activate : (
35
- app : JupyterFrontEnd ,
36
- restorer : ILayoutRestorer ,
37
- rendermime : IRenderMimeRegistry ,
38
- editorServices : IEditorServices ,
39
- browserFactory : IFileBrowserFactory ,
40
- settings : ISettingRegistry ,
41
- translator : ITranslator ,
42
- launcher : ILauncher | null ,
43
- palette : ICommandPalette | null
44
- ) => {
16
+ requires : [ IBlocklyRegisty ] ,
17
+ activate : ( app : JupyterFrontEnd , blockly : IBlocklyRegisty ) => {
45
18
console . log ( 'JupyterLab extension jupyterlab-niryo-one is activated!' ) ;
46
19
47
- // Activating the Blockly plugin.
48
- const BlocklyReturn = Blocklyplugin . activate (
49
- app ,
50
- restorer ,
51
- rendermime ,
52
- editorServices ,
53
- browserFactory ,
54
- settings ,
55
- translator ,
56
- launcher ,
57
- palette
58
- ) ;
59
-
60
20
//Registering the new toolbox containing all Niryo One blocks.
61
- ( BlocklyReturn as IBlocklyRegisty ) . registerToolbox (
62
- 'niryo' ,
63
- BlocklyNiryo . Toolbox
64
- ) ;
21
+ blockly . registerToolbox ( 'niryo' , BlocklyNiryo . Toolbox ) ;
65
22
}
66
23
} ;
67
24
0 commit comments