diff --git a/package.json b/package.json index e013340..629a117 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "@jupyterlab/apputils": "^2.0.2", "@jupyterlab/mainmenu": "^2.0.2", "@jupyterlab/notebook": "^2.0.2", + "@jupyterlab/launcher": "^2.0.2", "@lumino/widgets": "^1.14.0" }, "devDependencies": { diff --git a/src/index.ts b/src/index.ts index 20a90b9..64691b1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,10 @@ import { JupyterFrontEnd, JupyterFrontEndPlugin } from '@jupyterlab/application'; import { ICommandPalette, IThemeManager } from '@jupyterlab/apputils'; - +import { ILauncher } from '@jupyterlab/launcher'; import { IMainMenu } from '@jupyterlab/mainmenu'; import { IFileBrowserFactory } from '@jupyterlab/filebrowser'; import { Menu } from '@lumino/widgets'; + import { JACDACWidget } from './widget'; export const PALETTE_CATEGORY = "JACDAC" @@ -18,13 +19,15 @@ export const COMMAND_PLAYER = 'jacdac:player'; const extension: JupyterFrontEndPlugin = { id: 'jacdac', autoStart: true, - requires: [ICommandPalette, IMainMenu, IFileBrowserFactory, IThemeManager], + requires: [IFileBrowserFactory], + optional: [ICommandPalette, IMainMenu, IThemeManager, ILauncher], activate: ( app: JupyterFrontEnd, - palette: ICommandPalette, - mainMenu: IMainMenu, fileBrowserFactory: IFileBrowserFactory, - themeManager: IThemeManager + palette: ICommandPalette | null, + mainMenu: IMainMenu | null, + themeManager: IThemeManager | null, + launcher: ILauncher | null ) => { const { commands, shell, serviceManager } = app; const { contents } = serviceManager @@ -39,7 +42,7 @@ const extension: JupyterFrontEndPlugin = { // menu const menu = new Menu({ commands }); menu.title.label = 'JACDAC'; - mainMenu.addMenu(menu, { rank: 80 }); + mainMenu?.addMenu(menu, { rank: 80 }); const addCommand = (id: string, path: string, label: string, caption: string) => { // open recorder @@ -58,8 +61,13 @@ const extension: JupyterFrontEndPlugin = { shell.activateById(widget.id); } }); - palette.addItem({ command, category: PALETTE_CATEGORY }); - menu.addItem({ command }); + palette?.addItem({ command, category: PALETTE_CATEGORY }); + menu?.addItem({ command }); + launcher?.add({ + command: command, + category: 'JACDAC', + rank: 1 + }); } } diff --git a/yarn.lock b/yarn.lock index 3d3a245..1b5dea3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -128,6 +128,31 @@ react-dom "~16.9.0" sanitize-html "~1.20.1" +"@jupyterlab/apputils@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@jupyterlab/apputils/-/apputils-2.2.5.tgz#382eb7dc89970d4d90c7b5c2a639e84e0d654af3" + integrity sha512-eDyt6eWH8WPeBCzgRV601C6YkxmPXAIzAcqC910KQhag7e41zVGtWqEsfSIeQeQJmbgf1yg9duTHzN3YQ6802Q== + dependencies: + "@jupyterlab/coreutils" "^4.2.4" + "@jupyterlab/services" "^5.2.4" + "@jupyterlab/settingregistry" "^2.2.4" + "@jupyterlab/statedb" "^2.2.4" + "@jupyterlab/ui-components" "^2.2.3" + "@lumino/algorithm" "^1.2.3" + "@lumino/commands" "^1.10.1" + "@lumino/coreutils" "^1.4.2" + "@lumino/disposable" "^1.3.5" + "@lumino/domutils" "^1.1.7" + "@lumino/messaging" "^1.3.3" + "@lumino/properties" "^1.1.6" + "@lumino/signaling" "^1.3.5" + "@lumino/virtualdom" "^1.6.1" + "@lumino/widgets" "^1.11.1" + "@types/react" "~16.9.16" + react "~16.9.0" + react-dom "~16.9.0" + sanitize-html "~1.20.1" + "@jupyterlab/attachments@^2.2.2": version "2.2.2" resolved "https://registry.yarnpkg.com/@jupyterlab/attachments/-/attachments-2.2.2.tgz#74225fc51267d41d974783892a08b9b32f3961db" @@ -216,6 +241,19 @@ path-posix "~1.0.0" url-parse "~1.4.7" +"@jupyterlab/coreutils@^4.2.4": + version "4.2.4" + resolved "https://registry.yarnpkg.com/@jupyterlab/coreutils/-/coreutils-4.2.4.tgz#f02ca96f435f94fa049748d2afe0921240fb502d" + integrity sha512-neDtamXNK+nwac6eXtlDitpJzjtGKVdZ9TNjfoSLmlHyenerd5+Hm5kmZbQ+FWSdyUPo9RZizFYqtdAbW2ZriA== + dependencies: + "@lumino/coreutils" "^1.4.2" + "@lumino/disposable" "^1.3.5" + "@lumino/signaling" "^1.3.5" + minimist "~1.2.0" + moment "^2.24.0" + path-posix "~1.0.0" + url-parse "~1.4.7" + "@jupyterlab/docmanager@^2.2.2": version "2.2.2" resolved "https://registry.yarnpkg.com/@jupyterlab/docmanager/-/docmanager-2.2.2.tgz#ddb4649a01bcb698f3881a94648ca5233afcea99" @@ -280,6 +318,21 @@ "@lumino/widgets" "^1.11.1" react "~16.9.0" +"@jupyterlab/launcher@^2.0.2": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@jupyterlab/launcher/-/launcher-2.2.5.tgz#c322c4a47674caa502bdd2e484f7b8de14ea19e0" + integrity sha512-Ur1h2VdkFZ4t4vHsSJHH/FXZf32GRE+aheoyowM2estBv2xo3zgNtzzvcXf/x7Kyuk1NxRXM1s7BOyw7gSNB/A== + dependencies: + "@jupyterlab/apputils" "^2.2.5" + "@jupyterlab/ui-components" "^2.2.3" + "@lumino/algorithm" "^1.2.3" + "@lumino/commands" "^1.10.1" + "@lumino/coreutils" "^1.4.2" + "@lumino/disposable" "^1.3.5" + "@lumino/properties" "^1.1.6" + "@lumino/widgets" "^1.11.1" + react "~16.9.0" + "@jupyterlab/mainmenu@^2.0.2": version "2.2.2" resolved "https://registry.yarnpkg.com/@jupyterlab/mainmenu/-/mainmenu-2.2.2.tgz#a0e12d0755dc52740fc5bca62aa60ca492640ea2" @@ -301,6 +354,13 @@ dependencies: "@lumino/coreutils" "^1.4.2" +"@jupyterlab/nbformat@^2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@jupyterlab/nbformat/-/nbformat-2.2.4.tgz#073403249e636ee7334fd995fa37880570f031d6" + integrity sha512-++kWMuVJvduiUbbGlDsNAbDAreDRuYAlLKqlpRL+KfAgvmYNri3qxDw9/NQ3GvI+0HDjTXO0l4WfXVLS5SESIg== + dependencies: + "@lumino/coreutils" "^1.4.2" + "@jupyterlab/notebook@^2.0.2": version "2.2.5" resolved "https://registry.yarnpkg.com/@jupyterlab/notebook/-/notebook-2.2.5.tgz#deba051f631fb599b3091aef292106b91a95d3ee" @@ -339,6 +399,17 @@ "@lumino/messaging" "^1.3.3" "@lumino/signaling" "^1.3.5" +"@jupyterlab/observables@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@jupyterlab/observables/-/observables-3.2.4.tgz#2c58c9c859e888183e237674f151276507cb9b72" + integrity sha512-gdAv2H1Ccr9ARUyG3jgfjGJb6yewy3NWU/4uvtaFR7sTekI27Tb4ulCCUrartgSNydmTjRw4bZwnu4e1qVj9eg== + dependencies: + "@lumino/algorithm" "^1.2.3" + "@lumino/coreutils" "^1.4.2" + "@lumino/disposable" "^1.3.5" + "@lumino/messaging" "^1.3.3" + "@lumino/signaling" "^1.3.5" + "@jupyterlab/outputarea@^2.2.2": version "2.2.2" resolved "https://registry.yarnpkg.com/@jupyterlab/outputarea/-/outputarea-2.2.2.tgz#f1ad50c71e19e8f624c5bc083caa2705e1830ec2" @@ -404,6 +475,24 @@ node-fetch "^2.6.0" ws "^7.2.0" +"@jupyterlab/services@^5.2.4": + version "5.2.4" + resolved "https://registry.yarnpkg.com/@jupyterlab/services/-/services-5.2.4.tgz#e9331a98db435abc83ffa902799df59fe6b9c15c" + integrity sha512-of9GujFF4bhFUcTyR+OTc04mEwm7l+xyJOzW6h6sp2JRIkHm2Sa0UwS9RlkdjXzjwAzg68TW2h1OOU8CzgunLw== + dependencies: + "@jupyterlab/coreutils" "^4.2.4" + "@jupyterlab/nbformat" "^2.2.4" + "@jupyterlab/observables" "^3.2.4" + "@jupyterlab/settingregistry" "^2.2.4" + "@jupyterlab/statedb" "^2.2.4" + "@lumino/algorithm" "^1.2.3" + "@lumino/coreutils" "^1.4.2" + "@lumino/disposable" "^1.3.5" + "@lumino/polling" "^1.1.1" + "@lumino/signaling" "^1.3.5" + node-fetch "^2.6.0" + ws "^7.2.0" + "@jupyterlab/settingregistry@^2.2.3": version "2.2.3" resolved "https://registry.yarnpkg.com/@jupyterlab/settingregistry/-/settingregistry-2.2.3.tgz#5c8e81933efcf0751385e766032caf56760c3fab" @@ -417,6 +506,19 @@ ajv "^6.10.2" json5 "^2.1.1" +"@jupyterlab/settingregistry@^2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@jupyterlab/settingregistry/-/settingregistry-2.2.4.tgz#8fd7e443fd4e4d0949e162fc316d63b785c2ea66" + integrity sha512-fx3PFuuB3jSf3eAuQc6zpDrE06t96XRGFdw0mJ7fgUg4LudrYkXAuDL6d4bJXn/GcglGhVkQNWKR4LYX7VBrWA== + dependencies: + "@jupyterlab/statedb" "^2.2.4" + "@lumino/commands" "^1.10.1" + "@lumino/coreutils" "^1.4.2" + "@lumino/disposable" "^1.3.5" + "@lumino/signaling" "^1.3.5" + ajv "^6.10.2" + json5 "^2.1.1" + "@jupyterlab/statedb@^2.2.3": version "2.2.3" resolved "https://registry.yarnpkg.com/@jupyterlab/statedb/-/statedb-2.2.3.tgz#e0b3034fbac834d126f7a74fe1c846693e4f9b3b" @@ -428,6 +530,17 @@ "@lumino/properties" "^1.1.6" "@lumino/signaling" "^1.3.5" +"@jupyterlab/statedb@^2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@jupyterlab/statedb/-/statedb-2.2.4.tgz#674d7b59b51c6b2f76e8557eb2ff64797f9a85e9" + integrity sha512-/JaabUJi0rFXZEYAFV9wVcXHllEgFAo59uqZ9/lU0i6gULSykCFdVw0QZPIaiaScQYKluhsOBMJB7uXOcDikRA== + dependencies: + "@lumino/commands" "^1.10.1" + "@lumino/coreutils" "^1.4.2" + "@lumino/disposable" "^1.3.5" + "@lumino/properties" "^1.1.6" + "@lumino/signaling" "^1.3.5" + "@jupyterlab/statusbar@^2.2.2": version "2.2.2" resolved "https://registry.yarnpkg.com/@jupyterlab/statusbar/-/statusbar-2.2.2.tgz#b6aab428729bed842976fe562610c639c43b72b2" @@ -465,6 +578,22 @@ react-dom "~16.9.0" typestyle "^2.0.4" +"@jupyterlab/ui-components@^2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@jupyterlab/ui-components/-/ui-components-2.2.3.tgz#abd53c7387ca761c7ad1ab848a5efbafe7446b51" + integrity sha512-QCnPJ2G4YhnEutEG3Nhr1h+SqIlyTNk2NAYfj1xG6lGg4bnLmhzjwAp6LcPEKWkEYOYWpnWSQpEdfxDm8GRtIQ== + dependencies: + "@blueprintjs/core" "^3.22.2" + "@blueprintjs/select" "^3.11.2" + "@jupyterlab/coreutils" "^4.2.4" + "@lumino/coreutils" "^1.4.2" + "@lumino/signaling" "^1.3.5" + "@lumino/virtualdom" "^1.6.1" + "@lumino/widgets" "^1.11.1" + react "~16.9.0" + react-dom "~16.9.0" + typestyle "^2.0.4" + "@lumino/algorithm@^1.2.3", "@lumino/algorithm@^1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@lumino/algorithm/-/algorithm-1.3.3.tgz#fdf4daa407a1ce6f233e173add6a2dda0c99eef4"