Explorar o código

Remove IStateDB imports now that ILayoutRestorer handles state management.

Afshin Darian %!s(int64=8) %!d(string=hai) anos
pai
achega
c2cdc655b8

+ 2 - 6
src/about/plugin.ts

@@ -17,10 +17,6 @@ import {
   ILayoutRestorer
 } from '../layoutrestorer';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   AboutModel, AboutWidget
 } from './';
@@ -33,11 +29,11 @@ const plugin: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.about',
   activate: activateAbout,
   autoStart: true,
-  requires: [ICommandPalette, IStateDB, ILayoutRestorer]
+  requires: [ICommandPalette, ILayoutRestorer]
 };
 
 
-function activateAbout(app: JupyterLab, palette: ICommandPalette, state: IStateDB, layout: ILayoutRestorer): void {
+function activateAbout(app: JupyterLab, palette: ICommandPalette, layout: ILayoutRestorer): void {
   const namespace = 'about-jupyterlab';
   const model = new AboutModel();
   const command = `${namespace}:show`;

+ 1 - 6
src/console/plugin.ts

@@ -61,10 +61,6 @@ import {
   IServiceManager
 } from '../services';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   IConsoleTracker, ConsolePanel, ConsoleContent
 } from './index';
@@ -85,7 +81,6 @@ const trackerPlugin: JupyterLabPlugin<IConsoleTracker> = {
     ICommandPalette,
     IPathTracker,
     ConsoleContent.IRenderer,
-    IStateDB,
     ILayoutRestorer
   ],
   activate: activateConsole,
@@ -138,7 +133,7 @@ interface ICreateConsoleArgs extends JSONObject {
 /**
  * Activate the console extension.
  */
-function activateConsole(app: JupyterLab, services: IServiceManager, rendermime: IRenderMime, mainMenu: IMainMenu, inspector: IInspector, palette: ICommandPalette, pathTracker: IPathTracker, renderer: ConsoleContent.IRenderer, state: IStateDB, layout: ILayoutRestorer): IConsoleTracker {
+function activateConsole(app: JupyterLab, services: IServiceManager, rendermime: IRenderMime, mainMenu: IMainMenu, inspector: IInspector, palette: ICommandPalette, pathTracker: IPathTracker, renderer: ConsoleContent.IRenderer, layout: ILayoutRestorer): IConsoleTracker {
   let manager = services.sessions;
   let { commands, keymap } = app;
   let category = 'Console';

+ 2 - 6
src/csvwidget/plugin.ts

@@ -17,10 +17,6 @@ import {
   ILayoutRestorer
 } from '../layoutrestorer';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   CSVWidget, CSVWidgetFactory
 } from './widget';
@@ -38,7 +34,7 @@ const FACTORY = 'Table';
 export
 const plugin: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.csv-handler',
-  requires: [IDocumentRegistry, IStateDB, ILayoutRestorer],
+  requires: [IDocumentRegistry, ILayoutRestorer],
   activate: activateCSVWidget,
   autoStart: true
 };
@@ -47,7 +43,7 @@ const plugin: JupyterLabPlugin<void> = {
 /**
  * Activate the table widget extension.
  */
-function activateCSVWidget(app: JupyterLab, registry: IDocumentRegistry, state: IStateDB, layout: ILayoutRestorer): void {
+function activateCSVWidget(app: JupyterLab, registry: IDocumentRegistry, layout: ILayoutRestorer): void {
   const factory = new CSVWidgetFactory({
     name: FACTORY,
     fileExtensions: ['.csv'],

+ 2 - 8
src/editorwidget/plugin.ts

@@ -21,10 +21,6 @@ import {
   ILayoutRestorer
 } from '../layoutrestorer';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   IEditorTracker, EditorWidget, EditorWidgetFactory
 } from './widget';
@@ -66,9 +62,7 @@ const cmdIds = {
 export
 const plugin: JupyterLabPlugin<IEditorTracker> = {
   id: 'jupyter.services.editor-handler',
-  requires: [
-    IDocumentRegistry, IStateDB, ILayoutRestorer, IEditorServices
-  ],
+  requires: [IDocumentRegistry, ILayoutRestorer, IEditorServices],
   provides: IEditorTracker,
   activate: activateEditorHandler,
   autoStart: true
@@ -78,7 +72,7 @@ const plugin: JupyterLabPlugin<IEditorTracker> = {
 /**
  * Sets up the editor widget
  */
-function activateEditorHandler(app: JupyterLab, registry: IDocumentRegistry, state: IStateDB, layout: ILayoutRestorer, editorServices: IEditorServices): IEditorTracker {
+function activateEditorHandler(app: JupyterLab, registry: IDocumentRegistry, layout: ILayoutRestorer, editorServices: IEditorServices): IEditorTracker {
   const factory = new EditorWidgetFactory({
     editorServices,
     factoryOptions: {

+ 2 - 6
src/faq/plugin.ts

@@ -21,10 +21,6 @@ import {
   ILayoutRestorer
 } from '../layoutrestorer';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   FaqModel, FaqWidget
 } from './widget';
@@ -36,7 +32,7 @@ import {
 export
 const plugin: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.faq',
-  requires: [ICommandPalette, ICommandLinker, IStateDB, ILayoutRestorer],
+  requires: [ICommandPalette, ICommandLinker, ILayoutRestorer],
   activate: activateFAQ,
   autoStart: true
 };
@@ -45,7 +41,7 @@ const plugin: JupyterLabPlugin<void> = {
 /**
  * Activate the FAQ plugin.
  */
-function activateFAQ(app: JupyterLab, palette: ICommandPalette, linker: ICommandLinker, state: IStateDB, layout: ILayoutRestorer): void {
+function activateFAQ(app: JupyterLab, palette: ICommandPalette, linker: ICommandLinker, layout: ILayoutRestorer): void {
   const category = 'Help';
   const command = 'faq-jupyterlab:show';
   const model = new FaqModel();

+ 2 - 6
src/imagewidget/plugin.ts

@@ -21,10 +21,6 @@ import {
   ILayoutRestorer
 } from '../layoutrestorer';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   ImageWidget, ImageWidgetFactory
 } from './widget';
@@ -47,7 +43,7 @@ const FACTORY = 'Image';
 export
 const plugin: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.image-handler',
-  requires: [IDocumentRegistry, ICommandPalette, IStateDB, ILayoutRestorer],
+  requires: [IDocumentRegistry, ICommandPalette, ILayoutRestorer],
   activate: activateImageWidget,
   autoStart: true
 };
@@ -56,7 +52,7 @@ const plugin: JupyterLabPlugin<void> = {
 /**
  * Activate the image widget extension.
  */
-function activateImageWidget(app: JupyterLab, registry: IDocumentRegistry, palette: ICommandPalette, state: IStateDB, layout: ILayoutRestorer): void {
+function activateImageWidget(app: JupyterLab, registry: IDocumentRegistry, palette: ICommandPalette, layout: ILayoutRestorer): void {
   const namespace = 'image-widget';
   const factory = new ImageWidgetFactory({
     name: FACTORY,

+ 2 - 6
src/inspector/plugin.ts

@@ -18,10 +18,6 @@ import {
   ILayoutRestorer
 } from '../layoutrestorer';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   IInspector, Inspector
 } from './';
@@ -33,7 +29,7 @@ import {
 export
 const plugin: JupyterLabPlugin<IInspector> = {
   id: 'jupyter.services.inspector',
-  requires: [ICommandPalette, IStateDB, ILayoutRestorer],
+  requires: [ICommandPalette, ILayoutRestorer],
   provides: IInspector,
   activate: activateInspector
 };
@@ -95,7 +91,7 @@ class InspectorManager implements IInspector {
 /**
  * Activate the console extension.
  */
-function activateInspector(app: JupyterLab, palette: ICommandPalette, state: IStateDB, layout: ILayoutRestorer): IInspector {
+function activateInspector(app: JupyterLab, palette: ICommandPalette, layout: ILayoutRestorer): IInspector {
   const category = 'Inspector';
   const command = 'inspector:open';
   const label = 'Open Inspector';

+ 2 - 8
src/landing/plugin.ts

@@ -25,10 +25,6 @@ import {
   IServiceManager
 } from '../services';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   LandingModel, LandingWidget
 } from './widget';
@@ -40,9 +36,7 @@ import {
 export
 const plugin: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.landing',
-  requires: [
-    IPathTracker, ICommandPalette, IServiceManager, IStateDB, ILayoutRestorer
-  ],
+  requires: [IPathTracker, ICommandPalette, IServiceManager, ILayoutRestorer],
   activate: activateLanding,
   autoStart: true
 };
@@ -53,7 +47,7 @@ const plugin: JupyterLabPlugin<void> = {
 const LANDING_CLASS = 'jp-Landing';
 
 
-function activateLanding(app: JupyterLab, pathTracker: IPathTracker, palette: ICommandPalette, services: IServiceManager, state: IStateDB, layout: ILayoutRestorer): void {
+function activateLanding(app: JupyterLab, pathTracker: IPathTracker, palette: ICommandPalette, services: IServiceManager, layout: ILayoutRestorer): void {
   const category = 'Help';
   const command = 'jupyterlab-landing:show';
   const model = new LandingModel(services.terminals.isAvailable());

+ 2 - 6
src/markdownwidget/plugin.ts

@@ -21,10 +21,6 @@ import {
   IRenderMime
 } from '../rendermime';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   MarkdownWidget, MarkdownWidgetFactory
 } from './widget';
@@ -52,8 +48,8 @@ const FACTORY = 'Rendered Markdown';
 export
 const plugin: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.rendered-markdown',
-  requires: [IDocumentRegistry, IRenderMime, IStateDB, ILayoutRestorer],
-  activate: (app: JupyterLab, registry: IDocumentRegistry, rendermime: IRenderMime, state: IStateDB, layout: ILayoutRestorer) => {
+  requires: [IDocumentRegistry, IRenderMime, ILayoutRestorer],
+  activate: (app: JupyterLab, registry: IDocumentRegistry, rendermime: IRenderMime, layout: ILayoutRestorer) => {
     const factory = new MarkdownWidgetFactory({
       name: FACTORY,
       fileExtensions: ['.md'],

+ 1 - 6
src/notebook/plugin.ts

@@ -46,10 +46,6 @@ import {
   IServiceManager
 } from '../services';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   INotebookTracker, NotebookModelFactory, NotebookPanel, NotebookTracker,
   NotebookWidgetFactory, NotebookActions, Notebook
@@ -135,7 +131,6 @@ const trackerPlugin: JupyterLabPlugin<INotebookTracker> = {
     ICommandPalette,
     IInspector,
     NotebookPanel.IRenderer,
-    IStateDB,
     ILayoutRestorer
   ],
   activate: activateNotebookHandler,
@@ -162,7 +157,7 @@ const rendererPlugin: JupyterLabPlugin<NotebookPanel.IRenderer> = {
 /**
  * Activate the notebook handler extension.
  */
-function activateNotebookHandler(app: JupyterLab, registry: IDocumentRegistry, services: IServiceManager, rendermime: IRenderMime, clipboard: IClipboard, mainMenu: IMainMenu, palette: ICommandPalette, inspector: IInspector, renderer: NotebookPanel.IRenderer, state: IStateDB, layout: ILayoutRestorer): INotebookTracker {
+function activateNotebookHandler(app: JupyterLab, registry: IDocumentRegistry, services: IServiceManager, rendermime: IRenderMime, clipboard: IClipboard, mainMenu: IMainMenu, palette: ICommandPalette, inspector: IInspector, renderer: NotebookPanel.IRenderer, layout: ILayoutRestorer): INotebookTracker {
 
   const factory = new NotebookWidgetFactory({
     name: FACTORY,

+ 2 - 6
src/terminal/plugin.ts

@@ -33,10 +33,6 @@ import {
   IServiceManager
 } from '../services';
 
-import {
-  IStateDB
-} from '../statedb';
-
 import {
   TerminalWidget
 } from './index';
@@ -60,14 +56,14 @@ export
 const plugin: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.terminal',
   requires: [
-    IServiceManager, IMainMenu, ICommandPalette, IStateDB, ILayoutRestorer
+    IServiceManager, IMainMenu, ICommandPalette, ILayoutRestorer
   ],
   activate: activateTerminal,
   autoStart: true
 };
 
 
-function activateTerminal(app: JupyterLab, services: IServiceManager, mainMenu: IMainMenu, palette: ICommandPalette, state: IStateDB, layout: ILayoutRestorer): void {
+function activateTerminal(app: JupyterLab, services: IServiceManager, mainMenu: IMainMenu, palette: ICommandPalette, layout: ILayoutRestorer): void {
   // Bail if there are no terminals available.
   if (!services.terminals.isAvailable()) {
     console.log('Disabling terminals plugin because they are not available on the server');