Browse Source

IDefaultTheme => IRecoveryTheme

Afshin Darian 7 years ago
parent
commit
0d3d11b61e

+ 14 - 0
packages/apputils/src/thememanager.ts

@@ -31,6 +31,20 @@ import {
 
 
 /* tslint:disable */
+/**
+ * The application recovery theme token.
+ */
+export
+const IRecoveryTheme = new Token('@jupyterlab/apputils:IRecoveryTheme');
+
+
+/**
+ * The application recovery theme interface.
+ */
+export
+interface IRecoveryTheme {}
+
+
 /**
  * The theme manager token.
  */

+ 3 - 7
packages/theme-dark-extension/src/index.ts

@@ -16,15 +16,11 @@ import {
 const plugin: JupyterLabPlugin<void> = {
   id: '@jupyterlab/theme-dark-extension:plugin',
   requires: [IThemeManager],
-  activate: function(app: JupyterLab, manager: IThemeManager) {
+  activate: (app: JupyterLab, manager: IThemeManager) => {
     manager.register({
       name: 'JupyterLab Dark',
-      load: function() {
-        return manager.loadCSS('@jupyterlab/theme-dark-extension/index.css');
-      },
-      unload: function() {
-        return Promise.resolve(void 0);
-      }
+      load: () => manager.loadCSS('@jupyterlab/theme-dark-extension/index.css'),
+      unload: () => Promise.resolve(undefined)
     });
   },
   autoStart: true

+ 27 - 9
packages/theme-light-extension/src/index.ts

@@ -6,29 +6,47 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  IThemeManager
+  IRecoveryTheme, IThemeManager
 } from '@jupyterlab/apputils';
 
 
+/**
+ * The Jupyter Light Theme stylesheet.
+ */
+const style = '@jupyterlab/theme-light-extension/index.css';
+
+
 /**
  * A plugin for the Jupyter Light Theme.
  */
-const plugin: JupyterLabPlugin<void> = {
+const theme: JupyterLabPlugin<void> = {
   id: '@jupyterlab/theme-light-extension:plugin',
   requires: [IThemeManager],
   activate: function(app: JupyterLab, manager: IThemeManager) {
     manager.register({
       name: 'JupyterLab Light',
-      load: function() {
-        return manager.loadCSS('@jupyterlab/theme-light-extension/index.css');
-      },
-      unload: function() {
-        return Promise.resolve(void 0);
-      }
+      load: () => manager.loadCSS(style),
+      unload: () => Promise.resolve(undefined)
     });
   },
   autoStart: true
 };
 
 
-export default plugin;
+/**
+ * A plugin for the Jupyter Light Theme.
+ */
+const recoveryTheme: JupyterLabPlugin<IRecoveryTheme> = {
+  id: '@jupyterlab/theme-light-extension:recovery',
+  requires: [IThemeManager],
+  activate: (app: JupyterLab, manager: IThemeManager) => manager.loadCSS(style),
+  autoStart: true,
+  provides: IRecoveryTheme
+};
+
+
+/**
+ * Export the plugins as default.
+ */
+const plugins: JupyterLabPlugin<any>[] = [theme, recoveryTheme];
+export default plugins;