Browse Source

Remove the landing extension

Steven Silvester 8 years ago
parent
commit
1423d06370

+ 0 - 1
examples/app/index.js

@@ -23,7 +23,6 @@ var mods = [
   require('@jupyterlab/help-extension'),
   require('@jupyterlab/imageviewer-extension'),
   require('@jupyterlab/inspector-extension'),
-  require('@jupyterlab/landing-extension'),
   require('@jupyterlab/launcher-extension'),
   require('@jupyterlab/markdownviewer-extension'),
   require('@jupyterlab/notebook-extension'),

+ 0 - 1
examples/app/package.json

@@ -22,7 +22,6 @@
     "@jupyterlab/help-extension": "^0.6.0",
     "@jupyterlab/imageviewer-extension": "^0.6.0",
     "@jupyterlab/inspector-extension": "^0.6.0",
-    "@jupyterlab/landing-extension": "^0.7.1",
     "@jupyterlab/launcher-extension": "^0.6.1",
     "@jupyterlab/markdownviewer-extension": "^0.6.0",
     "@jupyterlab/notebook-extension": "^0.6.0",

+ 0 - 1
jupyterlab/package.json

@@ -24,7 +24,6 @@
     "@jupyterlab/help-extension": "^0.6.0",
     "@jupyterlab/imageviewer-extension": "^0.6.0",
     "@jupyterlab/inspector-extension": "^0.6.0",
-    "@jupyterlab/landing-extension": "^0.7.1",
     "@jupyterlab/launcher-extension": "^0.6.1",
     "@jupyterlab/markdownviewer-extension": "^0.6.0",
     "@jupyterlab/notebook-extension": "^0.6.0",

+ 0 - 1
packages/all-packages/package.json

@@ -44,7 +44,6 @@
     "@jupyterlab/imageviewer-extension": "^0.6.0",
     "@jupyterlab/inspector": "^0.6.0",
     "@jupyterlab/inspector-extension": "^0.6.0",
-    "@jupyterlab/landing-extension": "^0.7.1",
     "@jupyterlab/launcher": "^0.6.0",
     "@jupyterlab/launcher-extension": "^0.6.1",
     "@jupyterlab/markdownviewer": "^0.6.0",

+ 0 - 1
packages/all-packages/src/index.ts

@@ -32,7 +32,6 @@ import "@jupyterlab/imageviewer";
 import "@jupyterlab/imageviewer-extension";
 import "@jupyterlab/inspector";
 import "@jupyterlab/inspector-extension";
-import "@jupyterlab/landing-extension";
 import "@jupyterlab/launcher";
 import "@jupyterlab/launcher-extension";
 import "@jupyterlab/markdownviewer";

+ 0 - 45
packages/landing-extension/package.json

@@ -1,45 +0,0 @@
-{
-  "name": "@jupyterlab/landing-extension",
-  "version": "0.7.1",
-  "description": "JupyterLab - Landing Page Extension",
-  "main": "lib/index.js",
-  "types": "lib/index.d.ts",
-  "files": [
-    "lib/*.d.ts",
-    "lib/*.js",
-    "style/*.css"
-  ],
-  "directories": {
-    "lib": "lib/"
-  },
-  "dependencies": {
-    "@jupyterlab/application": "^0.6.0",
-    "@jupyterlab/apputils": "^0.6.0",
-    "@jupyterlab/filebrowser": "^0.6.1",
-    "@jupyterlab/services": "^0.45.0",
-    "@phosphor/messaging": "^1.2.0",
-    "@phosphor/virtualdom": "^1.1.0"
-  },
-  "devDependencies": {
-    "rimraf": "^2.5.2",
-    "typescript": "^2.2.1"
-  },
-  "scripts": {
-    "build": "tsc",
-    "clean": "rimraf lib",
-    "watch": "tsc -w"
-  },
-  "jupyterlab": {
-    "extension": true
-  },
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/jupyterlab/jupyterlab.git"
-  },
-  "author": "Project Jupyter",
-  "license": "BSD-3-Clause",
-  "bugs": {
-    "url": "https://github.com/jupyterlab/jupyterlab/issues"
-  },
-  "homepage": "https://github.com/jupyterlab/jupyterlab"
-}

