Browse Source

Merge pull request #1537 from blink1073/refactor-notebook

Flatten the notebook directory
Afshin Darian 8 years ago
parent
commit
fc3d2230c8

+ 1 - 1
src/cells/model.ts

@@ -31,7 +31,7 @@ import {
 
 
 import {
 import {
   IMetadataCursor, MetadataCursor
   IMetadataCursor, MetadataCursor
-} from '../notebook/common/metadata';
+} from '../common/metadata';
 
 
 import {
 import {
   IOutputAreaModel, OutputAreaModel
   IOutputAreaModel, OutputAreaModel

+ 1 - 1
src/cells/widget.ts

@@ -31,7 +31,7 @@ import {
 
 
 import {
 import {
   IMetadataCursor
   IMetadataCursor
-} from '../notebook/common/metadata';
+} from '../common/metadata';
 
 
 import {
 import {
   OutputAreaWidget
   OutputAreaWidget

+ 0 - 0
src/notebook/common/metadata.ts → src/common/metadata.ts


+ 1 - 5
src/notebook/common/undo.ts → src/common/undoablevector.ts

@@ -9,13 +9,9 @@ import {
   each
   each
 } from 'phosphor/lib/algorithm/iteration';
 } from 'phosphor/lib/algorithm/iteration';
 
 
-import {
-  Vector
-} from 'phosphor/lib/collections/vector';
-
 import {
 import {
   IObservableVector, ObservableVector
   IObservableVector, ObservableVector
-} from '../../common/observablevector';
+} from './observablevector';
 
 
 
 
 /**
 /**

+ 1 - 1
src/notebook/notebook/actions.ts → src/notebook/actions.ts

@@ -20,7 +20,7 @@ import {
 import {
 import {
   ICellModel, ICodeCellModel,
   ICellModel, ICodeCellModel,
   CodeCellWidget, BaseCellWidget, MarkdownCellWidget
   CodeCellWidget, BaseCellWidget, MarkdownCellWidget
-} from '../../cells';
+} from '../cells';
 
 
 import {
 import {
   INotebookModel
   INotebookModel

+ 2 - 2
src/notebook/notebook/default-toolbar.ts → src/notebook/default-toolbar.ts

@@ -19,14 +19,14 @@ import {
 
 
 import {
 import {
   ToolbarButton
   ToolbarButton
-} from '../../toolbar';
+} from '../toolbar';
 
 
 import {
 import {
   createInterruptButton,
   createInterruptButton,
   createRestartButton,
   createRestartButton,
   createKernelNameItem,
   createKernelNameItem,
   createKernelStatusItem
   createKernelStatusItem
-} from '../../toolbar/kernel';
+} from '../toolbar/kernel';
 
 
 import {
 import {
   Notebook
   Notebook

+ 101 - 2
src/notebook/index.css

@@ -17,6 +17,105 @@
 | Imports
 | Imports
 |----------------------------------------------------------------------------*/
 |----------------------------------------------------------------------------*/
 
 
-
-@import './notebook/index.css';
 @import './toolbar.css';
 @import './toolbar.css';
+
+
+
+/*-----------------------------------------------------------------------------
+| Notebook
+|----------------------------------------------------------------------------*/
+
+
+.jp-Notebook {
+  padding-left: var(--jp-private-notebook-padding);
+  padding-right: var(--jp-private-notebook-padding);
+  padding-top: var(--jp-private-notebook-padding);
+  padding-bottom: calc(4*var(--jp-private-notebook-padding));
+  min-width: 50px;
+  min-height: 50px;
+  outline: none;
+  overflow: auto;
+  background: var(--jp-layout-color1);
+}
+
+
+.jp-Notebook-panel {
+  display: flex;
+  flex-direction: column;
+  height: 100%;
+}
+
+
+.jp-Notebook.jp-mod-commandMode .jp-Notebook-cell.jp-mod-active.jp-mod-selected{
+  border-color: #ABABAB;
+  border-left-width: var(--jp-border-width);
+  background: linear-gradient(to right, #42A5F5 -40px, #42A5F5 5px, transparent 5px, transparent 100%);
+}
+
+
+.jp-Notebook.jp-mod-commandMode .jp-Notebook-cell.jp-mod-multiSelected.jp-mod-active {
+  background: linear-gradient(to right, #42A5F5 -40px, #42A5F5 7px, #E3F2FD 7px, #E3F2FD 100%);
+}
+
+
+.jp-Notebook.jp-mod-commandMode .jp-Notebook-cell.jp-mod-selected {
+  background: #E3F2FD;
+}
+
+
+.jp-Notebook.jp-mod-editMode .jp-Notebook-cell.jp-mod-active {
+  border-color: #66BB6A;
+  border-left-width: var(--jp-border-width);
+  background: linear-gradient(to right, #66BB6A -40px, #66BB6A 5px, transparent 5px, transparent 100%);
+}
+
+
+.jp-NotebookContainer-widget {
+  flex: 0 0 auto;
+}
+
+
+.jp-Notebook {
+  flex: 1 1 auto;
+}
+
+
+.jp-Notebook-cell.jp-mod-dropSource {
+  opacity: 0.5;
+}
+
+
+.jp-Notebook-cell.jp-mod-dropTarget, 
+.jp-Notebook.jp-mod-commandMode .jp-Notebook-cell.jp-mod-active.jp-mod-selected.jp-mod-dropTarget {
+  border-top-color: #42A5F5;
+}
+
+
+.jp-Notebook-cell .jp-Cell-prompt {
+  cursor: move;
+}
+
+.jp-dragImage {
+  position: absolute;
+  width: 50px;
+  height: 50px;
+  border: 1px solid #ABABAB;
+  background: linear-gradient(to right, #42A5F5 -40px, #42A5F5 5px, white 5px, white 100%);
+}
+
+
+.jp-dragImage .jp-filledCircle {
+    position: absolute;
+    left: 10px;
+    top: 10px;
+    border-radius: 50%;
+
+    width: 30px;
+    height: 30px;
+
+    background: #66BB6A;
+    border: 1px solid #ABABAB;
+    color: white;
+    text-align: center;
+    line-height: 30px;
+}

+ 8 - 1
src/notebook/index.ts

@@ -1,5 +1,12 @@
 // Copyright (c) Jupyter Development Team.
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 // Distributed under the terms of the Modified BSD License.
 
 
-export * from './notebook/index';
+export * from './actions';
+export * from './default-toolbar';
+export * from './model';
+export * from './modelfactory';
+export * from './panel';
 export * from './tracker';
 export * from './tracker';
+export * from './trust';
+export * from './widget';
+export * from './widgetfactory';

+ 5 - 5
src/notebook/notebook/model.ts → src/notebook/model.ts

@@ -23,20 +23,20 @@ import {
 
 
 import {
 import {
   IObservableVector, ObservableVector
   IObservableVector, ObservableVector
-} from '../../common/observablevector';
+} from '../common/observablevector';
 
 
 import {
 import {
   DocumentModel, DocumentRegistry
   DocumentModel, DocumentRegistry
-} from '../../docregistry';
+} from '../docregistry';
 
 
 import {
 import {
   ICellModel, ICodeCellModel, IRawCellModel, IMarkdownCellModel,
   ICellModel, ICodeCellModel, IRawCellModel, IMarkdownCellModel,
   CodeCellModel, RawCellModel, MarkdownCellModel, CellModel
   CodeCellModel, RawCellModel, MarkdownCellModel, CellModel
-} from '../../cells/model';
+} from '../cells/model';
 
 
 import {
 import {
   IChangedArgs
   IChangedArgs
-} from '../../common/interfaces';
+} from '../common/interfaces';
 
 
 import {
 import {
   IMetadataCursor, MetadataCursor
   IMetadataCursor, MetadataCursor
@@ -44,7 +44,7 @@ import {
 
 
 import {
 import {
   IObservableUndoableVector, ObservableUndoableVector
   IObservableUndoableVector, ObservableUndoableVector
-} from '../common/undo';
+} from '../common/undoablevector';
 
 
 
 
 /**
 /**

+ 2 - 2
src/notebook/notebook/modelfactory.ts → src/notebook/modelfactory.ts

@@ -7,11 +7,11 @@ import {
 
 
 import {
 import {
   DocumentRegistry
   DocumentRegistry
-} from '../../docregistry';
+} from '../docregistry';
 
 
 import {
 import {
   CodeCellModel
   CodeCellModel
-} from '../../cells';
+} from '../cells';
 
 
 import {
 import {
   INotebookModel, NotebookModel
   INotebookModel, NotebookModel

+ 0 - 99
src/notebook/notebook/index.css

@@ -1,99 +0,0 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-
-
-.jp-Notebook {
-  padding-left: var(--jp-private-notebook-padding);
-  padding-right: var(--jp-private-notebook-padding);
-  padding-top: var(--jp-private-notebook-padding);
-  padding-bottom: calc(4*var(--jp-private-notebook-padding));
-  min-width: 50px;
-  min-height: 50px;
-  outline: none;
-  overflow: auto;
-  background: var(--jp-layout-color1);
-}
-
-
-.jp-Notebook-panel {
-  display: flex;
-  flex-direction: column;
-  height: 100%;
-}
-
-
-.jp-Notebook.jp-mod-commandMode .jp-Notebook-cell.jp-mod-active.jp-mod-selected{
-  border-color: #ABABAB;
-  border-left-width: var(--jp-border-width);
-  background: linear-gradient(to right, #42A5F5 -40px, #42A5F5 5px, transparent 5px, transparent 100%);
-}
-
-
-.jp-Notebook.jp-mod-commandMode .jp-Notebook-cell.jp-mod-multiSelected.jp-mod-active {
-  background: linear-gradient(to right, #42A5F5 -40px, #42A5F5 7px, #E3F2FD 7px, #E3F2FD 100%);
-}
-
-
-.jp-Notebook.jp-mod-commandMode .jp-Notebook-cell.jp-mod-selected {
-  background: #E3F2FD;
-}
-
-
-.jp-Notebook.jp-mod-editMode .jp-Notebook-cell.jp-mod-active {
-  border-color: #66BB6A;
-  border-left-width: var(--jp-border-width);
-  background: linear-gradient(to right, #66BB6A -40px, #66BB6A 5px, transparent 5px, transparent 100%);
-}
-
-
-.jp-NotebookContainer-widget {
-  flex: 0 0 auto;
-}
-
-
-.jp-Notebook {
-  flex: 1 1 auto;
-}
-
-
-.jp-Notebook-cell.jp-mod-dropSource {
-  opacity: 0.5;
-}
-
-
-.jp-Notebook-cell.jp-mod-dropTarget, 
-.jp-Notebook.jp-mod-commandMode .jp-Notebook-cell.jp-mod-active.jp-mod-selected.jp-mod-dropTarget {
-  border-top-color: #42A5F5;
-}
-
-
-.jp-Notebook-cell .jp-Cell-prompt {
-  cursor: move;
-}
-
-.jp-dragImage {
-  position: absolute;
-  width: 50px;
-  height: 50px;
-  border: 1px solid #ABABAB;
-  background: linear-gradient(to right, #42A5F5 -40px, #42A5F5 5px, white 5px, white 100%);
-}
-
-
-.jp-dragImage .jp-filledCircle {
-    position: absolute;
-    left: 10px;
-    top: 10px;
-    border-radius: 50%;
-
-    width: 30px;
-    height: 30px;
-
-    background: #66BB6A;
-    border: 1px solid #ABABAB;
-    color: white;
-    text-align: center;
-    line-height: 30px;
-}

+ 0 - 12
src/notebook/notebook/index.ts

@@ -1,12 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-
-export * from './actions';
-export * from './default-toolbar';
-export * from './model';
-export * from './modelfactory';
-export * from './panel';
-export * from './trust';
-export * from './widget';
-export * from './widgetfactory';
-

+ 0 - 121
src/notebook/notebook/toolbar.css

@@ -1,121 +0,0 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-
-
-.jp-NBToolbar {
-  color: var(--jp-ui-font-color1);
-  flex: 0 0 auto;
-  display: flex;
-  flex-direction: row;
-  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
-  height: 24px;
-}
-
-
-.jp-NBToolbar > .jp-NBToolbar-item {
-  flex: 0 0 auto;
-  padding-left: 8px;
-  padding-right: 8px;
-  vertical-align: middle;
-  font-size: 14px;
-  line-height: 23px;
-}
-
-
-.jp-NBToolbar-item.jp-NBToolbar-button,
-.jp-NBToolbar-item.jp-NBToolbar-kernelIndicator {
-  font-family: FontAwesome;
-  text-align: center;
-  display: inline-block;
-}
-
-
-.jp-NBToolbar-item.jp-NBToolbar-cellType select {
-    background: #FFFFFF;
-}
-
-.jp-NBToolbar-cellType .jp-NBToolbar-cellTypeDropdown {
-    border: var(--jp-border-width) solid var(--jp-border-color1);
-    border-radius: 0;
-    outline: none;
-    width: 100%;
-    font-size: 14px;
-    line-height: 23px;
-}
-
-
-.jp-NBToolbar-item.jp-NBToolbar-kernelName {
-    text-align: right;
-    flex-grow: 1;
-    flex-shrink: 1;
-}
-
-
-.jp-NBToolbar-item.jp-NBToolbar-kernelIndicator {
-    border-right: none;
-}
-
-
-.jp-NBToolbar-button.jp-mod-pressed {
-    background-color: #E0E0E0;
-    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
-}
-
-
-.jp-NBToolbar-button:hover {
-    background-color: #EEEEEE;
-    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
-}
-
-
-.jp-NBToolbar-button.jp-NBToolbar-save::before {
-   content: "\f0c7";  /* Save */
-}
-
-
-.jp-NBToolbar-button.jp-NBToolbar-insert::before {
-   content: "\f067";  /* Plus */
-}
-
-
-.jp-NBToolbar-button.jp-NBToolbar-cut::before {
-   content: "\f0c4";  /* Cut */
-}
-
-
-.jp-NBToolbar-button.jp-NBToolbar-copy::before {
-   content: "\f0c5";  /* Copy */
-}
-
-
-.jp-NBToolbar-button.jp-NBToolbar-paste::before {
-   content: "\f0ea";  /* Paste */
-}
-
-
-.jp-NBToolbar-button.jp-NBToolbar-run::before {
-   content: "\f051";  /* Step-forward */
-}
-
-
-.jp-NBToolbar-button.jp-NBToolbar-interrupt::before {
-   content: "\f04d";  /* Stop */
-}
-
-
-.jp-NBToolbar-button.jp-NBToolbar-restart::before {
-   content: "\f01e";  /* Rotate-right */
-}
-
-
-.jp-NBToolbar-item.jp-NBToolbar-kernelIndicator::before {
-    content: "\f10c";  /* Circle-o */
-}
-
-
-.jp-NBToolbar-item.jp-NBToolbar-kernelIndicator.jp-mod-busy::before {
-    content: "\f111";  /* Circle */
-}
-

+ 18 - 18
src/notebook/notebook/panel.ts → src/notebook/panel.ts

@@ -29,46 +29,46 @@ import {
   Widget
   Widget
 } from 'phosphor/lib/ui/widget';
 } from 'phosphor/lib/ui/widget';
 
 
+import {
+  BaseCellWidget, CodeCellWidget
+} from '../cells';
+
 import {
 import {
   IEditorMimeTypeService, CodeEditor
   IEditorMimeTypeService, CodeEditor
-} from '../../codeeditor';
+} from '../codeeditor';
+
+import {
+  CompleterModel, CompleterWidget, CompletionHandler
+} from '../completer';
 
 
 import {
 import {
   IChangedArgs
   IChangedArgs
-} from '../../common/interfaces';
+} from '../common/interfaces';
 
 
 import {
 import {
   DocumentRegistry
   DocumentRegistry
-} from '../../docregistry';
+} from '../docregistry';
 
 
 import {
 import {
   InspectionHandler
   InspectionHandler
-} from '../../inspector';
-
-import {
-  RenderMime
-} from '../../rendermime';
+} from '../inspector';
 
 
 import {
 import {
-  CompleterModel, CompleterWidget, CompletionHandler
-} from '../../completer';
+  OutputAreaWidget
+} from '../outputarea';
 
 
 import {
 import {
-  BaseCellWidget, CodeCellWidget
-} from '../../cells';
+  RenderMime
+} from '../rendermime';
 
 
 import {
 import {
-  OutputAreaWidget
-} from '../../outputarea';
+  Toolbar
+} from '../toolbar';
 
 
 import {
 import {
   INotebookModel
   INotebookModel
 } from './model';
 } from './model';
 
 
-import {
-  Toolbar
-} from '../../toolbar';
-
 import {
 import {
   Notebook
   Notebook
 } from './widget';
 } from './widget';

+ 117 - 0
src/notebook/toolbar.css

@@ -58,3 +58,120 @@
 .jp-Notebook-toolbarRun::before {
 .jp-Notebook-toolbarRun::before {
   content: "\f051";  /* step-forward */
   content: "\f051";  /* step-forward */
 }
 }
+
+
+.jp-NBToolbar {
+  color: var(--jp-ui-font-color1);
+  flex: 0 0 auto;
+  display: flex;
+  flex-direction: row;
+  border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
+  height: 24px;
+}
+
+
+.jp-NBToolbar > .jp-NBToolbar-item {
+  flex: 0 0 auto;
+  padding-left: 8px;
+  padding-right: 8px;
+  vertical-align: middle;
+  font-size: 14px;
+  line-height: 23px;
+}
+
+
+.jp-NBToolbar-item.jp-NBToolbar-button,
+.jp-NBToolbar-item.jp-NBToolbar-kernelIndicator {
+  font-family: FontAwesome;
+  text-align: center;
+  display: inline-block;
+}
+
+
+.jp-NBToolbar-item.jp-NBToolbar-cellType select {
+    background: #FFFFFF;
+}
+
+.jp-NBToolbar-cellType .jp-NBToolbar-cellTypeDropdown {
+    border: var(--jp-border-width) solid var(--jp-border-color1);
+    border-radius: 0;
+    outline: none;
+    width: 100%;
+    font-size: 14px;
+    line-height: 23px;
+}
+
+
+.jp-NBToolbar-item.jp-NBToolbar-kernelName {
+    text-align: right;
+    flex-grow: 1;
+    flex-shrink: 1;
+}
+
+
+.jp-NBToolbar-item.jp-NBToolbar-kernelIndicator {
+    border-right: none;
+}
+
+
+.jp-NBToolbar-button.jp-mod-pressed {
+    background-color: #E0E0E0;
+    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
+}
+
+
+.jp-NBToolbar-button:hover {
+    background-color: #EEEEEE;
+    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
+}
+
+
+.jp-NBToolbar-button.jp-NBToolbar-save::before {
+   content: "\f0c7";  /* Save */
+}
+
+
+.jp-NBToolbar-button.jp-NBToolbar-insert::before {
+   content: "\f067";  /* Plus */
+}
+
+
+.jp-NBToolbar-button.jp-NBToolbar-cut::before {
+   content: "\f0c4";  /* Cut */
+}
+
+
+.jp-NBToolbar-button.jp-NBToolbar-copy::before {
+   content: "\f0c5";  /* Copy */
+}
+
+
+.jp-NBToolbar-button.jp-NBToolbar-paste::before {
+   content: "\f0ea";  /* Paste */
+}
+
+
+.jp-NBToolbar-button.jp-NBToolbar-run::before {
+   content: "\f051";  /* Step-forward */
+}
+
+
+.jp-NBToolbar-button.jp-NBToolbar-interrupt::before {
+   content: "\f04d";  /* Stop */
+}
+
+
+.jp-NBToolbar-button.jp-NBToolbar-restart::before {
+   content: "\f01e";  /* Rotate-right */
+}
+
+
+.jp-NBToolbar-item.jp-NBToolbar-kernelIndicator::before {
+    content: "\f10c";  /* Circle-o */
+}
+
+
+.jp-NBToolbar-item.jp-NBToolbar-kernelIndicator.jp-mod-busy::before {
+    content: "\f111";  /* Circle */
+}
+

+ 1 - 1
src/notebook/notebook/trust.ts → src/notebook/trust.ts

@@ -3,7 +3,7 @@
 
 
 import {
 import {
   showDialog, okButton, cancelButton, warnButton
   showDialog, okButton, cancelButton, warnButton
-} from '../../dialog';
+} from '../dialog';
 
 
 import {
 import {
   INotebookModel
   INotebookModel

+ 7 - 7
src/notebook/notebook/widget.ts → src/notebook/widget.ts

@@ -51,33 +51,33 @@ import {
 
 
 import {
 import {
   IChangedArgs
   IChangedArgs
-} from '../../common/interfaces';
+} from '../common/interfaces';
 
 
 import {
 import {
   DragScrollHandler
   DragScrollHandler
-} from '../../common/dragscroll';
+} from '../common/dragscroll';
 
 
 import {
 import {
   IObservableVector, ObservableVector
   IObservableVector, ObservableVector
-} from '../../common/observablevector';
+} from '../common/observablevector';
 
 
 import {
 import {
   RenderMime
   RenderMime
-} from '../../rendermime';
+} from '../rendermime';
 
 
 import {
 import {
   IEditorMimeTypeService, CodeEditor
   IEditorMimeTypeService, CodeEditor
-} from '../../codeeditor';
+} from '../codeeditor';
 
 
 import {
 import {
   ICellModel, BaseCellWidget, IMarkdownCellModel,
   ICellModel, BaseCellWidget, IMarkdownCellModel,
   CodeCellWidget, MarkdownCellWidget,
   CodeCellWidget, MarkdownCellWidget,
   ICodeCellModel, RawCellWidget, IRawCellModel,
   ICodeCellModel, RawCellWidget, IRawCellModel,
-} from '../../cells';
+} from '../cells';
 
 
 import {
 import {
   OutputAreaWidget
   OutputAreaWidget
-} from '../../outputarea';
+} from '../outputarea';
 
 
 import {
 import {
   INotebookModel
   INotebookModel

+ 3 - 3
src/notebook/notebook/widgetfactory.ts → src/notebook/widgetfactory.ts

@@ -7,15 +7,15 @@ import {
 
 
 import {
 import {
   IEditorMimeTypeService
   IEditorMimeTypeService
-} from '../../codeeditor';
+} from '../codeeditor';
 
 
 import {
 import {
   ABCWidgetFactory, DocumentRegistry
   ABCWidgetFactory, DocumentRegistry
-} from '../../docregistry';
+} from '../docregistry';
 
 
 import {
 import {
   RenderMime
   RenderMime
-} from '../../rendermime';
+} from '../rendermime';
 
 
 import {
 import {
   ToolbarItems
   ToolbarItems

+ 1 - 1
test/src/notebook/common/undo.spec.ts → test/src/common/undoablevector.spec.ts

@@ -9,7 +9,7 @@ import {
 
 
 import {
 import {
   ObservableUndoableVector, ISerializable
   ObservableUndoableVector, ISerializable
-} from '../../../../lib/notebook/common/undo';
+} from '../../../lib/common/undoablevector';
 
 
 
 
 
 

+ 9 - 11
test/src/index.ts

@@ -18,6 +18,7 @@ import './common/activitymonitor.spec';
 import './common/instancetracker.spec';
 import './common/instancetracker.spec';
 import './common/observablestring.spec';
 import './common/observablestring.spec';
 import './common/observablevector.spec';
 import './common/observablevector.spec';
+import './common/undoablevector.spec';
 import './common/vdom.spec';
 import './common/vdom.spec';
 
 
 import './completer/handler.spec';
 import './completer/handler.spec';
@@ -61,17 +62,14 @@ import './renderers/latex.spec';
 
 
 import './rendermime/rendermime.spec';
 import './rendermime/rendermime.spec';
 
 
-import './notebook/common/undo.spec';
-
-import './notebook/notebook/actions.spec';
-import './notebook/notebook/default-toolbar.spec';
-import './notebook/notebook/model.spec';
-import './notebook/notebook/modelfactory.spec';
-import './notebook/notebook/panel.spec';
-import './notebook/notebook/trust.spec';
-import './notebook/notebook/widget.spec';
-import './notebook/notebook/widgetfactory.spec';
-
+import './notebook/actions.spec';
+import './notebook/default-toolbar.spec';
+import './notebook/model.spec';
+import './notebook/modelfactory.spec';
+import './notebook/panel.spec';
+import './notebook/trust.spec';
+import './notebook/widget.spec';
+import './notebook/widgetfactory.spec';
 import './notebook/tracker.spec';
 import './notebook/tracker.spec';
 
 
 import './outputarea/model.spec';
 import './outputarea/model.spec';

+ 5 - 5
test/src/notebook/notebook/actions.spec.ts → test/src/notebook/actions.spec.ts

@@ -13,24 +13,24 @@ import {
 
 
 import {
 import {
   CodeCellWidget, MarkdownCellWidget, RawCellWidget
   CodeCellWidget, MarkdownCellWidget, RawCellWidget
-} from '../../../../lib/cells/widget';
+} from '../../../lib/cells/widget';
 
 
 import {
 import {
  NotebookModel
  NotebookModel
-} from '../../../../lib/notebook/notebook/model';
+} from '../../../lib/notebook/model';
 
 
 import {
 import {
   NotebookActions
   NotebookActions
-} from '../../../../lib/notebook/notebook/actions';
+} from '../../../lib/notebook/actions';
 
 
 import {
 import {
   Notebook, JUPYTER_CELL_MIME
   Notebook, JUPYTER_CELL_MIME
-} from '../../../../lib/notebook/notebook/widget';
+} from '../../../lib/notebook/widget';
 
 
 import {
 import {
   DEFAULT_CONTENT, createNotebookFactory, clipboard, rendermime,
   DEFAULT_CONTENT, createNotebookFactory, clipboard, rendermime,
   mimeTypeService
   mimeTypeService
-} from '../utils';
+} from './utils';
 
 
 
 
 const ERROR_INPUT = 'a = foo';
 const ERROR_INPUT = 'a = foo';

+ 10 - 10
test/src/notebook/notebook/default-toolbar.spec.ts → test/src/notebook/default-toolbar.spec.ts

@@ -17,47 +17,47 @@ import {
 
 
 import {
 import {
   Context, DocumentRegistry
   Context, DocumentRegistry
-} from '../../../../lib/docregistry';
+} from '../../../lib/docregistry';
 
 
 import {
 import {
  CodeCellWidget, MarkdownCellWidget
  CodeCellWidget, MarkdownCellWidget
-} from '../../../../lib/cells/widget';
+} from '../../../lib/cells/widget';
 
 
 import {
 import {
   NotebookActions
   NotebookActions
-} from '../../../../lib/notebook/notebook/actions';
+} from '../../../lib/notebook/actions';
 
 
 import {
 import {
  ToolbarItems
  ToolbarItems
-} from '../../../../lib/notebook/notebook/default-toolbar';
+} from '../../../lib/notebook/default-toolbar';
 
 
 import {
 import {
  INotebookModel
  INotebookModel
-} from '../../../../lib/notebook/notebook/model';
+} from '../../../lib/notebook/model';
 
 
 import {
 import {
   JUPYTER_CELL_MIME
   JUPYTER_CELL_MIME
-} from '../../../../lib/notebook/notebook/widget';
+} from '../../../lib/notebook/widget';
 
 
 import {
 import {
  NotebookPanel
  NotebookPanel
-} from '../../../../lib/notebook/notebook/panel';
+} from '../../../lib/notebook/panel';
 
 
 import {
 import {
  createInterruptButton,
  createInterruptButton,
  createKernelNameItem,
  createKernelNameItem,
  createKernelStatusItem,
  createKernelStatusItem,
  createRestartButton
  createRestartButton
-} from '../../../../lib/toolbar/kernel';
+} from '../../../lib/toolbar/kernel';
 
 
 import {
 import {
   createNotebookContext
   createNotebookContext
-} from '../../utils';
+} from '../utils';
 
 
 import {
 import {
   DEFAULT_CONTENT, createNotebookPanelFactory, rendermime, clipboard,
   DEFAULT_CONTENT, createNotebookPanelFactory, rendermime, clipboard,
   mimeTypeService
   mimeTypeService
-} from '../utils';
+} from './utils';
 
 
 
 
 function startKernel(context: DocumentRegistry.IContext<INotebookModel>): Promise<Kernel.IKernel> {
 function startKernel(context: DocumentRegistry.IContext<INotebookModel>): Promise<Kernel.IKernel> {

+ 3 - 3
test/src/notebook/notebook/model.spec.ts → test/src/notebook/model.spec.ts

@@ -17,15 +17,15 @@ import {
 
 
 import {
 import {
   CodeCellModel
   CodeCellModel
-} from '../../../../lib/cells/model';
+} from '../../../lib/cells/model';
 
 
 import {
 import {
   NotebookModel
   NotebookModel
-} from '../../../../lib/notebook/notebook/model';
+} from '../../../lib/notebook/model';
 
 
 import {
 import {
   DEFAULT_CONTENT
   DEFAULT_CONTENT
-} from '../utils';
+} from './utils';
 
 
 
 
 describe('notebook/notebook/model', () => {
 describe('notebook/notebook/model', () => {

+ 3 - 3
test/src/notebook/notebook/modelfactory.spec.ts → test/src/notebook/modelfactory.spec.ts

@@ -5,15 +5,15 @@ import expect = require('expect.js');
 
 
 import {
 import {
   CodeCellModel
   CodeCellModel
-} from '../../../../lib/cells/model';
+} from '../../../lib/cells/model';
 
 
 import {
 import {
   NotebookModel
   NotebookModel
-} from '../../../../lib/notebook/notebook/model';
+} from '../../../lib/notebook/model';
 
 
 import {
 import {
   NotebookModelFactory
   NotebookModelFactory
-} from '../../../../lib/notebook/notebook/modelfactory';
+} from '../../../lib/notebook/modelfactory';
 
 
 
 
 describe('notebook/notebook/modelfactory', () => {
 describe('notebook/notebook/modelfactory', () => {

+ 12 - 12
test/src/notebook/notebook/panel.spec.ts → test/src/notebook/panel.spec.ts

@@ -9,44 +9,44 @@ import {
 
 
 import {
 import {
   IChangedArgs
   IChangedArgs
-} from '../../../../lib/common/interfaces';
+} from '../../../lib/common/interfaces';
 
 
 import {
 import {
   DocumentRegistry, Context
   DocumentRegistry, Context
-} from '../../../../lib/docregistry';
+} from '../../../lib/docregistry';
 
 
 import {
 import {
   CompleterWidget, CompletionHandler
   CompleterWidget, CompletionHandler
-} from '../../../../lib/completer';
+} from '../../../lib/completer';
 
 
 import {
 import {
   InspectionHandler
   InspectionHandler
-} from '../../../../lib/inspector';
+} from '../../../lib/inspector';
 
 
 import {
 import {
   INotebookModel
   INotebookModel
-} from '../../../../lib/notebook/notebook/model';
+} from '../../../lib/notebook/model';
 
 
 import {
 import {
   NotebookPanel
   NotebookPanel
-} from '../../../../lib/notebook/notebook/panel';
+} from '../../../lib/notebook/panel';
 
 
 import {
 import {
-  Toolbar
-} from '../../../../lib/toolbar';
+  Notebook
+} from '../../../lib/notebook/widget';
 
 
 import {
 import {
-  Notebook
-} from '../../../../lib/notebook/notebook/widget';
+  Toolbar
+} from '../../../lib/toolbar';
 
 
 import {
 import {
   createNotebookContext
   createNotebookContext
-} from '../../utils';
+} from '../utils';
 
 
 import {
 import {
   DEFAULT_CONTENT, createNotebookPanelFactory, rendermime, clipboard,
   DEFAULT_CONTENT, createNotebookPanelFactory, rendermime, clipboard,
   mimeTypeService, editorFactory
   mimeTypeService, editorFactory
-} from '../utils';
+} from './utils';
 
 
 
 
 /**
 /**

+ 4 - 4
test/src/notebook/notebook/trust.spec.ts → test/src/notebook/trust.spec.ts

@@ -5,19 +5,19 @@ import expect = require('expect.js');
 
 
 import {
 import {
  NotebookModel
  NotebookModel
-} from '../../../../lib/notebook/notebook/model';
+} from '../../../lib/notebook/model';
 
 
 import {
 import {
   trustNotebook
   trustNotebook
-} from '../../../../lib/notebook/notebook/trust';
+} from '../../../lib/notebook/trust';
 
 
 import {
 import {
   acceptDialog, dismissDialog
   acceptDialog, dismissDialog
-} from '../../utils';
+} from '../utils';
 
 
 import {
 import {
   DEFAULT_CONTENT
   DEFAULT_CONTENT
-} from '../utils';
+} from './utils';
 
 
 
 
 describe('notebook/notebook/trust', () => {
 describe('notebook/notebook/trust', () => {

+ 8 - 8
test/src/notebook/notebook/widget.spec.ts → test/src/notebook/widget.spec.ts

@@ -11,31 +11,31 @@ import {
   Widget, WidgetMessage
   Widget, WidgetMessage
 } from 'phosphor/lib/ui/widget';
 } from 'phosphor/lib/ui/widget';
 
 
-import {
-  IChangedArgs
-} from '../../../../lib/common/interfaces';
-
 import {
 import {
   simulate
   simulate
 } from 'simulate-event';
 } from 'simulate-event';
 
 
+import {
+  IChangedArgs
+} from '../../../lib/common/interfaces';
+
 import {
 import {
   CodeCellModel, CodeCellWidget, MarkdownCellModel, MarkdownCellWidget,
   CodeCellModel, CodeCellWidget, MarkdownCellModel, MarkdownCellWidget,
   RawCellModel, RawCellWidget, BaseCellWidget
   RawCellModel, RawCellWidget, BaseCellWidget
-} from '../../../../lib/cells';
+} from '../../../lib/cells';
 
 
 import {
 import {
   INotebookModel, NotebookModel
   INotebookModel, NotebookModel
-} from '../../../../lib/notebook/notebook/model';
+} from '../../../lib/notebook/model';
 
 
 import {
 import {
   Notebook, StaticNotebook
   Notebook, StaticNotebook
-} from '../../../../lib/notebook/notebook/widget';
+} from '../../../lib/notebook/widget';
 
 
 import {
 import {
   DEFAULT_CONTENT, createNotebookFactory, rendermime, mimeTypeService,
   DEFAULT_CONTENT, createNotebookFactory, rendermime, mimeTypeService,
   editorFactory
   editorFactory
-} from '../utils';
+} from './utils';
 
 
 
 
 const contentFactory = createNotebookFactory();
 const contentFactory = createNotebookFactory();

+ 6 - 6
test/src/notebook/notebook/widgetfactory.spec.ts → test/src/notebook/widgetfactory.spec.ts

@@ -9,27 +9,27 @@ import {
 
 
 import {
 import {
   INotebookModel
   INotebookModel
-} from '../../../../lib/notebook/notebook/model';
+} from '../../../lib/notebook/model';
 
 
 import {
 import {
   NotebookPanel
   NotebookPanel
-} from '../../../../lib/notebook/notebook/panel';
+} from '../../../lib/notebook/panel';
 
 
 import {
 import {
   NotebookWidgetFactory
   NotebookWidgetFactory
-} from '../../../../lib/notebook/notebook/widgetfactory';
+} from '../../../lib/notebook/widgetfactory';
 
 
 import {
 import {
   Context
   Context
-} from '../../../../lib/docregistry/context';
+} from '../../../lib/docregistry/context';
 
 
 import {
 import {
   createNotebookContext
   createNotebookContext
-} from '../../utils';
+} from '../utils';
 
 
 import {
 import {
   createNotebookPanelFactory, clipboard, rendermime, mimeTypeService
   createNotebookPanelFactory, clipboard, rendermime, mimeTypeService
-} from '../utils';
+} from './utils';
 
 
 
 
 const contentFactory = createNotebookPanelFactory();
 const contentFactory = createNotebookPanelFactory();

+ 2 - 2
test/src/utils.ts

@@ -21,11 +21,11 @@ import {
 
 
 import {
 import {
   INotebookModel
   INotebookModel
-} from '../../lib/notebook/notebook/model';
+} from '../../lib/notebook/model';
 
 
 import {
 import {
   NotebookModelFactory
   NotebookModelFactory
-} from '../../lib/notebook/notebook/modelfactory';
+} from '../../lib/notebook/modelfactory';
 
 
 import {
 import {
   TextRenderer, HTMLRenderer
   TextRenderer, HTMLRenderer

+ 6 - 6
tutorial/notebook.md

@@ -19,7 +19,7 @@ files.
 The **[NotebookModel](http://jupyterlab.github.io/jupyterlab/classes/_notebook_notebook_model_.notebookmodel.html)**
 The **[NotebookModel](http://jupyterlab.github.io/jupyterlab/classes/_notebook_notebook_model_.notebookmodel.html)**
 contains an observable list of cells.
 contains an observable list of cells.
 
 
-A **[cell model](http://jupyterlab.github.io/jupyterlab/modules/_notebook_cells_model_.html)**
+A **[cell model](http://jupyterlab.github.io/jupyterlab/modules/_cells_model_.html)**
 can be:
 can be:
 
 
 - a code cell
 - a code cell
@@ -73,19 +73,19 @@ the next cell, merge or split cells at the cursor, delete selected cells, etc.
 
 
 #### Widget hierarchy
 #### Widget hierarchy
 
 
-A Notebook widget contains a list of [cell widgets](http://jupyterlab.github.io/jupyterlab/modules/_notebook_cells_widget_.html),
+A Notebook widget contains a list of [cell widgets](http://jupyterlab.github.io/jupyterlab/modules/_cells_widget_.html),
 corresponding to the cell models in its cell list.
 corresponding to the cell models in its cell list.
 
 
-- Each cell widget contains an [InputAreaWidget](http://jupyterlab.github.io/jupyterlab/classes/_notebook_cells_widget_.inputareawidget.html),
+- Each cell widget contains an [InputAreaWidget](http://jupyterlab.github.io/jupyterlab/classes/_cells_widget_.inputareawidget.html),
 
 
     + which contains n [CodeEditorWidget](http://jupyterlab.github.io/jupyterlab/classes/_codeeditor_widget_.codeeditorwidget.html),
     + which contains n [CodeEditorWidget](http://jupyterlab.github.io/jupyterlab/classes/_codeeditor_widget_.codeeditorwidget.html),
 
 
         - which contains a JavaScript CodeMirror instance.
         - which contains a JavaScript CodeMirror instance.
 
 
-A [CodeCellWidget](http://jupyterlab.github.io/jupyterlab/classes/_notebook_cells_widget_.codecellwidget.html)
-also contains an [OutputAreaWidget](http://jupyterlab.github.io/jupyterlab/classes/_notebook_output_area_widget_.outputareawidget.html).
+A [CodeCellWidget](http://jupyterlab.github.io/jupyterlab/classes/_cells_widget_.codecellwidget.html)
+also contains an [OutputAreaWidget](http://jupyterlab.github.io/jupyterlab/classes/_outputarea_widget_.outputareawidget.html).
 An OutputAreaWidget is responsible for rendering the outputs in the
 An OutputAreaWidget is responsible for rendering the outputs in the
-[OutputAreaModel](http://jupyterlab.github.io/jupyterlab/classes/_notebook_output_area_model_.outputareamodel.html)
+[OutputAreaModel](http://jupyterlab.github.io/jupyterlab/classes/_outputarea_model_.outputareamodel.html)
 list. An OutputAreaWidget uses a
 list. An OutputAreaWidget uses a
 notebook-specific [RenderMime](http://jupyterlab.github.io/jupyterlab/classes/_rendermime_index_.rendermime.html)
 notebook-specific [RenderMime](http://jupyterlab.github.io/jupyterlab/classes/_rendermime_index_.rendermime.html)
 object to render `display_data` output messages.
 object to render `display_data` output messages.