+ 0 - 106
packages/landing-extension/src/index.ts

@@ -1,106 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-import {
-  JupyterLab, JupyterLabPlugin
-} from '@jupyterlab/application';
-
-import {
-  ICommandLinker, ICommandPalette, ILayoutRestorer, InstanceTracker
-} from '@jupyterlab/apputils';
-
-import {
-  IServiceManager
-} from '@jupyterlab/services';
-
-import {
-  LandingModel, LandingWidget
-} from './widget';
-
-
-import '../style/index.css';
-
-
-/**
- * The command IDs used by the landing plugin.
- */
-namespace CommandIDs {
-  export
-  const open = 'landing-jupyterlab:open';
-};
-
-
-/**
- * The class name added to the landing plugin.
- */
-const LANDING_CLASS = 'jp-Landing';
-
-/**
- * The landing page extension.
- */
-const plugin: JupyterLabPlugin<void> = {
-  activate,
-  id: 'jupyter.extensions.landing',
-  requires: [ICommandLinker, ICommandPalette, IServiceManager, ILayoutRestorer],
-  autoStart: true
-};
-
-
-/**
- * Export the plugin as default.
- */
-export default plugin;
-
-
-/**
- * Activate the landing plugin.
- */
-function activate(app: JupyterLab, linker: ICommandLinker, palette: ICommandPalette, services: IServiceManager, restorer: ILayoutRestorer): void {
-  const { commands, shell } = app;
-  const category = 'Help';
-  const command = CommandIDs.open;
-  const model = new LandingModel(
-    services.terminals.isAvailable(), app.info.version
-  );
-  const tracker = new InstanceTracker<LandingWidget>({ namespace: 'landing' });
-
-  // Handle state restoration.
-  restorer.restore(tracker, {
-    command,
-    args: () => null,
-    name: () => 'landing'
-  });
-
-  let widget: LandingWidget;
-
-  function newWidget(): LandingWidget {
-    let widget = new LandingWidget(linker);
-    widget.model = model;
-    widget.id = 'landing-jupyterlab';
-    widget.title.label = 'Landing';
-    widget.title.closable = true;
-    widget.addClass(LANDING_CLASS);
-    tracker.add(widget);
-    return widget;
-  }
-
-  commands.addCommand(command, {
-    label: 'Open Landing',
-    execute: () => {
-      if (!widget || widget.isDisposed) {
-        widget = newWidget();
-        shell.addToMainArea(widget);
-      }
-      shell.activateById(widget.id);
-    }
-  });
-
-  palette.addItem({ category, command });
-
-  // Only create a landing page if there are no other tabs open.
-  app.restored.then(() => {
-    if (shell.isEmpty('main')) {
-      commands.execute(command, void 0);
-    }
-  });
-}

+ 0 - 206
packages/landing-extension/src/widget.ts

@@ -1,206 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-import {
-  ICommandLinker, VDomModel, VDomRenderer
-} from '@jupyterlab/apputils';
-
-import {
-  JSONObject
-} from '@phosphor/coreutils';
-
-import {
-  Message
-} from '@phosphor/messaging';
-
-import {
-  h, VirtualNode
-} from '@phosphor/virtualdom';
-
-
-/**
- * The class name added to the landing scroll wrapper.
- */
-const LANDING_WRAPPER_CLASS = 'jp-Landing-wrapper';
-
-/**
- * The class name added to the landing header section.
- */
-const LANDING_HEADER_CLASS = 'jp-Landing-header';
-
-
-const LANDING_HEADER_CONTAINER_CLASS = 'jp-Landing-header-container';
-
-/**
- * The class name for the JupyterLab icon from default-theme.
- */
-const JUPYTERLAB_ICON_CLASS = 'jp-ImageJupyterLab';
-
-/**
- * The class name added to specify size of the JupyterLab logo.
- */
-const LANDING_LOGO_CLASS = 'jp-Landing-logo';
-
-/**
- * The class name added to the preview message subtitle.
- */
-const LANDING_SUBTITLE_CLASS = 'jp-Landing-subtitle';
-
-/**
- * The class name added to the header text.
- */
-const LANDING_BODY_HEADER_CLASS = 'jp-Landing-body-header';
-
-/**
- * The class name added to the dialog body.
- */
-const LANDING_BODY_CLASS = 'jp-Landing-body';
-
-
-const LANDING_BODY_CONTAINER_CLASS = 'jp-Landing-body-container';
-/**
- * The class name added to the column of the dialog.
- */
-const LANDING_COLUMN_CLASS = 'jp-Landing-column';
-
-/**
- * The class name added to specify size of activity icons.
- */
-const LANDING_ICON_CLASS = 'jp-Landing-image';
-
-/**
- * The class name added to the image text of an activity.
- */
-const LANDING_TEXT_CLASS = 'jp-Landing-text';
-
-
-/**
- * LandingModel holds text data which the LandingWidget will render.
- */
-export
-class LandingModel extends VDomModel {
-  /**
-   * Preview messages.
-   */
-  readonly previewMessage: string;
-
-  /**
-   * The `Start a new activity` text.
-   */
-  readonly headerText: string;
-
-  /**
-   * The names of activities and their associated commands.
-   */
-  readonly activities: [string, string, JSONObject][];
-
-  /**
-   * Construct a new landing model.
-   */
-  constructor(terminalsAvailable = false, version: string) {
-    super();
-    this.previewMessage = `alpha (v${version})`;
-    this.headerText = 'Start a new activity';
-
-    const createFrom = 'file-operations:create-from';
-    this.activities = [
-      ['Notebook', createFrom, { creatorName: 'Notebook' }],
-      ['Code Console', 'console:create', undefined],
-      ['Text Editor', createFrom, { creatorName: 'Text File' }]
-    ];
-
-    if (terminalsAvailable) {
-      this.activities.push(['Terminal', 'terminal:create-new', undefined]);
-    }
-  }
-}
-
-/**
- * A virtual-DOM-based widget for the Landing plugin.
- */
-export
-class LandingWidget extends VDomRenderer<LandingModel> {
-  /**
-   * Construct a new landing widget.
-   */
-  constructor(linker: ICommandLinker) {
-    super();
-    this._linker = linker;
-  }
-
-  /**
-   * Handle `'activate-request'` messages.
-   */
-  protected onActivateRequest(msg: Message): void {
-    this.node.tabIndex = -1;
-    this.node.focus();
-  }
-
-  /**
-   * Handle `'close-request'` messages.
-   */
-  protected onCloseRequest(msg: Message): void {
-    super.onCloseRequest(msg);
-    this.dispose();
-  }
-
-  /**
-   * Render the landing plugin to virtual DOM nodes.
-   */
-  protected render(): VirtualNode {
-    let activitiesList: VirtualNode[] = [];
-    let activites = this.model.activities;
-    for (let activityName of activites) {
-      let name = activityName[0];
-      let command = activityName[1];
-      let args = activityName[2];
-      let imgName = name.replace(' ', '');
-      let column = h.div({ className: LANDING_COLUMN_CLASS },
-        h.span({
-          className: LANDING_ICON_CLASS + ` jp-Image${imgName}` ,
-          dataset: this._linker.populateVNodeDataset(command, args)
-        }),
-        h.span({ className: LANDING_TEXT_CLASS }, name)
-      );
-      activitiesList.push(column);
-    }
-
-    let logo = h.span({
-      className: `${JUPYTERLAB_ICON_CLASS} ${LANDING_LOGO_CLASS}`
-    });
-    let subtitle = h.span(
-      {className: LANDING_SUBTITLE_CLASS},
-      this.model.previewMessage
-    );
-
-    let bodyheader = h.span({
-      className: LANDING_BODY_HEADER_CLASS
-    }, this.model.headerText);
-
-    let header = h.div({ className: LANDING_HEADER_CLASS},
-      logo,
-      subtitle,
-    );
-
-    let body = h.div({ className: LANDING_BODY_CLASS },
-      activitiesList
-    );
-
-    let headercontainer = h.div({className: LANDING_HEADER_CONTAINER_CLASS},
-      header
-    );
-
-    let bodycontainer = h.div({ className: LANDING_BODY_CONTAINER_CLASS},
-      body
-    );
-
-    let landing = h.div({ className: LANDING_WRAPPER_CLASS },
-      headercontainer,
-      bodyheader,
-      bodycontainer
-    );
-    return landing;
-  }
-
-  private _linker: ICommandLinker;
-}

+ 0 - 151
packages/landing-extension/style/index.css

@@ -1,151 +0,0 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-
-
-.jp-Landing {
-  outline: none;
-  position: absolute;
-  top: 0px;
-  left: 0px;
-  margin: 0;
-  padding: 0;
-  overflow: auto;
-}
-
-
-
-.jp-Landing-wrapper {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  width: 100%;
-  height: 100%;
-  background-color: var(--md-grey-200);
-}
-
-
-.jp-Landing-header-container {
-  width: 100%;
-  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
-  background-color: var(--jp-layout-color0);
-}
-
-
-.jp-Landing-header {
-  margin: auto;
-  font-size: var(--jp-ui-font-size1);
-  color: var(--jp-ui-font-color1);
-  background: var(--jp-layout-color1);
-  text-align: center;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  flex-direction: column;
-  padding-top: 28px;
-  padding-bottom: 28px;
-}
-
-.jp-Landing-body-container {
-  width: 100%;
-  padding-top: 8px;
-}
-
-.jp-Landing-body {
-  padding-bottom: 12px;
-  font-size: var(--jp-ui-font-size1);
-  color: var(--jp-ui-font-color1);
-  background-color: var(--md-grey-200);
-  margin-left: auto;
-  margin-right: auto;
-  text-align: center;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  flex-direction: column;
-}
-
-.jp-Landing-header-wrapper {
-  width: 100%;
-  height: 120px;
-}
-
-
-.jp-Landing-logo {
-  flex: 0 0 50px;
-  margin-left: auto;
-  margin-right: auto;
-  width: 232px;
-  background-color: var(--jp-layout-color1);
-  background-size: 232px 50px;
-  background-repeat: no-repeat;
-  background-position: center;
-}
-
-.jp-Landing-subtitle {
-  color: var(--md-grey-600);
-  background-color: var(--jp-layout-color1);
-  font-size: var(--jp-ui-font-size2);
-  width: 200px;
-  font-weight: 400;
-  letter-spacing: .4px;
-  text-align: left;
-  padding-left: 68px;
-}
-
-.jp-Landing-body-header {
-  padding-top: 16px;
-  padding-bottom: 4px;
-  font-size: var(--jp-ui-font-size2);
-  color: var(--md-grey-600);
-  letter-spacing: .4px;
-}
-
-
-.jp-Landing-body {
-  display: flex;
-  flex-direction: row;
-  flex-wrap: wrap;
-  padding-left: 20px;
-  padding-right: 20px;
-}
-
-
-.jp-Landing-column {
-  height: 150px;
-  width: 150px;
-  margin: 8px;
-  display: flex;
-  flex-direction: column;
-  cursor: pointer;
-  background-color: white;
-  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
-  transition: all 0.3s cubic-bezier(.25,.8,.25,1);
-}
-
-.jp-Landing-column:hover {
-  box-shadow: 0 4px 4px rgba(0,0,0,0.20), 0 4px 12px rgba(0,0,0,0.22);
-}
-
-
-.jp-Landing-image {
-  flex: 0 0 auto;
-  min-height: 88px;
-  min-width: 72px;
-  max-width: 72px;
-  background-size: 72px 88px;
-  background-repeat: no-repeat;
-  margin: auto;
-}
-
-.jp-Landing-image:hover {
-  cursor: pointer;
-}
-
-.jp-Landing-text {
-  flex: 0 0 auto;
-  font-size: var(--jp-ui-font-size2);
-  padding-bottom: 16px;
-}
-

+ 0 - 15
packages/landing-extension/tsconfig.json

@@ -1,15 +0,0 @@
-{
-  "compilerOptions": {
-    "declaration": true,
-    "noImplicitAny": true,
-    "noEmitOnError": true,
-    "noUnusedLocals": true,
-    "module": "commonjs",
-    "moduleResolution": "node",
-    "target": "ES5",
-    "outDir": "./lib",
-    "lib": ["ES5", "ES2015.Promise", "DOM", "ES2015.Collection"],
-    "types": []
-  },
-  "include": ["src/*"]
-}