From dcc1578b37c9d423cd03e3100c0c44bf3c51475b Mon Sep 17 00:00:00 2001 From: madhu94 Date: Sat, 2 Mar 2019 20:22:38 +0530 Subject: [PATCH 01/15] Allow cell attachments to be added to the cell by dragging files from filebrowser, native drag/drop or by pasting --- packages/cells/package.json | 1 + packages/cells/src/widget.ts | 192 +++++++++++++++++++++++++++- packages/filebrowser/src/listing.ts | 32 +++++ packages/filebrowser/tsconfig.json | 7 +- packages/notebook/src/widget.ts | 1 + 5 files changed, 229 insertions(+), 4 deletions(-) diff --git a/packages/cells/package.json b/packages/cells/package.json index ee85f3b8a737..29ee6ede9b4f 100644 --- a/packages/cells/package.json +++ b/packages/cells/package.json @@ -46,6 +46,7 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@phosphor/algorithm": "^1.1.3", "@phosphor/coreutils": "^1.3.1", + "@phosphor/dragdrop": "^1.3.3", "@phosphor/messaging": "^1.2.3", "@phosphor/signaling": "^1.2.3", "@phosphor/virtualdom": "^1.1.3", diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index 77aeea779c6a..5023b458e63b 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -7,7 +7,12 @@ import { AttachmentsResolver } from '@jupyterlab/attachments'; import { IClientSession } from '@jupyterlab/apputils'; -import { IChangedArgs, ActivityMonitor } from '@jupyterlab/coreutils'; +import { + IChangedArgs, + ActivityMonitor, + nbformat, + URLExt +} from '@jupyterlab/coreutils'; import { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor'; @@ -28,10 +33,12 @@ import { IRenderMimeRegistry } from '@jupyterlab/rendermime'; -import { KernelMessage, Kernel } from '@jupyterlab/services'; +import { KernelMessage, Kernel, Contents } from '@jupyterlab/services'; import { JSONValue, PromiseDelegate, JSONObject } from '@phosphor/coreutils'; +import { IDragEvent } from '@phosphor/dragdrop'; + import { Message } from '@phosphor/messaging'; import { PanelLayout, Panel, Widget } from '@phosphor/widgets'; @@ -48,6 +55,7 @@ import { import { InputArea, IInputPrompt, InputPrompt } from './inputarea'; import { + IAttachmentsCellModel, ICellModel, ICodeCellModel, IMarkdownCellModel, @@ -143,6 +151,11 @@ const DEFAULT_MARKDOWN_TEXT = 'Type Markdown and LaTeX: $ α^2 $'; */ const RENDER_TIMEOUT = 1000; +/** + * The mime type for attachments + */ +const ATTACHMENTS_MIME = 'application/vnd.jupyter.attachments;closure=true'; + /****************************************************************************** * Cell ******************************************************************************/ @@ -1056,6 +1069,179 @@ export namespace CodeCell { } } +/** + * `AttachmentsCell` - A base class for a cell widget that allows + * attachments to be drag/drop'd or pasted onto it + */ +export class AttachmentsCell extends Cell { + /** + * Handle the DOM events for the widget. + * + * @param event - The DOM event sent to the widget. + * + * #### Notes + * This method implements the DOM `EventListener` interface and is + * called in response to events on the notebook panel's node. It should + * not be called directly by user code. + */ + handleEvent(event: Event): void { + switch (event.type) { + case 'paste': + this._evtPaste(event as ClipboardEvent); + break; + case 'dragenter': + event.preventDefault(); + break; + case 'dragover': + event.preventDefault(); + break; + case 'drop': + this._evtNativeDrop(event as DragEvent); + break; + case 'p-dragover': + this._evtDragOver(event as IDragEvent); + break; + case 'p-drop': + this._evtDrop(event as IDragEvent); + default: + break; + } + } + + private _evtDragOver(event: IDragEvent) { + if (!event.mimeData.getData(ATTACHMENTS_MIME)) { + return; + } + event.preventDefault(); + } + + /** + * Handle the `paste` event for the widget + */ + private _evtPaste(event: ClipboardEvent): void { + this._attachFiles(event.clipboardData.items); + } + + /** + * Handle the `drop` event for the widget + */ + private _evtNativeDrop(event: DragEvent): void { + this._attachFiles(event.dataTransfer.items); + event.preventDefault(); + } + + /** + * Handle the `'p-drop'` event for the widget. + */ + private _evtDrop(event: IDragEvent): void { + if (!event.mimeData.hasData(ATTACHMENTS_MIME)) { + return; + } + event.preventDefault(); + event.stopPropagation(); + if (event.proposedAction === 'none') { + event.dropAction = 'none'; + return; + } + + const thunks = event.mimeData.getData(ATTACHMENTS_MIME); + const promises: Promise[] = []; + thunks.forEach((fn: Function) => { + promises.push(fn()); + }); + Promise.all(promises).then(models => { + models.forEach(model => { + if (model.type === 'file' && model.format === 'base64') { + this.model.attachments.set(model.name, { + [model.mimetype]: model.content + }); + this._updateCellSourceWithAttachment(model.name); + } + }); + }); + } + + /** + * Handle `after-attach` messages for the widget. + */ + protected onAfterAttach(msg: Message): void { + super.onAfterAttach(msg); + let node = this.node; + node.addEventListener('p-dragover', this); + node.addEventListener('p-drop', this); + node.addEventListener('dragenter', this); + node.addEventListener('dragover', this); + node.addEventListener('drop', this); + node.addEventListener('paste', this); + } + + /** + * A message handler invoked on a `'before-detach'` + * message + */ + protected onBeforeDetach(msg: Message): void { + let node = this.node; + node.removeEventListener('drop', this); + node.removeEventListener('dragover', this); + node.removeEventListener('dragenter', this); + node.removeEventListener('paste', this); + node.removeEventListener('p-dragover', this); + node.removeEventListener('p-drop', this); + } + + /** + * Attaches all DataTransferItems (obtained from + * clipboard or native drop events) to the cell + */ + private _attachFiles(items: DataTransferItemList) { + for (let i = 0; i < items.length; i++) { + const item = items[i]; + if (item.kind === 'file') { + const blob = item.getAsFile(); + this._attachFile(blob); + } + } + } + + /** + * Takes in a file object and adds it to + * the cell attachments + */ + private _attachFile(blob: File) { + const reader = new FileReader(); + reader.readAsDataURL(blob); + reader.onload = evt => { + const { href, protocol } = URLExt.parse(reader.result as string); + if (protocol !== 'data:') { + return; + } + const content = href.split(':')[1]; + const [mimeType, encodedData] = content.split(';'); + const data = encodedData.split(',')[1]; + const bundle: nbformat.IMimeBundle = { [mimeType]: data }; + this.model.attachments.set(blob.name, bundle); + this._updateCellSourceWithAttachment(blob.name); + }; + reader.onerror = evt => { + console.error(`Failed to attach ${blob.name}` + evt); + }; + } + + /** + * Appends the text ![attachment](attachment: ) + * to the cell source + */ + private _updateCellSourceWithAttachment(attachmentName: string) { + const textToBeAppended = `![${attachmentName}](attachment:${attachmentName})`; + this.model.value.insert(this.model.value.text.length, textToBeAppended); + } + + /** + * The model used by the widget. + */ + readonly model: IAttachmentsCellModel; +} + /****************************************************************************** * MarkdownCell ******************************************************************************/ @@ -1069,7 +1255,7 @@ export namespace CodeCell { * or the input area model changes. We don't support automatically * updating the rendered text in all of these cases. */ -export class MarkdownCell extends Cell { +export class MarkdownCell extends AttachmentsCell { /** * Construct a Markdown cell widget. */ diff --git a/packages/filebrowser/src/listing.ts b/packages/filebrowser/src/listing.ts index 98aa5425ead6..c8a4ce39685a 100644 --- a/packages/filebrowser/src/listing.ts +++ b/packages/filebrowser/src/listing.ts @@ -18,6 +18,8 @@ import { import { DocumentRegistry } from '@jupyterlab/docregistry'; +import { imageRendererFactory } from '@jupyterlab/rendermime'; + import { Contents } from '@jupyterlab/services'; import { IIconRegistry } from '@jupyterlab/ui-components'; @@ -117,6 +119,11 @@ const MODIFIED_ID_CLASS = 'jp-id-modified'; */ const CONTENTS_MIME = 'application/x-jupyter-icontents'; +/** + * The mime type for attachments + */ +const ATTACHMENTS_MIME = 'application/vnd.jupyter.attachments;closure=true'; + /** * The class name added to drop targets. */ @@ -1189,12 +1196,37 @@ export class DirListing extends Widget { proposedAction: 'move' }); let basePath = this._model.path; + let paths = toArray( map(selectedNames, name => { return PathExt.join(basePath, name); }) ); this._drag.mimeData.setData(CONTENTS_MIME, paths); + + let services = this.model.manager.services; + const selectedItems: Contents.IModel[] = []; + Object.keys(this._selection).forEach(itemname => { + if (this._selection[itemname]) { + const item = find(items, item => item.name === itemname); + if ( + item.type === 'file' && + imageRendererFactory.mimeTypes.indexOf(item.mimetype) !== -1 + ) { + selectedItems.push(item); + } + } + }); + // We thunk this so we don't try to make a network call + // when it's not needed. E.g. just moving files around + // in a filebrowser + if (selectedItems.length > 0) { + let attachmentThunks = paths.map(path => { + return () => services.contents.get(path); + }); + this._drag.mimeData.setData(ATTACHMENTS_MIME, attachmentThunks); + } + if (item && item.type !== 'directory') { const otherPaths = paths.slice(1).reverse(); this._drag.mimeData.setData(FACTORY_MIME, () => { diff --git a/packages/filebrowser/tsconfig.json b/packages/filebrowser/tsconfig.json index 19a64feeabb3..4ef8d8e7c071 100644 --- a/packages/filebrowser/tsconfig.json +++ b/packages/filebrowser/tsconfig.json @@ -4,7 +4,9 @@ "outDir": "lib", "rootDir": "src" }, - "include": ["src/*"], + "include": [ + "src/*" + ], "references": [ { "path": "../apputils" @@ -18,6 +20,9 @@ { "path": "../docregistry" }, + { + "path": "../rendermime" + }, { "path": "../services" }, diff --git a/packages/notebook/src/widget.ts b/packages/notebook/src/widget.ts index 94bffc3b0312..d1c3e1edae5a 100644 --- a/packages/notebook/src/widget.ts +++ b/packages/notebook/src/widget.ts @@ -1299,6 +1299,7 @@ export class Notebook extends StaticNotebook { node.addEventListener('mousedown', this); node.addEventListener('keydown', this); node.addEventListener('dblclick', this); + node.addEventListener('focusin', this); node.addEventListener('focusout', this); // Capture drag events for the notebook widget From 9ed44e7c8059e2f0aff78c67e5ff58141cf8bada Mon Sep 17 00:00:00 2001 From: madhu94 Date: Sun, 2 Jun 2019 01:03:16 +0530 Subject: [PATCH 02/15] Use regex for datauri parsing --- packages/cells/src/widget.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index 5023b458e63b..55de39698c94 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -1215,10 +1215,14 @@ export class AttachmentsCell extends Cell { if (protocol !== 'data:') { return; } - const content = href.split(':')[1]; - const [mimeType, encodedData] = content.split(';'); - const data = encodedData.split(',')[1]; - const bundle: nbformat.IMimeBundle = { [mimeType]: data }; + const dataURIRegex = /([\w+\/\+]+)?(?:;(charset=[\w\d-]*|base64))?,(.*)/; + const matches = dataURIRegex.exec(href); + if (matches.length !== 4) { + return; + } + const mimeType = matches[1]; + const encodedData = matches[3]; + const bundle: nbformat.IMimeBundle = { [mimeType]: encodedData }; this.model.attachments.set(blob.name, bundle); this._updateCellSourceWithAttachment(blob.name); }; From ae78e21069cca8aa57a5f09184e69ae5463e5533 Mon Sep 17 00:00:00 2001 From: madhu94 Date: Fri, 21 Jun 2019 03:19:41 +0530 Subject: [PATCH 03/15] Add support for removing attachments --- packages/attachments/src/model.ts | 11 +++++++++++ packages/notebook/src/panel.ts | 26 +++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/packages/attachments/src/model.ts b/packages/attachments/src/model.ts index 41e7db3df489..e37f5bcea627 100644 --- a/packages/attachments/src/model.ts +++ b/packages/attachments/src/model.ts @@ -67,6 +67,10 @@ export interface IAttachmentsModel extends IDisposable { */ set(key: string, attachment: nbformat.IMimeBundle): void; + /** + * Remove the attachment whose name is the specified key + */ + remove(key: string): void; /** * Clear all of the attachments. */ @@ -234,6 +238,13 @@ export class AttachmentsModel implements IAttachmentsModel { this._map.set(key, item); } + /** + * Remove the attachment whose name is the specified key + */ + remove(key: string): void { + this._map.delete(key); + } + /** * Clear all of the attachments. */ diff --git a/packages/notebook/src/panel.ts b/packages/notebook/src/panel.ts index 32b8ae9b10d4..c9e2e08187b4 100644 --- a/packages/notebook/src/panel.ts +++ b/packages/notebook/src/panel.ts @@ -1,8 +1,12 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. +import { ICellModel, MarkdownCellModel } from '@jupyterlab/cells'; + import { Kernel, KernelMessage, Session } from '@jupyterlab/services'; +import { each } from '@phosphor/algorithm'; + import { Token } from '@phosphor/coreutils'; import { Message } from '@phosphor/messaging'; @@ -16,7 +20,7 @@ import { Dialog } from '@jupyterlab/apputils'; -import { DocumentWidget } from '@jupyterlab/docregistry'; +import { DocumentWidget, DocumentRegistry } from '@jupyterlab/docregistry'; import { INotebookModel } from './model'; @@ -58,6 +62,7 @@ export class NotebookPanel extends DocumentWidget { this._onSessionStatusChanged, this ); + this.context.saveState.connect(this._onSave, this); void this.revealed.then(() => { if (this.isDisposed) { @@ -75,6 +80,25 @@ export class NotebookPanel extends DocumentWidget { }); } + _onSave(sender: DocumentRegistry.Context, state: string) { + if (state === 'completed') { + // Find markdown cells + const { cells } = this.model; + each(cells, (cell: ICellModel) => { + if (cell.type === 'markdown') { + const markdowncell: MarkdownCellModel = cell as MarkdownCellModel; + const attachments: ReadonlyArray = + markdowncell.attachments.keys; + for (let i = 0; i < attachments.length; i++) { + if (!markdowncell.value.text.includes(attachments[i])) { + markdowncell.attachments.remove(attachments[i]); + } + } + } + }); + } + } + /** * A signal emitted when the panel has been activated. */ From 97bedb6662a1ab6215ce612f66cb46c1600e4029 Mon Sep 17 00:00:00 2001 From: madhu94 Date: Sun, 18 Aug 2019 03:13:31 +0530 Subject: [PATCH 04/15] Stop dragover event from propagating --- packages/cells/src/widget.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index 55de39698c94..428c03cfbf56 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -1113,6 +1113,8 @@ export class AttachmentsCell extends Cell { return; } event.preventDefault(); + event.stopPropagation(); + event.dropAction = event.proposedAction; } /** From 9554a7dc2847a049ea56f1fea6ff9eb0fcfc6b90 Mon Sep 17 00:00:00 2001 From: madhu94 Date: Sun, 18 Aug 2019 04:03:15 +0530 Subject: [PATCH 05/15] Upgrade to latest phosphor packages @phosphor/widgets@1.9.0 has a bug fix - dockpanel overlay did not hide itself even if markdown cell handled the p-drop event. --- dev_mode/package.json | 20 +-- examples/cell/package.json | 4 +- examples/console/package.json | 4 +- examples/filebrowser/package.json | 6 +- examples/notebook/package.json | 4 +- examples/terminal/package.json | 2 +- .../mock_packages/mimeextension/package.json | 2 +- packages/application-extension/package.json | 4 +- packages/application/package.json | 14 +- packages/apputils-extension/package.json | 8 +- packages/apputils/package.json | 14 +- packages/attachments/package.json | 4 +- packages/cells/package.json | 12 +- packages/cells/src/widget.ts | 3 + packages/cells/style/index.css | 1 + packages/codeeditor/package.json | 10 +- packages/codemirror-extension/package.json | 2 +- packages/codemirror/package.json | 10 +- packages/completer-extension/package.json | 4 +- packages/completer/package.json | 10 +- packages/console-extension/package.json | 6 +- packages/console/package.json | 12 +- packages/coreutils/package.json | 6 +- packages/csvviewer-extension/package.json | 6 +- packages/csvviewer/package.json | 12 +- packages/docmanager-extension/package.json | 6 +- packages/docmanager/package.json | 10 +- packages/docregistry/package.json | 10 +- .../documentsearch-extension/package.json | 2 +- packages/documentsearch/package.json | 6 +- packages/extensionmanager/package.json | 2 +- packages/filebrowser-extension/package.json | 8 +- packages/filebrowser/package.json | 13 +- packages/filebrowser/style/index.css | 1 + packages/fileeditor-extension/package.json | 2 +- packages/fileeditor/package.json | 4 +- packages/help-extension/package.json | 2 +- packages/htmlviewer/package.json | 2 +- packages/imageviewer/package.json | 4 +- packages/inspector/package.json | 6 +- packages/json-extension/package.json | 4 +- packages/launcher-extension/package.json | 4 +- packages/launcher/package.json | 8 +- packages/mainmenu-extension/package.json | 6 +- packages/mainmenu/package.json | 8 +- packages/markdownviewer/package.json | 4 +- packages/notebook-extension/package.json | 10 +- packages/notebook/package.json | 12 +- packages/observables/package.json | 8 +- packages/outputarea/package.json | 10 +- packages/pdf-extension/package.json | 4 +- packages/rendermime-interfaces/package.json | 2 +- packages/rendermime/package.json | 8 +- packages/running/package.json | 4 +- packages/services/package.json | 6 +- packages/settingeditor/package.json | 8 +- packages/shortcuts-extension/package.json | 4 +- packages/statusbar-extension/package.json | 2 +- packages/statusbar/package.json | 10 +- packages/tabmanager-extension/package.json | 4 +- packages/terminal-extension/package.json | 2 +- packages/terminal/package.json | 4 +- packages/tooltip-extension/package.json | 4 +- packages/tooltip/package.json | 4 +- packages/ui-components/package.json | 6 +- packages/vdom/package.json | 4 +- packages/vega4-extension/package.json | 2 +- packages/vega5-extension/package.json | 2 +- tests/package.json | 14 +- tests/test-application/package.json | 6 +- tests/test-apputils/package.json | 10 +- tests/test-cells/package.json | 6 +- tests/test-codeeditor/package.json | 4 +- tests/test-completer/package.json | 6 +- tests/test-console/package.json | 6 +- tests/test-coreutils/package.json | 4 +- tests/test-csvviewer/package.json | 4 +- tests/test-docmanager/package.json | 4 +- tests/test-docregistry/package.json | 8 +- tests/test-filebrowser/package.json | 6 +- tests/test-fileeditor/package.json | 4 +- tests/test-imageviewer/package.json | 4 +- tests/test-inspector/package.json | 4 +- tests/test-mainmenu/package.json | 6 +- tests/test-notebook/package.json | 6 +- tests/test-observables/package.json | 2 +- tests/test-outputarea/package.json | 4 +- tests/test-rendermime/package.json | 4 +- tests/test-services/package.json | 4 +- tests/test-statusbar/package.json | 4 +- tests/test-terminal/package.json | 4 +- testutils/package.json | 2 +- yarn.lock | 140 +++++++++--------- 93 files changed, 342 insertions(+), 336 deletions(-) diff --git a/dev_mode/package.json b/dev_mode/package.json index 9609bb6a98d4..c25bfa6f96d4 100644 --- a/dev_mode/package.json +++ b/dev_mode/package.json @@ -163,19 +163,19 @@ "@jupyterlab/vdom-extension": "~1.2.0-alpha.0", "@jupyterlab/vega4-extension": "~1.2.0-alpha.0", "@jupyterlab/vega5-extension": "~1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/application": "^1.6.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/application": "^1.7.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/datagrid": "^0.1.9", - "@phosphor/disposable": "^1.2.0", + "@phosphor/datagrid": "^0.1.11", + "@phosphor/disposable": "^1.3.0", "@phosphor/domutils": "^1.1.3", - "@phosphor/dragdrop": "^1.3.3", - "@phosphor/messaging": "^1.2.3", + "@phosphor/dragdrop": "^1.3.0", + "@phosphor/messaging": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/virtualdom": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/virtualdom": "^1.2.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4", "react-dom": "~16.8.4" }, diff --git a/examples/cell/package.json b/examples/cell/package.json index a7676d983b55..ff931ce50342 100644 --- a/examples/cell/package.json +++ b/examples/cell/package.json @@ -15,8 +15,8 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/theme-light-extension": "^1.2.0-alpha.0", - "@phosphor/commands": "^1.6.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/commands": "^1.7.0", + "@phosphor/widgets": "^1.9.0", "es6-promise": "~4.2.6" }, "devDependencies": { diff --git a/examples/console/package.json b/examples/console/package.json index 5f3b5318fe88..4c32a21787d3 100644 --- a/examples/console/package.json +++ b/examples/console/package.json @@ -13,8 +13,8 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/theme-light-extension": "^1.2.0-alpha.0", - "@phosphor/commands": "^1.6.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/commands": "^1.7.0", + "@phosphor/widgets": "^1.9.0", "es6-promise": "~4.2.6" }, "devDependencies": { diff --git a/examples/filebrowser/package.json b/examples/filebrowser/package.json index 6c7af93fe547..921246d4c3dc 100644 --- a/examples/filebrowser/package.json +++ b/examples/filebrowser/package.json @@ -17,9 +17,9 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/theme-light-extension": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", + "@phosphor/widgets": "^1.9.0", "es6-promise": "~4.2.6" }, "devDependencies": { diff --git a/examples/notebook/package.json b/examples/notebook/package.json index bf1f85212b05..a4022e8ee8ef 100644 --- a/examples/notebook/package.json +++ b/examples/notebook/package.json @@ -18,8 +18,8 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/theme-light-extension": "^1.2.0-alpha.0", - "@phosphor/commands": "^1.6.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/commands": "^1.7.0", + "@phosphor/widgets": "^1.9.0", "es6-promise": "~4.2.6" }, "devDependencies": { diff --git a/examples/terminal/package.json b/examples/terminal/package.json index 1ebd622115ea..9f056bb7b37b 100644 --- a/examples/terminal/package.json +++ b/examples/terminal/package.json @@ -11,7 +11,7 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/terminal": "^1.2.0-alpha.0", "@jupyterlab/theme-light-extension": "^1.2.0-alpha.0", - "@phosphor/widgets": "^1.8.0", + "@phosphor/widgets": "^1.9.0", "es6-promise": "~4.2.6" }, "devDependencies": { diff --git a/jupyterlab/tests/mock_packages/mimeextension/package.json b/jupyterlab/tests/mock_packages/mimeextension/package.json index f1de1cb49be1..c21201b5930f 100644 --- a/jupyterlab/tests/mock_packages/mimeextension/package.json +++ b/jupyterlab/tests/mock_packages/mimeextension/package.json @@ -3,7 +3,7 @@ "version": "0.3.0", "private": true, "dependencies": { - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "jupyterlab": { "mimeExtension": true diff --git a/packages/application-extension/package.json b/packages/application-extension/package.json index 7d681d53f463..3df4b5af2159 100644 --- a/packages/application-extension/package.json +++ b/packages/application-extension/package.json @@ -39,8 +39,8 @@ "@jupyterlab/application": "^1.2.0-alpha.0", "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/application/package.json b/packages/application/package.json index a6e157370874..6d4ac1a2c087 100644 --- a/packages/application/package.json +++ b/packages/application/package.json @@ -43,15 +43,15 @@ "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/application": "^1.6.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/application": "^1.7.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "font-awesome": "~4.7.0" }, "devDependencies": { diff --git a/packages/apputils-extension/package.json b/packages/apputils-extension/package.json index 47c701c5a476..8dedfaa21c81 100644 --- a/packages/apputils-extension/package.json +++ b/packages/apputils-extension/package.json @@ -42,11 +42,11 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/widgets": "^1.8.0", + "@phosphor/disposable": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "es6-promise": "~4.2.6" }, "devDependencies": { diff --git a/packages/apputils/package.json b/packages/apputils/package.json index b3b15f1f5704..f975f5303e7b 100644 --- a/packages/apputils/package.json +++ b/packages/apputils/package.json @@ -38,16 +38,16 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", + "@phosphor/disposable": "^1.3.0", "@phosphor/domutils": "^1.1.3", - "@phosphor/messaging": "^1.2.3", + "@phosphor/messaging": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/virtualdom": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/virtualdom": "^1.2.0", + "@phosphor/widgets": "^1.9.0", "@types/react": "~16.8.18", "react": "~16.8.4", "react-dom": "~16.8.4", diff --git a/packages/attachments/package.json b/packages/attachments/package.json index 801359be20a4..121ccd0a652f 100644 --- a/packages/attachments/package.json +++ b/packages/attachments/package.json @@ -39,8 +39,8 @@ "@jupyterlab/observables": "^2.4.0-alpha.0", "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", - "@phosphor/disposable": "^1.2.0", - "@phosphor/signaling": "^1.2.3" + "@phosphor/disposable": "^1.3.0", + "@phosphor/signaling": "^1.3.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/cells/package.json b/packages/cells/package.json index 29ee6ede9b4f..f506d940e744 100644 --- a/packages/cells/package.json +++ b/packages/cells/package.json @@ -44,13 +44,13 @@ "@jupyterlab/outputarea": "^1.2.0-alpha.0", "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/dragdrop": "^1.3.3", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/virtualdom": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/dragdrop": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/virtualdom": "^1.2.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index 428c03cfbf56..cd31d7f27799 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -1154,6 +1154,9 @@ export class AttachmentsCell extends Cell { Promise.all(promises).then(models => { models.forEach(model => { if (model.type === 'file' && model.format === 'base64') { + if (!this.model.attachments.has(model.name)) { + this._updateCellSourceWithAttachment(model.name); + } this.model.attachments.set(model.name, { [model.mimetype]: model.content }); diff --git a/packages/cells/style/index.css b/packages/cells/style/index.css index ec12e183130f..dfc4cf7b00d8 100644 --- a/packages/cells/style/index.css +++ b/packages/cells/style/index.css @@ -6,6 +6,7 @@ /* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */ @import url('~@phosphor/widgets/style/index.css'); @import url('~@jupyterlab/apputils/style/index.css'); +@import url('~@phosphor/dragdrop/style/index.css'); @import url('~@jupyterlab/codeeditor/style/index.css'); @import url('~@jupyterlab/codemirror/style/index.css'); @import url('~@jupyterlab/rendermime/style/index.css'); diff --git a/packages/codeeditor/package.json b/packages/codeeditor/package.json index bc492f72d26e..d13b3305bfda 100644 --- a/packages/codeeditor/package.json +++ b/packages/codeeditor/package.json @@ -38,11 +38,11 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/observables": "^2.4.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/dragdrop": "^1.3.3", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/disposable": "^1.3.0", + "@phosphor/dragdrop": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/codemirror-extension/package.json b/packages/codemirror-extension/package.json index 410c7c4c7198..83e7748062ea 100644 --- a/packages/codemirror-extension/package.json +++ b/packages/codemirror-extension/package.json @@ -44,7 +44,7 @@ "@jupyterlab/fileeditor": "^1.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", - "@phosphor/widgets": "^1.8.0", + "@phosphor/widgets": "^1.9.0", "codemirror": "~5.47.0" }, "devDependencies": { diff --git a/packages/codemirror/package.json b/packages/codemirror/package.json index 8637a1f11a3c..3e920a141973 100644 --- a/packages/codemirror/package.json +++ b/packages/codemirror/package.json @@ -38,12 +38,12 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/observables": "^2.4.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/disposable": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "codemirror": "~5.47.0", "react": "~16.8.4" }, diff --git a/packages/completer-extension/package.json b/packages/completer-extension/package.json index ab2f0a87d206..8b19e0b74a19 100644 --- a/packages/completer-extension/package.json +++ b/packages/completer-extension/package.json @@ -42,8 +42,8 @@ "@jupyterlab/fileeditor": "^1.2.0-alpha.0", "@jupyterlab/notebook": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/algorithm": "^1.2.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/completer/package.json b/packages/completer/package.json index 076de5eb9542..944028b5255d 100644 --- a/packages/completer/package.json +++ b/packages/completer/package.json @@ -39,13 +39,13 @@ "@jupyterlab/codeeditor": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", + "@phosphor/disposable": "^1.3.0", "@phosphor/domutils": "^1.1.3", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/console-extension/package.json b/packages/console-extension/package.json index 72eb69954478..2ad56b48bbbd 100644 --- a/packages/console-extension/package.json +++ b/packages/console-extension/package.json @@ -45,11 +45,11 @@ "@jupyterlab/launcher": "^1.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/rendermime": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", + "@phosphor/disposable": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/console/package.json b/packages/console/package.json index 50d63fb12ae6..4d21bb718c76 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -42,13 +42,13 @@ "@jupyterlab/observables": "^2.4.0-alpha.0", "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/dragdrop": "^1.3.3", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/disposable": "^1.3.0", + "@phosphor/dragdrop": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/coreutils/package.json b/packages/coreutils/package.json index f052e21fb3a1..35139f14b74e 100644 --- a/packages/coreutils/package.json +++ b/packages/coreutils/package.json @@ -32,11 +32,11 @@ "watch": "tsc -b --watch" }, "dependencies": { - "@phosphor/commands": "^1.6.3", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", + "@phosphor/disposable": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/signaling": "^1.2.3", + "@phosphor/signaling": "^1.3.0", "ajv": "^6.5.5", "json5": "^2.1.0", "minimist": "~1.2.0", diff --git a/packages/csvviewer-extension/package.json b/packages/csvviewer-extension/package.json index 16ce9a0f07d8..b7b7eb8cb1ab 100644 --- a/packages/csvviewer-extension/package.json +++ b/packages/csvviewer-extension/package.json @@ -41,9 +41,9 @@ "@jupyterlab/docregistry": "^1.2.0-alpha.0", "@jupyterlab/documentsearch": "^1.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", - "@phosphor/datagrid": "^0.1.9", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/datagrid": "^0.1.11", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/csvviewer/package.json b/packages/csvviewer/package.json index ce180c1714c7..95ce6e22518f 100644 --- a/packages/csvviewer/package.json +++ b/packages/csvviewer/package.json @@ -38,13 +38,13 @@ "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/docregistry": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/datagrid": "^0.1.9", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/datagrid": "^0.1.11", + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/docmanager-extension/package.json b/packages/docmanager-extension/package.json index bc5576f1a510..9b6a08050249 100644 --- a/packages/docmanager-extension/package.json +++ b/packages/docmanager-extension/package.json @@ -44,10 +44,10 @@ "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/widgets": "^1.8.0" + "@phosphor/disposable": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/docmanager/package.json b/packages/docmanager/package.json index 7c22d72dd9d3..7730df2a2c68 100644 --- a/packages/docmanager/package.json +++ b/packages/docmanager/package.json @@ -40,13 +40,13 @@ "@jupyterlab/docregistry": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/docregistry/package.json b/packages/docregistry/package.json index 374599a2064d..c13f929b9932 100644 --- a/packages/docregistry/package.json +++ b/packages/docregistry/package.json @@ -43,12 +43,12 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/documentsearch-extension/package.json b/packages/documentsearch-extension/package.json index e48be2c9381a..78c0f614ca4a 100644 --- a/packages/documentsearch-extension/package.json +++ b/packages/documentsearch-extension/package.json @@ -37,7 +37,7 @@ "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/documentsearch": "^1.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/documentsearch/package.json b/packages/documentsearch/package.json index f526281c1112..050fec5e89cb 100644 --- a/packages/documentsearch/package.json +++ b/packages/documentsearch/package.json @@ -40,9 +40,9 @@ "@jupyterlab/fileeditor": "^1.2.0-alpha.0", "@jupyterlab/notebook": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/disposable": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "codemirror": "~5.47.0", "react": "~16.8.4" }, diff --git a/packages/extensionmanager/package.json b/packages/extensionmanager/package.json index b77cf1acea34..a0dd4c969b00 100644 --- a/packages/extensionmanager/package.json +++ b/packages/extensionmanager/package.json @@ -38,7 +38,7 @@ "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/messaging": "^1.2.3", + "@phosphor/messaging": "^1.3.0", "react": "~16.8.4", "react-paginate": "^6.3.0", "semver": "^6.1.0" diff --git a/packages/filebrowser-extension/package.json b/packages/filebrowser-extension/package.json index 7d306961cabb..0a60ca6d2951 100644 --- a/packages/filebrowser-extension/package.json +++ b/packages/filebrowser-extension/package.json @@ -46,10 +46,10 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/filebrowser/package.json b/packages/filebrowser/package.json index 592faceb6e71..c943fbcac4fe 100644 --- a/packages/filebrowser/package.json +++ b/packages/filebrowser/package.json @@ -35,6 +35,7 @@ "watch": "tsc -b --watch" }, "dependencies": { + "@jupyterlab/rendermime": "^1.1.0-alpha.2", "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/docmanager": "^1.2.0-alpha.0", @@ -42,14 +43,14 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", + "@phosphor/disposable": "^1.3.0", "@phosphor/domutils": "^1.1.3", - "@phosphor/dragdrop": "^1.3.3", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/dragdrop": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/filebrowser/style/index.css b/packages/filebrowser/style/index.css index edbcab7a21dd..010517ff085f 100644 --- a/packages/filebrowser/style/index.css +++ b/packages/filebrowser/style/index.css @@ -8,6 +8,7 @@ @import url('~@jupyterlab/ui-components/style/index.css'); @import url('~@jupyterlab/apputils/style/index.css'); @import url('~@phosphor/dragdrop/style/index.css'); +@import url('~@jupyterlab/rendermime/style/index.css'); @import url('~@jupyterlab/docregistry/style/index.css'); @import url('~@jupyterlab/docmanager/style/index.css'); diff --git a/packages/fileeditor-extension/package.json b/packages/fileeditor-extension/package.json index d38cccdbdf5b..70892af56ec0 100644 --- a/packages/fileeditor-extension/package.json +++ b/packages/fileeditor-extension/package.json @@ -48,7 +48,7 @@ "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/fileeditor/package.json b/packages/fileeditor/package.json index 5091a3ea1d5d..56b969b6149e 100644 --- a/packages/fileeditor/package.json +++ b/packages/fileeditor/package.json @@ -40,8 +40,8 @@ "@jupyterlab/docregistry": "^1.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/help-extension/package.json b/packages/help-extension/package.json index 374eb5ca1323..e0438a8c051e 100644 --- a/packages/help-extension/package.json +++ b/packages/help-extension/package.json @@ -42,7 +42,7 @@ "@jupyterlab/inspector": "^1.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/widgets": "^1.8.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/htmlviewer/package.json b/packages/htmlviewer/package.json index f28f546161d6..a50fc14232c1 100644 --- a/packages/htmlviewer/package.json +++ b/packages/htmlviewer/package.json @@ -36,7 +36,7 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/docregistry": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/signaling": "^1.2.3", + "@phosphor/signaling": "^1.3.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/imageviewer/package.json b/packages/imageviewer/package.json index 6afecf8df4be..41710e5d277a 100644 --- a/packages/imageviewer/package.json +++ b/packages/imageviewer/package.json @@ -39,8 +39,8 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/docregistry": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/inspector/package.json b/packages/inspector/package.json index 3d17439e6de5..35f4ba6baf56 100644 --- a/packages/inspector/package.json +++ b/packages/inspector/package.json @@ -41,9 +41,9 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/disposable": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/json-extension/package.json b/packages/json-extension/package.json index 691a7211bb71..a1856067a964 100644 --- a/packages/json-extension/package.json +++ b/packages/json-extension/package.json @@ -38,8 +38,8 @@ "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4", "react-dom": "~16.8.4", "react-highlighter": "^0.4.0", diff --git a/packages/launcher-extension/package.json b/packages/launcher-extension/package.json index dfb766683302..7cee1d2f0a03 100644 --- a/packages/launcher-extension/package.json +++ b/packages/launcher-extension/package.json @@ -39,9 +39,9 @@ "@jupyterlab/application": "^1.2.0-alpha.0", "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/launcher": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/launcher/package.json b/packages/launcher/package.json index 4b3726400e74..0795751bcd0a 100644 --- a/packages/launcher/package.json +++ b/packages/launcher/package.json @@ -37,12 +37,12 @@ "dependencies": { "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", + "@phosphor/disposable": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/mainmenu-extension/package.json b/packages/mainmenu-extension/package.json index 781f26f1b52f..24ec5d0bb477 100644 --- a/packages/mainmenu-extension/package.json +++ b/packages/mainmenu-extension/package.json @@ -41,9 +41,9 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/disposable": "^1.2.0", - "@phosphor/widgets": "^1.8.0" + "@phosphor/algorithm": "^1.2.0", + "@phosphor/disposable": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/mainmenu/package.json b/packages/mainmenu/package.json index d6ddcc4a842a..c5b45fe013e6 100644 --- a/packages/mainmenu/package.json +++ b/packages/mainmenu/package.json @@ -37,11 +37,11 @@ "dependencies": { "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/widgets": "^1.8.0" + "@phosphor/disposable": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/markdownviewer/package.json b/packages/markdownviewer/package.json index 9a805c5af014..1450ee56e1a7 100644 --- a/packages/markdownviewer/package.json +++ b/packages/markdownviewer/package.json @@ -40,8 +40,8 @@ "@jupyterlab/docregistry": "^1.2.0-alpha.0", "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/notebook-extension/package.json b/packages/notebook-extension/package.json index 6d929ddc4ce9..24c4b3efcbae 100644 --- a/packages/notebook-extension/package.json +++ b/packages/notebook-extension/package.json @@ -49,12 +49,12 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/notebook/package.json b/packages/notebook/package.json index 18d5d057f9da..59e59f1eac90 100644 --- a/packages/notebook/package.json +++ b/packages/notebook/package.json @@ -45,15 +45,15 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", "@phosphor/domutils": "^1.1.3", - "@phosphor/dragdrop": "^1.3.3", - "@phosphor/messaging": "^1.2.3", + "@phosphor/dragdrop": "^1.3.0", + "@phosphor/messaging": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/virtualdom": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/virtualdom": "^1.2.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/observables/package.json b/packages/observables/package.json index 3e0261a8f24a..94ce8a2d8a89 100644 --- a/packages/observables/package.json +++ b/packages/observables/package.json @@ -32,11 +32,11 @@ "watch": "tsc -b --watch" }, "dependencies": { - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3" + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/outputarea/package.json b/packages/outputarea/package.json index 71eff12d9a6b..79cc577dd8b9 100644 --- a/packages/outputarea/package.json +++ b/packages/outputarea/package.json @@ -41,13 +41,13 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", "@phosphor/properties": "^1.1.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/pdf-extension/package.json b/packages/pdf-extension/package.json index b19ee4ef3a31..ee0dd43e33c7 100644 --- a/packages/pdf-extension/package.json +++ b/packages/pdf-extension/package.json @@ -37,8 +37,8 @@ "dependencies": { "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/widgets": "^1.8.0" + "@phosphor/disposable": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/rendermime-interfaces/package.json b/packages/rendermime-interfaces/package.json index b492d9b47d58..269b4f587600 100644 --- a/packages/rendermime-interfaces/package.json +++ b/packages/rendermime-interfaces/package.json @@ -32,7 +32,7 @@ }, "dependencies": { "@phosphor/coreutils": "^1.3.1", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/rendermime/package.json b/packages/rendermime/package.json index 9cb5eb4b6207..42a8cd9d4c0e 100644 --- a/packages/rendermime/package.json +++ b/packages/rendermime/package.json @@ -41,11 +41,11 @@ "@jupyterlab/observables": "^2.4.0-alpha.0", "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "lodash.escape": "^4.0.1", "marked": "0.6.2" }, diff --git a/packages/running/package.json b/packages/running/package.json index 5637a6ba13f1..54325c7ec178 100644 --- a/packages/running/package.json +++ b/packages/running/package.json @@ -38,8 +38,8 @@ "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/signaling": "^1.2.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/signaling": "^1.3.0", "react": "~16.8.4" }, "devDependencies": { diff --git a/packages/services/package.json b/packages/services/package.json index 9ec7b99d5e97..b6d01c82a4c2 100644 --- a/packages/services/package.json +++ b/packages/services/package.json @@ -43,10 +43,10 @@ "dependencies": { "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/observables": "^2.4.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/signaling": "^1.2.3", + "@phosphor/disposable": "^1.3.0", + "@phosphor/signaling": "^1.3.0", "node-fetch": "^2.6.0", "ws": "^7.0.0" }, diff --git a/packages/settingeditor/package.json b/packages/settingeditor/package.json index 72f62dc3b8ad..d385131afe10 100644 --- a/packages/settingeditor/package.json +++ b/packages/settingeditor/package.json @@ -41,11 +41,11 @@ "@jupyterlab/inspector": "^1.2.0-alpha.0", "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/commands": "^1.6.3", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4", "react-dom": "~16.8.4" }, diff --git a/packages/shortcuts-extension/package.json b/packages/shortcuts-extension/package.json index ed262d6c3552..3f949cd9cf36 100644 --- a/packages/shortcuts-extension/package.json +++ b/packages/shortcuts-extension/package.json @@ -34,9 +34,9 @@ "dependencies": { "@jupyterlab/application": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", - "@phosphor/commands": "^1.6.3", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0" + "@phosphor/disposable": "^1.3.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/statusbar-extension/package.json b/packages/statusbar-extension/package.json index 6f7c68fb20c2..a47aa2a80327 100644 --- a/packages/statusbar-extension/package.json +++ b/packages/statusbar-extension/package.json @@ -46,7 +46,7 @@ "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/notebook": "^1.2.0-alpha.0", "@jupyterlab/statusbar": "^1.2.0-alpha.0", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "@types/react": "~16.8.18", diff --git a/packages/statusbar/package.json b/packages/statusbar/package.json index 200864246c33..529c61ed8e59 100644 --- a/packages/statusbar/package.json +++ b/packages/statusbar/package.json @@ -36,12 +36,12 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4", "typestyle": "^2.0.1" }, diff --git a/packages/tabmanager-extension/package.json b/packages/tabmanager-extension/package.json index 0345815be354..592161ed81d6 100644 --- a/packages/tabmanager-extension/package.json +++ b/packages/tabmanager-extension/package.json @@ -37,8 +37,8 @@ "dependencies": { "@jupyterlab/application": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/algorithm": "^1.2.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/terminal-extension/package.json b/packages/terminal-extension/package.json index 00aafce248f9..670db82a9d97 100644 --- a/packages/terminal-extension/package.json +++ b/packages/terminal-extension/package.json @@ -42,7 +42,7 @@ "@jupyterlab/launcher": "^1.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/terminal": "^1.2.0-alpha.0", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "@types/webpack-env": "^1.13.9", diff --git a/packages/terminal/package.json b/packages/terminal/package.json index 498e8ecfcac8..11a13d3079a4 100644 --- a/packages/terminal/package.json +++ b/packages/terminal/package.json @@ -39,8 +39,8 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", "@phosphor/domutils": "^1.1.3", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "xterm": "~3.13.2" }, "devDependencies": { diff --git a/packages/tooltip-extension/package.json b/packages/tooltip-extension/package.json index d4a869f968d3..bd9cdeb807dc 100644 --- a/packages/tooltip-extension/package.json +++ b/packages/tooltip-extension/package.json @@ -45,9 +45,9 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/tooltip": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/tooltip/package.json b/packages/tooltip/package.json index b582da3c4e00..3938fe2aeff6 100644 --- a/packages/tooltip/package.json +++ b/packages/tooltip/package.json @@ -40,8 +40,8 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0" + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "rimraf": "~2.6.2", diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 6fa25b3150d0..6c022aaf10cf 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -37,9 +37,9 @@ "@blueprintjs/select": "^3.3.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/virtualdom": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/virtualdom": "^1.2.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4", "typestyle": "^2.0.1" }, diff --git a/packages/vdom/package.json b/packages/vdom/package.json index 69cfce79782a..ecebe13ec19e 100644 --- a/packages/vdom/package.json +++ b/packages/vdom/package.json @@ -40,8 +40,8 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@nteract/transform-vdom": "^4.0.1", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "react": "~16.8.4", "react-dom": "~16.8.4" }, diff --git a/packages/vega4-extension/package.json b/packages/vega4-extension/package.json index 33d38837c455..13bba05d9ef5 100644 --- a/packages/vega4-extension/package.json +++ b/packages/vega4-extension/package.json @@ -36,7 +36,7 @@ "dependencies": { "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "@types/webpack-env": "^1.13.9", diff --git a/packages/vega5-extension/package.json b/packages/vega5-extension/package.json index 79b2d523891b..ce3d198533cd 100644 --- a/packages/vega5-extension/package.json +++ b/packages/vega5-extension/package.json @@ -36,7 +36,7 @@ "dependencies": { "@jupyterlab/rendermime-interfaces": "^1.5.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/widgets": "^1.8.0" + "@phosphor/widgets": "^1.9.0" }, "devDependencies": { "@types/webpack-env": "^1.13.9", diff --git a/tests/package.json b/tests/package.json index e314dcce21a4..912c24b74cce 100644 --- a/tests/package.json +++ b/tests/package.json @@ -27,15 +27,15 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/terminal": "^1.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", + "@phosphor/disposable": "^1.3.0", "@phosphor/domutils": "^1.1.3", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/virtualdom": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/virtualdom": "^1.2.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "expect.js": "~0.3.1", "json-to-html": "~0.1.2", diff --git a/tests/test-application/package.json b/tests/test-application/package.json index 8ac93788dde3..078db15681f9 100644 --- a/tests/test-application/package.json +++ b/tests/test-application/package.json @@ -16,10 +16,10 @@ "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/commands": "^1.6.3", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-apputils/package.json b/tests/test-apputils/package.json index d5f81dd994dd..15a95a6c7c71 100644 --- a/tests/test-apputils/package.json +++ b/tests/test-apputils/package.json @@ -15,12 +15,12 @@ "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/virtualdom": "^1.1.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/virtualdom": "^1.2.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-cells/package.json b/tests/test-cells/package.json index 77fe90436590..2a285a7f2e42 100644 --- a/tests/test-cells/package.json +++ b/tests/test-cells/package.json @@ -18,10 +18,10 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/outputarea": "^1.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-codeeditor/package.json b/tests/test-codeeditor/package.json index 97769d5cae9b..a750d0bacb4d 100644 --- a/tests/test-codeeditor/package.json +++ b/tests/test-codeeditor/package.json @@ -16,8 +16,8 @@ "@jupyterlab/codemirror": "^1.2.0-alpha.0", "@jupyterlab/observables": "^2.4.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-completer/package.json b/tests/test-completer/package.json index da96a9199155..f38fb96ad439 100644 --- a/tests/test-completer/package.json +++ b/tests/test-completer/package.json @@ -17,10 +17,10 @@ "@jupyterlab/codemirror": "^1.2.0-alpha.0", "@jupyterlab/completer": "^1.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-console/package.json b/tests/test-console/package.json index d0e01a808291..7d6513f82a91 100644 --- a/tests/test-console/package.json +++ b/tests/test-console/package.json @@ -24,9 +24,9 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0" }, "devDependencies": { diff --git a/tests/test-coreutils/package.json b/tests/test-coreutils/package.json index 5e18a3c371dd..73d5351c6507 100644 --- a/tests/test-coreutils/package.json +++ b/tests/test-coreutils/package.json @@ -15,8 +15,8 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/signaling": "^1.2.3", + "@phosphor/disposable": "^1.3.0", + "@phosphor/signaling": "^1.3.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-csvviewer/package.json b/tests/test-csvviewer/package.json index ac9d0768d324..7b6a980c1de2 100644 --- a/tests/test-csvviewer/package.json +++ b/tests/test-csvviewer/package.json @@ -21,8 +21,8 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/datagrid": "^0.1.9", - "@phosphor/widgets": "^1.8.0", + "@phosphor/datagrid": "^0.1.11", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "csv-spectrum": "~1.0.0", "simulate-event": "~1.4.0" diff --git a/tests/test-docmanager/package.json b/tests/test-docmanager/package.json index 83039cd65de5..33ac0ef4ff87 100644 --- a/tests/test-docmanager/package.json +++ b/tests/test-docmanager/package.json @@ -21,8 +21,8 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0" }, "devDependencies": { diff --git a/tests/test-docregistry/package.json b/tests/test-docregistry/package.json index fd6949c2464b..0f0982b48186 100644 --- a/tests/test-docregistry/package.json +++ b/tests/test-docregistry/package.json @@ -16,11 +16,11 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/disposable": "^1.2.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/disposable": "^1.3.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-filebrowser/package.json b/tests/test-filebrowser/package.json index e42c36bac7c4..11f109be504b 100644 --- a/tests/test-filebrowser/package.json +++ b/tests/test-filebrowser/package.json @@ -23,10 +23,10 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", "@jupyterlab/ui-components": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "simulate-event": "~1.4.0" }, diff --git a/tests/test-fileeditor/package.json b/tests/test-fileeditor/package.json index 71580df890a4..2458c88ef72d 100644 --- a/tests/test-fileeditor/package.json +++ b/tests/test-fileeditor/package.json @@ -18,8 +18,8 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-imageviewer/package.json b/tests/test-imageviewer/package.json index 0dd2ace8a943..6a4a41463c62 100644 --- a/tests/test-imageviewer/package.json +++ b/tests/test-imageviewer/package.json @@ -17,8 +17,8 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-inspector/package.json b/tests/test-inspector/package.json index 7549e97786e4..032289541be2 100644 --- a/tests/test-inspector/package.json +++ b/tests/test-inspector/package.json @@ -14,8 +14,8 @@ "dependencies": { "@jupyterlab/inspector": "^1.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-mainmenu/package.json b/tests/test-mainmenu/package.json index 985248e30eb9..975d9e7199c9 100644 --- a/tests/test-mainmenu/package.json +++ b/tests/test-mainmenu/package.json @@ -15,9 +15,9 @@ "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/mainmenu": "^1.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", - "@phosphor/commands": "^1.6.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/algorithm": "^1.2.0", + "@phosphor/commands": "^1.7.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-notebook/package.json b/tests/test-notebook/package.json index 3107a0c52e22..4394b0c7db29 100644 --- a/tests/test-notebook/package.json +++ b/tests/test-notebook/package.json @@ -26,10 +26,10 @@ "@jupyterlab/notebook": "^1.2.0-alpha.0", "@jupyterlab/observables": "^2.4.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "simulate-event": "~1.4.0" }, diff --git a/tests/test-observables/package.json b/tests/test-observables/package.json index 31d150b8df3c..d5ec79c8adb3 100644 --- a/tests/test-observables/package.json +++ b/tests/test-observables/package.json @@ -14,7 +14,7 @@ "dependencies": { "@jupyterlab/observables": "^2.4.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", "chai": "^4.2.0", "jest": "^24.7.1", diff --git a/tests/test-outputarea/package.json b/tests/test-outputarea/package.json index 011bb646310a..cec41d73fb26 100644 --- a/tests/test-outputarea/package.json +++ b/tests/test-outputarea/package.json @@ -17,8 +17,8 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-rendermime/package.json b/tests/test-rendermime/package.json index 220970fba3e8..17248be582b8 100644 --- a/tests/test-rendermime/package.json +++ b/tests/test-rendermime/package.json @@ -22,9 +22,9 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/widgets": "^1.8.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0" }, "devDependencies": { diff --git a/tests/test-services/package.json b/tests/test-services/package.json index 9086ee39f529..1e76c3d50533 100644 --- a/tests/test-services/package.json +++ b/tests/test-services/package.json @@ -15,9 +15,9 @@ "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/algorithm": "^1.1.3", + "@phosphor/algorithm": "^1.2.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/signaling": "^1.2.3", + "@phosphor/signaling": "^1.3.0", "chai": "^4.2.0", "jest": "^24.7.1", "jest-junit": "^6.3.0", diff --git a/tests/test-statusbar/package.json b/tests/test-statusbar/package.json index d659a17b904d..e76baba509aa 100644 --- a/tests/test-statusbar/package.json +++ b/tests/test-statusbar/package.json @@ -14,8 +14,8 @@ "dependencies": { "@jupyterlab/statusbar": "^1.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/signaling": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/signaling": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0", "jest": "^24.7.1", "ts-jest": "^24.0.2" diff --git a/tests/test-terminal/package.json b/tests/test-terminal/package.json index 1d0511611e22..2cc81fadd0aa 100644 --- a/tests/test-terminal/package.json +++ b/tests/test-terminal/package.json @@ -19,8 +19,8 @@ "@jupyterlab/services": "^4.2.0-alpha.0", "@jupyterlab/terminal": "^1.2.0-alpha.0", "@jupyterlab/testutils": "^1.2.0-alpha.0", - "@phosphor/messaging": "^1.2.3", - "@phosphor/widgets": "^1.8.0", + "@phosphor/messaging": "^1.3.0", + "@phosphor/widgets": "^1.9.0", "chai": "^4.2.0" }, "devDependencies": { diff --git a/testutils/package.json b/testutils/package.json index 66d9493a174a..d1ca7224ed74 100644 --- a/testutils/package.json +++ b/testutils/package.json @@ -41,7 +41,7 @@ "@jupyterlab/rendermime": "^1.2.0-alpha.0", "@jupyterlab/services": "^4.2.0-alpha.0", "@phosphor/coreutils": "^1.3.1", - "@phosphor/signaling": "^1.2.3", + "@phosphor/signaling": "^1.3.0", "fs-extra": "^8.0.1", "identity-obj-proxy": "^3.0.0", "json-to-html": "~0.1.2", diff --git a/yarn.lock b/yarn.lock index f61ce937f392..3b643bb85a13 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1635,127 +1635,127 @@ universal-user-agent "^2.0.0" url-template "^2.0.8" -"@phosphor/algorithm@^1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@phosphor/algorithm/-/algorithm-1.1.3.tgz#fb0e974f4e81aadc06f948770b3060c4ec8a1e27" - integrity sha512-+dkdYTBglR+qGnLVQdCvYojNZMGxf+xSl1Jeksha3pm7niQktSFz2aR5gEPu/nI5LM8T8slTpqE4Pjvq8P+IVA== +"@phosphor/algorithm@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@phosphor/algorithm/-/algorithm-1.2.0.tgz#4a19aa59261b7270be696672dc3f0663f7bef152" + integrity sha512-C9+dnjXyU2QAkWCW6QVDGExk4hhwxzAKf5/FIuYlHAI9X5vFv99PYm0EREDxX1PbMuvfFBZhPNu0PvuSDQ7sFA== -"@phosphor/application@^1.6.3": - version "1.6.3" - resolved "https://registry.yarnpkg.com/@phosphor/application/-/application-1.6.3.tgz#69f5eab109b54ee06d39443fa2f0ded573c5a080" - integrity sha512-UaRR91MWBZwNBGt0ekLVaN98KSwffRE0nsu+UgAmd4s8J28vVCQAPqXx1SjNPnaYVILnXD5whmCA02Ca81bR/A== +"@phosphor/application@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@phosphor/application/-/application-1.7.0.tgz#fc6ca5eb262f4a1ea72b3d819ce2bcf52cbbc974" + integrity sha512-7qarGeOumovqUvCM2G7MeRjEcMJouFVfRVR2U8nAVDh0JvC6y6lrDvGoyBM2y4mQbnjKqR+uoJtcgkZ3geOmVw== dependencies: - "@phosphor/commands" "^1.6.3" + "@phosphor/commands" "^1.7.0" "@phosphor/coreutils" "^1.3.1" - "@phosphor/widgets" "^1.8.0" + "@phosphor/widgets" "^1.9.0" -"@phosphor/collections@^1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@phosphor/collections/-/collections-1.1.3.tgz#c938ee4138d97377bba1f0970102071ca3ac1420" - integrity sha512-J2U1xd2e5LtqoOJt4kynrjDNeHhVpJjuY2/zA0InS5kyOuWmvy79pt/KJ22n0LBNcU/fjkImqtQmbrC2Z4q2xQ== +"@phosphor/collections@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@phosphor/collections/-/collections-1.2.0.tgz#a8cdd0edc0257de7c33306a91caf47910036307f" + integrity sha512-T9/0EjSuY6+ga2LIFRZ0xupciOR3Qnyy8Q95lhGTC0FXZUFwC8fl9e8On6IcwasCszS+1n8dtZUWSIynfgdpzw== dependencies: - "@phosphor/algorithm" "^1.1.3" + "@phosphor/algorithm" "^1.2.0" -"@phosphor/commands@^1.6.3": - version "1.6.3" - resolved "https://registry.yarnpkg.com/@phosphor/commands/-/commands-1.6.3.tgz#d5481cc35dab34d0e60b3e04a64df00e1bbaffbd" - integrity sha512-PYNHWv6tbXAfAtKiqXuT0OBJvwbJ+RRTV60MBykMF7Vqz9UaZ9n2e/eB2EAGEFccF0PnjTCvBEZgarwwMVi8Hg== +"@phosphor/commands@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@phosphor/commands/-/commands-1.7.0.tgz#9c72b6b6de9a2f819d22d0dd737f5515fa55b8ba" + integrity sha512-2tkij4fiU0WcnUiY0H0kX9mQhdJms5X6s+X9Uzx5P+KJZm0B83VIC1OEb1YYDYh8ar+LMr0dBnM5ljvZbptUXw== dependencies: - "@phosphor/algorithm" "^1.1.3" + "@phosphor/algorithm" "^1.2.0" "@phosphor/coreutils" "^1.3.1" - "@phosphor/disposable" "^1.2.0" + "@phosphor/disposable" "^1.3.0" "@phosphor/domutils" "^1.1.3" "@phosphor/keyboard" "^1.1.3" - "@phosphor/signaling" "^1.2.3" + "@phosphor/signaling" "^1.3.0" "@phosphor/coreutils@^1.3.1": version "1.3.1" resolved "https://registry.yarnpkg.com/@phosphor/coreutils/-/coreutils-1.3.1.tgz#441e34f42340f7faa742a88b2a181947a88d7226" integrity sha512-9OHCn8LYRcPU/sbHm5v7viCA16Uev3gbdkwqoQqlV+EiauDHl70jmeL7XVDXdigl66Dz0LI11C99XOxp+s3zOA== -"@phosphor/datagrid@^0.1.9": - version "0.1.9" - resolved "https://registry.yarnpkg.com/@phosphor/datagrid/-/datagrid-0.1.9.tgz#7a20383f6dad254e10a226180f90de94fe08e612" - integrity sha512-8YV8u/o7jV9TJM/vh/jyqEg4xaDSce0D+iWs73ZQRjnGwbxHPsfA2bPpGli5Z28DLsPqKlsiXOxqzYXnTqaI4w== +"@phosphor/datagrid@^0.1.11": + version "0.1.11" + resolved "https://registry.yarnpkg.com/@phosphor/datagrid/-/datagrid-0.1.11.tgz#ebf884ec506f7a875df94abc57aa5a5bdae369fa" + integrity sha512-mGJDbkYx5Wd4X4SO8FO+IHY3bq2ukx63/Fk98AZbunzLO2BgM22c60j/h8KS/nFAThJC0pDB4isG6w3Z62f/Zw== dependencies: - "@phosphor/algorithm" "^1.1.3" + "@phosphor/algorithm" "^1.2.0" "@phosphor/coreutils" "^1.3.1" - "@phosphor/disposable" "^1.2.0" + "@phosphor/disposable" "^1.3.0" "@phosphor/domutils" "^1.1.3" - "@phosphor/dragdrop" "^1.3.3" - "@phosphor/messaging" "^1.2.3" - "@phosphor/signaling" "^1.2.3" - "@phosphor/widgets" "^1.8.0" + "@phosphor/dragdrop" "^1.4.0" + "@phosphor/messaging" "^1.3.0" + "@phosphor/signaling" "^1.3.0" + "@phosphor/widgets" "^1.9.0" -"@phosphor/disposable@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@phosphor/disposable/-/disposable-1.2.0.tgz#878b9b5863f2026bbf2935eb600c7fdc97d0d026" - integrity sha512-4PoWoffdrLyWOW5Qv7I8//owvZmv57YhaxetAMWeJl13ThXc901RprL0Gxhtue2ZxL2PtUjM1207HndKo2FVjA== +"@phosphor/disposable@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@phosphor/disposable/-/disposable-1.3.0.tgz#3321a420e14acf0761a559f202bf98d4c46b8163" + integrity sha512-wHQov7HoS20mU6yuEz5ZMPhfxHdcxGovjPoid0QwccUEOm33UBkWlxaJGm9ONycezIX8je7ZuPOf/gf7JI6Dlg== dependencies: - "@phosphor/algorithm" "^1.1.3" - "@phosphor/signaling" "^1.2.3" + "@phosphor/algorithm" "^1.2.0" + "@phosphor/signaling" "^1.3.0" "@phosphor/domutils@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@phosphor/domutils/-/domutils-1.1.3.tgz#5aeeaefb4bbfcc7c0942e5287a29d3c7f2b1a2bc" integrity sha512-5CtLAhURQXXHhNXfQydDk/luG1cDVnhlu/qw7gz8/9pht0KXIAmNg/M0LKxx2oJ9+YMNCLVWxAnHAU0yrDpWSA== -"@phosphor/dragdrop@^1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@phosphor/dragdrop/-/dragdrop-1.3.3.tgz#9487d27a6eb8cd54bfe6d91eaffc9d0852817b61" - integrity sha512-+SrlGsVQwY8OHCWxE/Zvihpk6Rc6bytJDqOUUTZqdL8hvM9QZeopAFioPDxuo1pTj87Um6cR4ekvbTU4KZ/90w== +"@phosphor/dragdrop@^1.3.0", "@phosphor/dragdrop@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@phosphor/dragdrop/-/dragdrop-1.4.0.tgz#f626465714965d7bd4ea9b269ed0289c05f427a7" + integrity sha512-JqmDAKczviUe7NEkiDf/A6H2glgVmHAREip8dGBli4lvV+CQqPFyl4Xm7XCnR9qiEqNrP+0SfwPpywNa0me3nQ== dependencies: "@phosphor/coreutils" "^1.3.1" - "@phosphor/disposable" "^1.2.0" + "@phosphor/disposable" "^1.3.0" "@phosphor/keyboard@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@phosphor/keyboard/-/keyboard-1.1.3.tgz#e5fd13af0479034ef0b5fffcf43ef2d4a266b5b6" integrity sha512-dzxC/PyHiD6mXaESRy6PZTd9JeK+diwG1pyngkyUf127IXOEzubTIbu52VSdpGBklszu33ws05BAGDa4oBE4mQ== -"@phosphor/messaging@^1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@phosphor/messaging/-/messaging-1.2.3.tgz#860423261df8ac6c30344cc036b10b0e83d3c0db" - integrity sha512-89Ps4uSRNOEQoepB/0SDoyPpNUWd6VZnmbMetmeXZJHsuJ1GLxtnq3WBdl7UCVNsw3W9NC610pWaDCy/BafRlg== +"@phosphor/messaging@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@phosphor/messaging/-/messaging-1.3.0.tgz#a140e6dd28a496260779acf74860f738c654c65e" + integrity sha512-k0JE+BTMKlkM335S2AmmJxoYYNRwOdW5jKBqLgjJdGRvUQkM0+2i60ahM45+J23atGJDv9esKUUBINiKHFhLew== dependencies: - "@phosphor/algorithm" "^1.1.3" - "@phosphor/collections" "^1.1.3" + "@phosphor/algorithm" "^1.2.0" + "@phosphor/collections" "^1.2.0" "@phosphor/properties@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@phosphor/properties/-/properties-1.1.3.tgz#63e4355be5e22a411c566fd1860207038f171598" integrity sha512-GiglqzU77s6+tFVt6zPq9uuyu/PLQPFcqZt914ZhJ4cN/7yNI/SLyMzpYZ56IRMXvzK9TUgbRna6URE3XAwFUg== -"@phosphor/signaling@^1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@phosphor/signaling/-/signaling-1.2.3.tgz#2fde0ee810b0fab5f3fc765f81ed08ae671e76f1" - integrity sha512-DMwS0m9OgfY5ljpTsklRQPUQpTyg4obz85FyImRDacUVxUVbas95djIDEbU4s1TMzdHBBO+gfki3V4giXUvXzw== +"@phosphor/signaling@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@phosphor/signaling/-/signaling-1.3.0.tgz#9de9904e07aaf6eb82074de29017c7c2bf1fd3df" + integrity sha512-ZbG2Mof4LGSkaEuDicqA2o2TKu3i5zanjr2GkevI/82aKBD7cI1NGLGT55HZwtE87/gOF4FIM3d3DeyrFDMjMQ== dependencies: - "@phosphor/algorithm" "^1.1.3" + "@phosphor/algorithm" "^1.2.0" -"@phosphor/virtualdom@^1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@phosphor/virtualdom/-/virtualdom-1.1.3.tgz#33ddebc710ad5bd136fd5f61d7adb4fa14e781e0" - integrity sha512-V8PHhhnZCRa5esrC4q5VthqlLtxTo9ZV1mZ6b4YEloapca1S1nggZSQhrSlltXQjtYNUaWJZUZ/BlFD8wFtIEQ== +"@phosphor/virtualdom@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@phosphor/virtualdom/-/virtualdom-1.2.0.tgz#6a233312f817eb02555a0359c4ae3e501fa62bca" + integrity sha512-L9mKNhK2XtVjzjuHLG2uYuepSz8uPyu6vhF4EgCP0rt0TiLYaZeHwuNu3XeFbul9DMOn49eBpye/tfQVd4Ks+w== dependencies: - "@phosphor/algorithm" "^1.1.3" + "@phosphor/algorithm" "^1.2.0" -"@phosphor/widgets@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@phosphor/widgets/-/widgets-1.8.0.tgz#879a28366bc53df9077662eb3178af86ffa3e95e" - integrity sha512-Tkjk1bJks9Dtm7lhxTcpA+cSGwdNvRWG5TrolS0waSUiEdgrStWc8QnkMga3zwUZ9Wrz3cLZWnqBfxMjDqwMnA== +"@phosphor/widgets@^1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@phosphor/widgets/-/widgets-1.9.0.tgz#fd234cf3c515aaa7a072e9c62eecf7416f703fc7" + integrity sha512-Op6H0lI7MlHAs+htzy+6fL+x3TxG0N024RGsdIYkaNKyeSw6b7ZUXcd7mKCeabWPoTwiMCx3kiLTvExmNSYgwA== dependencies: - "@phosphor/algorithm" "^1.1.3" - "@phosphor/commands" "^1.6.3" + "@phosphor/algorithm" "^1.2.0" + "@phosphor/commands" "^1.7.0" "@phosphor/coreutils" "^1.3.1" - "@phosphor/disposable" "^1.2.0" + "@phosphor/disposable" "^1.3.0" "@phosphor/domutils" "^1.1.3" - "@phosphor/dragdrop" "^1.3.3" + "@phosphor/dragdrop" "^1.4.0" "@phosphor/keyboard" "^1.1.3" - "@phosphor/messaging" "^1.2.3" + "@phosphor/messaging" "^1.3.0" "@phosphor/properties" "^1.1.3" - "@phosphor/signaling" "^1.2.3" - "@phosphor/virtualdom" "^1.1.3" + "@phosphor/signaling" "^1.3.0" + "@phosphor/virtualdom" "^1.2.0" "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" From 8e8362a53988f40d03808ea0f34f5d8485f53e17 Mon Sep 17 00:00:00 2001 From: madhu94 Date: Sun, 18 Aug 2019 16:50:55 +0530 Subject: [PATCH 06/15] Remove check based on model.name --- packages/cells/src/widget.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index cd31d7f27799..428c03cfbf56 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -1154,9 +1154,6 @@ export class AttachmentsCell extends Cell { Promise.all(promises).then(models => { models.forEach(model => { if (model.type === 'file' && model.format === 'base64') { - if (!this.model.attachments.has(model.name)) { - this._updateCellSourceWithAttachment(model.name); - } this.model.attachments.set(model.name, { [model.mimetype]: model.content }); From ceaa00c282adbc4ea89211cf0106b739b83fb0e9 Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Wed, 21 Aug 2019 11:29:05 +0100 Subject: [PATCH 07/15] Lint --- packages/filebrowser/tsconfig.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/filebrowser/tsconfig.json b/packages/filebrowser/tsconfig.json index 4ef8d8e7c071..83d27b1a072a 100644 --- a/packages/filebrowser/tsconfig.json +++ b/packages/filebrowser/tsconfig.json @@ -4,9 +4,7 @@ "outDir": "lib", "rootDir": "src" }, - "include": [ - "src/*" - ], + "include": ["src/*"], "references": [ { "path": "../apputils" From d4813c5f74b5a7372b29ab7eb24c0474919d9e53 Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Wed, 21 Aug 2019 11:47:09 +0100 Subject: [PATCH 08/15] Thunk typing --- packages/cells/src/widget.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index 428c03cfbf56..ccaefd84e43b 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -156,6 +156,11 @@ const RENDER_TIMEOUT = 1000; */ const ATTACHMENTS_MIME = 'application/vnd.jupyter.attachments;closure=true'; +/** + * Type for attachment thunks. + */ +type AttachmentThunk = () => Promise; + /****************************************************************************** * Cell ******************************************************************************/ @@ -1146,11 +1151,8 @@ export class AttachmentsCell extends Cell { return; } - const thunks = event.mimeData.getData(ATTACHMENTS_MIME); - const promises: Promise[] = []; - thunks.forEach((fn: Function) => { - promises.push(fn()); - }); + const thunks: AttachmentThunk[] = event.mimeData.getData(ATTACHMENTS_MIME); + const promises = thunks.map(thunk => thunk()); Promise.all(promises).then(models => { models.forEach(model => { if (model.type === 'file' && model.format === 'base64') { From e18518e9a4c41aa82b25d8787eb122517a848568 Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Wed, 21 Aug 2019 11:47:45 +0100 Subject: [PATCH 09/15] Lints --- packages/cells/src/widget.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index ccaefd84e43b..63697a8bd778 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -1108,6 +1108,7 @@ export class AttachmentsCell extends Cell { break; case 'p-drop': this._evtDrop(event as IDragEvent); + break; default: break; } @@ -1153,7 +1154,7 @@ export class AttachmentsCell extends Cell { const thunks: AttachmentThunk[] = event.mimeData.getData(ATTACHMENTS_MIME); const promises = thunks.map(thunk => thunk()); - Promise.all(promises).then(models => { + void Promise.all(promises).then(models => { models.forEach(model => { if (model.type === 'file' && model.format === 'base64') { this.model.attachments.set(model.name, { From fa588ae606cf3f664e428c810c2d5b52c9d553d0 Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Wed, 21 Aug 2019 17:35:37 +0100 Subject: [PATCH 10/15] Minor cleanup --- jupyterlab/staging/yarn.lock | 17 ----------------- packages/attachments/src/model.ts | 1 + packages/cells/src/widget.ts | 2 +- packages/notebook/src/panel.ts | 19 ++++++++----------- 4 files changed, 10 insertions(+), 29 deletions(-) diff --git a/jupyterlab/staging/yarn.lock b/jupyterlab/staging/yarn.lock index 35f370e3656c..18ccfe81672a 100644 --- a/jupyterlab/staging/yarn.lock +++ b/jupyterlab/staging/yarn.lock @@ -1605,11 +1605,6 @@ ansi-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" @@ -5278,11 +5273,6 @@ safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@~5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" - integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== - safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -5662,13 +5652,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" diff --git a/packages/attachments/src/model.ts b/packages/attachments/src/model.ts index e37f5bcea627..03b0b4b8e8ae 100644 --- a/packages/attachments/src/model.ts +++ b/packages/attachments/src/model.ts @@ -71,6 +71,7 @@ export interface IAttachmentsModel extends IDisposable { * Remove the attachment whose name is the specified key */ remove(key: string): void; + /** * Clear all of the attachments. */ diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index 63697a8bd778..7f062935082a 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -1214,7 +1214,6 @@ export class AttachmentsCell extends Cell { */ private _attachFile(blob: File) { const reader = new FileReader(); - reader.readAsDataURL(blob); reader.onload = evt => { const { href, protocol } = URLExt.parse(reader.result as string); if (protocol !== 'data:') { @@ -1234,6 +1233,7 @@ export class AttachmentsCell extends Cell { reader.onerror = evt => { console.error(`Failed to attach ${blob.name}` + evt); }; + reader.readAsDataURL(blob); } /** diff --git a/packages/notebook/src/panel.ts b/packages/notebook/src/panel.ts index c9e2e08187b4..92cbad7cac87 100644 --- a/packages/notebook/src/panel.ts +++ b/packages/notebook/src/panel.ts @@ -1,7 +1,7 @@ // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. -import { ICellModel, MarkdownCellModel } from '@jupyterlab/cells'; +import { isMarkdownCellModel } from '@jupyterlab/cells'; import { Kernel, KernelMessage, Session } from '@jupyterlab/services'; @@ -80,18 +80,15 @@ export class NotebookPanel extends DocumentWidget { }); } - _onSave(sender: DocumentRegistry.Context, state: string) { - if (state === 'completed') { + _onSave(sender: DocumentRegistry.Context, state: DocumentRegistry.SaveState) { + if (state === 'started') { // Find markdown cells const { cells } = this.model; - each(cells, (cell: ICellModel) => { - if (cell.type === 'markdown') { - const markdowncell: MarkdownCellModel = cell as MarkdownCellModel; - const attachments: ReadonlyArray = - markdowncell.attachments.keys; - for (let i = 0; i < attachments.length; i++) { - if (!markdowncell.value.text.includes(attachments[i])) { - markdowncell.attachments.remove(attachments[i]); + each(cells, cell => { + if (isMarkdownCellModel(cell)) { + for (let key of cell.attachments.keys) { + if (!cell.value.text.includes(key)) { + cell.attachments.remove(key); } } } From 3496cce686a6e6896b6151e5dbad90718dbb012e Mon Sep 17 00:00:00 2001 From: madhu94 Date: Fri, 23 Aug 2019 04:01:44 +0530 Subject: [PATCH 11/15] Change mimetype set on drag event. Change from a custom attachments mimetype to mimetype of the contents model with the suffix ";closure=true" --- packages/attachments/src/model.ts | 2 +- packages/cells/src/widget.ts | 27 ++++++++++++++++++--------- packages/filebrowser/src/listing.ts | 18 +++++++++--------- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/packages/attachments/src/model.ts b/packages/attachments/src/model.ts index 03b0b4b8e8ae..12aa7b7e068e 100644 --- a/packages/attachments/src/model.ts +++ b/packages/attachments/src/model.ts @@ -70,7 +70,7 @@ export interface IAttachmentsModel extends IDisposable { /** * Remove the attachment whose name is the specified key */ - remove(key: string): void; + remove?: (key: string) => void; /** * Clear all of the attachments. diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index 7f062935082a..ab9f7383fccb 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -63,6 +63,7 @@ import { } from './model'; import { InputPlaceholder, OutputPlaceholder } from './placeholder'; +import { toArray, filter, map, IIterator } from '@phosphor/algorithm'; /** * The CSS class added to cell widgets. @@ -151,11 +152,6 @@ const DEFAULT_MARKDOWN_TEXT = 'Type Markdown and LaTeX: $ α^2 $'; */ const RENDER_TIMEOUT = 1000; -/** - * The mime type for attachments - */ -const ATTACHMENTS_MIME = 'application/vnd.jupyter.attachments;closure=true'; - /** * Type for attachment thunks. */ @@ -1115,7 +1111,12 @@ export class AttachmentsCell extends Cell { } private _evtDragOver(event: IDragEvent) { - if (!event.mimeData.getData(ATTACHMENTS_MIME)) { + const supportedMimeTypes = toArray( + filter(event.mimeData.types(), mimeType => + mimeType.endsWith(';closure=true') + ) + ); + if (supportedMimeTypes.length === 0) { return; } event.preventDefault(); @@ -1142,7 +1143,12 @@ export class AttachmentsCell extends Cell { * Handle the `'p-drop'` event for the widget. */ private _evtDrop(event: IDragEvent): void { - if (!event.mimeData.hasData(ATTACHMENTS_MIME)) { + const supportedMimeTypes = toArray( + filter(event.mimeData.types(), mimeType => + mimeType.endsWith(';closure=true') + ) + ); + if (supportedMimeTypes.length === 0) { return; } event.preventDefault(); @@ -1152,8 +1158,11 @@ export class AttachmentsCell extends Cell { return; } - const thunks: AttachmentThunk[] = event.mimeData.getData(ATTACHMENTS_MIME); - const promises = thunks.map(thunk => thunk()); + const thunks: IIterator = map( + supportedMimeTypes, + mimeType => event.mimeData.getData(mimeType) + ); + const promises = toArray(map(thunks, thunk => thunk())); void Promise.all(promises).then(models => { models.forEach(model => { if (model.type === 'file' && model.format === 'base64') { diff --git a/packages/filebrowser/src/listing.ts b/packages/filebrowser/src/listing.ts index c8a4ce39685a..8c462071f1b0 100644 --- a/packages/filebrowser/src/listing.ts +++ b/packages/filebrowser/src/listing.ts @@ -119,11 +119,6 @@ const MODIFIED_ID_CLASS = 'jp-id-modified'; */ const CONTENTS_MIME = 'application/x-jupyter-icontents'; -/** - * The mime type for attachments - */ -const ATTACHMENTS_MIME = 'application/vnd.jupyter.attachments;closure=true'; - /** * The class name added to drop targets. */ @@ -1221,10 +1216,15 @@ export class DirListing extends Widget { // when it's not needed. E.g. just moving files around // in a filebrowser if (selectedItems.length > 0) { - let attachmentThunks = paths.map(path => { - return () => services.contents.get(path); - }); - this._drag.mimeData.setData(ATTACHMENTS_MIME, attachmentThunks); + for (let i = 0; i < selectedItems.length; i++) { + const path = PathExt.join(basePath, selectedItems[i].name); + if (selectedItems[i].mimetype) { + this._drag.mimeData.setData( + `${selectedItems[i].mimetype};closure=true`, + () => services.contents.get(path) + ); + } + } } if (item && item.type !== 'directory') { From 1f9bfcf107910efb7ef5bd049f44a92eb54444fb Mon Sep 17 00:00:00 2001 From: madhu94 Date: Fri, 23 Aug 2019 04:29:05 +0530 Subject: [PATCH 12/15] Add TODO --- packages/attachments/src/model.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/attachments/src/model.ts b/packages/attachments/src/model.ts index 12aa7b7e068e..5c8c7bb31d51 100644 --- a/packages/attachments/src/model.ts +++ b/packages/attachments/src/model.ts @@ -67,8 +67,11 @@ export interface IAttachmentsModel extends IDisposable { */ set(key: string, attachment: nbformat.IMimeBundle): void; + // TODO: This is marked optional so as to be non-breaking for 1.x + // Make this property mandatory for 2.0 /** - * Remove the attachment whose name is the specified key + * Remove the attachment whose name is the specified key. + * Note that this is optional only until Jupyterlab 2.0 release. */ remove?: (key: string) => void; From 9fe9968abab0ad0c0a002ce6f13fb0d1c777364e Mon Sep 17 00:00:00 2001 From: madhu94 Date: Fri, 23 Aug 2019 22:54:28 +0530 Subject: [PATCH 13/15] Remove rendermine dependency in filebrowser --- packages/cells/src/widget.ts | 23 +++++++++++++---------- packages/filebrowser/package.json | 1 - packages/filebrowser/src/listing.ts | 20 ++++++-------------- packages/filebrowser/style/index.css | 1 - packages/filebrowser/tsconfig.json | 3 --- 5 files changed, 19 insertions(+), 29 deletions(-) diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index ab9f7383fccb..a65d9709e8e8 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -30,7 +30,8 @@ import { import { IRenderMime, MimeModel, - IRenderMimeRegistry + IRenderMimeRegistry, + imageRendererFactory } from '@jupyterlab/rendermime'; import { KernelMessage, Kernel, Contents } from '@jupyterlab/services'; @@ -63,7 +64,7 @@ import { } from './model'; import { InputPlaceholder, OutputPlaceholder } from './placeholder'; -import { toArray, filter, map, IIterator } from '@phosphor/algorithm'; +import { toArray, filter, map, IIterator, find } from '@phosphor/algorithm'; /** * The CSS class added to cell widgets. @@ -1111,12 +1112,10 @@ export class AttachmentsCell extends Cell { } private _evtDragOver(event: IDragEvent) { - const supportedMimeTypes = toArray( - filter(event.mimeData.types(), mimeType => - mimeType.endsWith(';closure=true') - ) + const supportedMimeType = find(imageRendererFactory.mimeTypes, mimeType => + event.mimeData.hasData(`${mimeType};closure=true`) ); - if (supportedMimeTypes.length === 0) { + if (!supportedMimeType) { return; } event.preventDefault(); @@ -1144,9 +1143,13 @@ export class AttachmentsCell extends Cell { */ private _evtDrop(event: IDragEvent): void { const supportedMimeTypes = toArray( - filter(event.mimeData.types(), mimeType => - mimeType.endsWith(';closure=true') - ) + filter(event.mimeData.types(), mimeType => { + const parsedMimeType = /(.*);closure=true/.exec(mimeType); + return ( + parsedMimeType !== null && + imageRendererFactory.mimeTypes.indexOf(parsedMimeType[1]) !== -1 + ); + }) ); if (supportedMimeTypes.length === 0) { return; diff --git a/packages/filebrowser/package.json b/packages/filebrowser/package.json index c943fbcac4fe..3868a46587be 100644 --- a/packages/filebrowser/package.json +++ b/packages/filebrowser/package.json @@ -35,7 +35,6 @@ "watch": "tsc -b --watch" }, "dependencies": { - "@jupyterlab/rendermime": "^1.1.0-alpha.2", "@jupyterlab/apputils": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", "@jupyterlab/docmanager": "^1.2.0-alpha.0", diff --git a/packages/filebrowser/src/listing.ts b/packages/filebrowser/src/listing.ts index 8c462071f1b0..b186c87e8c0e 100644 --- a/packages/filebrowser/src/listing.ts +++ b/packages/filebrowser/src/listing.ts @@ -18,8 +18,6 @@ import { import { DocumentRegistry } from '@jupyterlab/docregistry'; -import { imageRendererFactory } from '@jupyterlab/rendermime'; - import { Contents } from '@jupyterlab/services'; import { IIconRegistry } from '@jupyterlab/ui-components'; @@ -1204,10 +1202,7 @@ export class DirListing extends Widget { Object.keys(this._selection).forEach(itemname => { if (this._selection[itemname]) { const item = find(items, item => item.name === itemname); - if ( - item.type === 'file' && - imageRendererFactory.mimeTypes.indexOf(item.mimetype) !== -1 - ) { + if (item.mimetype !== null) { selectedItems.push(item); } } @@ -1216,14 +1211,11 @@ export class DirListing extends Widget { // when it's not needed. E.g. just moving files around // in a filebrowser if (selectedItems.length > 0) { - for (let i = 0; i < selectedItems.length; i++) { - const path = PathExt.join(basePath, selectedItems[i].name); - if (selectedItems[i].mimetype) { - this._drag.mimeData.setData( - `${selectedItems[i].mimetype};closure=true`, - () => services.contents.get(path) - ); - } + for (let item of selectedItems) { + const path = PathExt.join(basePath, item.name); + this._drag.mimeData.setData(`${item.mimetype};closure=true`, () => + services.contents.get(path) + ); } } diff --git a/packages/filebrowser/style/index.css b/packages/filebrowser/style/index.css index 010517ff085f..edbcab7a21dd 100644 --- a/packages/filebrowser/style/index.css +++ b/packages/filebrowser/style/index.css @@ -8,7 +8,6 @@ @import url('~@jupyterlab/ui-components/style/index.css'); @import url('~@jupyterlab/apputils/style/index.css'); @import url('~@phosphor/dragdrop/style/index.css'); -@import url('~@jupyterlab/rendermime/style/index.css'); @import url('~@jupyterlab/docregistry/style/index.css'); @import url('~@jupyterlab/docmanager/style/index.css'); diff --git a/packages/filebrowser/tsconfig.json b/packages/filebrowser/tsconfig.json index 83d27b1a072a..19a64feeabb3 100644 --- a/packages/filebrowser/tsconfig.json +++ b/packages/filebrowser/tsconfig.json @@ -18,9 +18,6 @@ { "path": "../docregistry" }, - { - "path": "../rendermime" - }, { "path": "../services" }, From fde26560b6b49ee3e44185dc8ce497559bbcf281 Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Tue, 3 Sep 2019 15:19:29 +0100 Subject: [PATCH 14/15] DnD attachments via rich contents mime Adds a rich contents mime type to allow extensions to more directly use the already fetched content models of the filebrowser. This is then used in the attachment cell widgets to synchronously insert the name (which will initially resolve to a broken image), and then start the async fetch. Also reefactors `updateCellSourceWithAttachment`. --- packages/cells/src/widget.ts | 165 +++++++++++++++++----------- packages/filebrowser/src/listing.ts | 57 ++++++---- 2 files changed, 137 insertions(+), 85 deletions(-) diff --git a/packages/cells/src/widget.ts b/packages/cells/src/widget.ts index a65d9709e8e8..740b69335ba4 100644 --- a/packages/cells/src/widget.ts +++ b/packages/cells/src/widget.ts @@ -16,6 +16,8 @@ import { import { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor'; +import { DirListing } from '@jupyterlab/filebrowser'; + import { IObservableMap } from '@jupyterlab/observables'; import { @@ -34,9 +36,16 @@ import { imageRendererFactory } from '@jupyterlab/rendermime'; -import { KernelMessage, Kernel, Contents } from '@jupyterlab/services'; +import { KernelMessage, Kernel } from '@jupyterlab/services'; + +import { + JSONValue, + PromiseDelegate, + JSONObject, + UUID +} from '@phosphor/coreutils'; -import { JSONValue, PromiseDelegate, JSONObject } from '@phosphor/coreutils'; +import { some, filter, toArray } from '@phosphor/algorithm'; import { IDragEvent } from '@phosphor/dragdrop'; @@ -64,7 +73,6 @@ import { } from './model'; import { InputPlaceholder, OutputPlaceholder } from './placeholder'; -import { toArray, filter, map, IIterator, find } from '@phosphor/algorithm'; /** * The CSS class added to cell widgets. @@ -154,9 +162,9 @@ const DEFAULT_MARKDOWN_TEXT = 'Type Markdown and LaTeX: $ α^2 $'; const RENDER_TIMEOUT = 1000; /** - * Type for attachment thunks. + * The mime type for a rich contents drag object. */ -type AttachmentThunk = () => Promise; +const CONTENTS_MIME_RICH = 'application/x-jupyter-icontentsrich'; /****************************************************************************** * Cell @@ -1075,7 +1083,7 @@ export namespace CodeCell { * `AttachmentsCell` - A base class for a cell widget that allows * attachments to be drag/drop'd or pasted onto it */ -export class AttachmentsCell extends Cell { +export abstract class AttachmentsCell extends Cell { /** * Handle the DOM events for the widget. * @@ -1111,10 +1119,51 @@ export class AttachmentsCell extends Cell { } } + /** + * Modify the cell source to include a reference to the attachment. + */ + protected abstract updateCellSourceWithAttachment( + attachmentName: string + ): void; + + /** + * Handle `after-attach` messages for the widget. + */ + protected onAfterAttach(msg: Message): void { + super.onAfterAttach(msg); + let node = this.node; + node.addEventListener('p-dragover', this); + node.addEventListener('p-drop', this); + node.addEventListener('dragenter', this); + node.addEventListener('dragover', this); + node.addEventListener('drop', this); + node.addEventListener('paste', this); + } + + /** + * A message handler invoked on a `'before-detach'` + * message + */ + protected onBeforeDetach(msg: Message): void { + let node = this.node; + node.removeEventListener('drop', this); + node.removeEventListener('dragover', this); + node.removeEventListener('dragenter', this); + node.removeEventListener('paste', this); + node.removeEventListener('p-dragover', this); + node.removeEventListener('p-drop', this); + } + private _evtDragOver(event: IDragEvent) { - const supportedMimeType = find(imageRendererFactory.mimeTypes, mimeType => - event.mimeData.hasData(`${mimeType};closure=true`) - ); + const supportedMimeType = some(imageRendererFactory.mimeTypes, mimeType => { + if (!event.mimeData.hasData(CONTENTS_MIME_RICH)) { + return false; + } + const data = event.mimeData.getData( + CONTENTS_MIME_RICH + ) as DirListing.IContentsThunk; + return data.model.mimetype === mimeType; + }); if (!supportedMimeType) { return; } @@ -1128,6 +1177,7 @@ export class AttachmentsCell extends Cell { */ private _evtPaste(event: ClipboardEvent): void { this._attachFiles(event.clipboardData.items); + event.preventDefault(); } /** @@ -1144,11 +1194,15 @@ export class AttachmentsCell extends Cell { private _evtDrop(event: IDragEvent): void { const supportedMimeTypes = toArray( filter(event.mimeData.types(), mimeType => { - const parsedMimeType = /(.*);closure=true/.exec(mimeType); - return ( - parsedMimeType !== null && - imageRendererFactory.mimeTypes.indexOf(parsedMimeType[1]) !== -1 - ); + if (mimeType === CONTENTS_MIME_RICH) { + const data = event.mimeData.getData( + CONTENTS_MIME_RICH + ) as DirListing.IContentsThunk; + return ( + imageRendererFactory.mimeTypes.indexOf(data.model.mimetype) !== -1 + ); + } + return imageRendererFactory.mimeTypes.indexOf(mimeType) !== -1; }) ); if (supportedMimeTypes.length === 0) { @@ -1160,50 +1214,30 @@ export class AttachmentsCell extends Cell { event.dropAction = 'none'; return; } - - const thunks: IIterator = map( - supportedMimeTypes, - mimeType => event.mimeData.getData(mimeType) - ); - const promises = toArray(map(thunks, thunk => thunk())); - void Promise.all(promises).then(models => { - models.forEach(model => { - if (model.type === 'file' && model.format === 'base64') { - this.model.attachments.set(model.name, { - [model.mimetype]: model.content + event.dropAction = 'copy'; + + for (const mimeType of supportedMimeTypes) { + if (mimeType === CONTENTS_MIME_RICH) { + const { model, withContent } = event.mimeData.getData( + CONTENTS_MIME_RICH + ) as DirListing.IContentsThunk; + if (model.type === 'file') { + this.updateCellSourceWithAttachment(model.name); + void withContent().then(fullModel => { + this.model.attachments.set(fullModel.name, { + [fullModel.mimetype]: fullModel.content + }); }); - this._updateCellSourceWithAttachment(model.name); } - }); - }); - } - - /** - * Handle `after-attach` messages for the widget. - */ - protected onAfterAttach(msg: Message): void { - super.onAfterAttach(msg); - let node = this.node; - node.addEventListener('p-dragover', this); - node.addEventListener('p-drop', this); - node.addEventListener('dragenter', this); - node.addEventListener('dragover', this); - node.addEventListener('drop', this); - node.addEventListener('paste', this); - } - - /** - * A message handler invoked on a `'before-detach'` - * message - */ - protected onBeforeDetach(msg: Message): void { - let node = this.node; - node.removeEventListener('drop', this); - node.removeEventListener('dragover', this); - node.removeEventListener('dragenter', this); - node.removeEventListener('paste', this); - node.removeEventListener('p-dragover', this); - node.removeEventListener('p-drop', this); + } else { + // Pure mimetype, no useful name to infer + const name = UUID.uuid4(); + this.model.attachments.set(name, { + [mimeType]: event.mimeData.getData(mimeType) + }); + this.updateCellSourceWithAttachment(name); + } + } } /** @@ -1240,7 +1274,7 @@ export class AttachmentsCell extends Cell { const encodedData = matches[3]; const bundle: nbformat.IMimeBundle = { [mimeType]: encodedData }; this.model.attachments.set(blob.name, bundle); - this._updateCellSourceWithAttachment(blob.name); + this.updateCellSourceWithAttachment(blob.name); }; reader.onerror = evt => { console.error(`Failed to attach ${blob.name}` + evt); @@ -1248,15 +1282,6 @@ export class AttachmentsCell extends Cell { reader.readAsDataURL(blob); } - /** - * Appends the text ![attachment](attachment: ) - * to the cell source - */ - private _updateCellSourceWithAttachment(attachmentName: string) { - const textToBeAppended = `![${attachmentName}](attachment:${attachmentName})`; - this.model.value.insert(this.model.value.text.length, textToBeAppended); - } - /** * The model used by the widget. */ @@ -1365,6 +1390,14 @@ export class MarkdownCell extends AttachmentsCell { super.onUpdateRequest(msg); } + /** + * Modify the cell source to include a reference to the attachment. + */ + protected updateCellSourceWithAttachment(attachmentName: string) { + const textToBeAppended = `![${attachmentName}](attachment:${attachmentName})`; + this.model.value.insert(this.model.value.text.length, textToBeAppended); + } + /** * Handle the rendered state. */ diff --git a/packages/filebrowser/src/listing.ts b/packages/filebrowser/src/listing.ts index b186c87e8c0e..230910d304cf 100644 --- a/packages/filebrowser/src/listing.ts +++ b/packages/filebrowser/src/listing.ts @@ -113,10 +113,15 @@ const NAME_ID_CLASS = 'jp-id-name'; const MODIFIED_ID_CLASS = 'jp-id-modified'; /** - * The mime type for a con tents drag object. + * The mime type for a contents drag object. */ const CONTENTS_MIME = 'application/x-jupyter-icontents'; +/** + * The mime type for a rich contents drag object. + */ +const CONTENTS_MIME_RICH = 'application/x-jupyter-icontentsrich'; + /** * The class name added to drop targets. */ @@ -1158,15 +1163,18 @@ export class DirListing extends Widget { let selectedNames = Object.keys(this._selection); let source = this._items[index]; let items = this._sortedItems; + let selectedItems: Contents.IModel[]; let item: Contents.IModel | undefined; // If the source node is not selected, use just that node. if (!source.classList.contains(SELECTED_CLASS)) { item = items[index]; selectedNames = [item.name]; + selectedItems = [item]; } else { let name = selectedNames[0]; item = find(items, value => value.name === name); + selectedItems = toArray(this.selectedItems()); } if (!item) { @@ -1197,26 +1205,18 @@ export class DirListing extends Widget { ); this._drag.mimeData.setData(CONTENTS_MIME, paths); - let services = this.model.manager.services; - const selectedItems: Contents.IModel[] = []; - Object.keys(this._selection).forEach(itemname => { - if (this._selection[itemname]) { - const item = find(items, item => item.name === itemname); - if (item.mimetype !== null) { - selectedItems.push(item); - } - } - }); - // We thunk this so we don't try to make a network call + // Add thunks for getting mime data content. + // We thunk the content so we don't try to make a network call // when it's not needed. E.g. just moving files around // in a filebrowser - if (selectedItems.length > 0) { - for (let item of selectedItems) { - const path = PathExt.join(basePath, item.name); - this._drag.mimeData.setData(`${item.mimetype};closure=true`, () => - services.contents.get(path) - ); - } + let services = this.model.manager.services; + for (const item of selectedItems) { + this._drag.mimeData.setData(CONTENTS_MIME_RICH, { + model: item, + withContent: async () => { + return await services.contents.get(item.path); + } + } as DirListing.IContentsThunk); } if (item && item.type !== 'directory') { @@ -1589,6 +1589,25 @@ export namespace DirListing { key: 'name' | 'last_modified'; } + /** + * A file contents model thunk. + * + * Note: The content of the model will be empty. + * To get the contents, call and await the `withContent` + * method. + */ + export interface IContentsThunk { + /** + * The contents model. + */ + model: Contents.IModel; + + /** + * Fetches the model with contents. + */ + withContent: () => Promise; + } + /** * The render interface for file browser listing options. */ From b874b3a920fef98f5fcc9d629fa5d0f7f28e2566 Mon Sep 17 00:00:00 2001 From: Vidar Tonaas Fauske Date: Tue, 3 Sep 2019 15:34:31 +0100 Subject: [PATCH 15/15] integrity --- packages/cells/package.json | 1 + packages/cells/style/index.css | 1 + packages/cells/tsconfig.json | 3 +++ packages/notebook/style/index.css | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/cells/package.json b/packages/cells/package.json index f506d940e744..7d4bb6bea2ae 100644 --- a/packages/cells/package.json +++ b/packages/cells/package.json @@ -40,6 +40,7 @@ "@jupyterlab/codeeditor": "^1.2.0-alpha.0", "@jupyterlab/codemirror": "^1.2.0-alpha.0", "@jupyterlab/coreutils": "^3.2.0-alpha.0", + "@jupyterlab/filebrowser": "^1.2.0-alpha.0", "@jupyterlab/observables": "^2.4.0-alpha.0", "@jupyterlab/outputarea": "^1.2.0-alpha.0", "@jupyterlab/rendermime": "^1.2.0-alpha.0", diff --git a/packages/cells/style/index.css b/packages/cells/style/index.css index dfc4cf7b00d8..3d5756601445 100644 --- a/packages/cells/style/index.css +++ b/packages/cells/style/index.css @@ -11,6 +11,7 @@ @import url('~@jupyterlab/codemirror/style/index.css'); @import url('~@jupyterlab/rendermime/style/index.css'); @import url('~@jupyterlab/attachments/style/index.css'); +@import url('~@jupyterlab/filebrowser/style/index.css'); @import url('~@jupyterlab/outputarea/style/index.css'); @import url('./base.css'); diff --git a/packages/cells/tsconfig.json b/packages/cells/tsconfig.json index 7243747dc010..27177c5eac5e 100644 --- a/packages/cells/tsconfig.json +++ b/packages/cells/tsconfig.json @@ -21,6 +21,9 @@ { "path": "../coreutils" }, + { + "path": "../filebrowser" + }, { "path": "../observables" }, diff --git a/packages/notebook/style/index.css b/packages/notebook/style/index.css index 7b77c736221c..15b230ad567a 100644 --- a/packages/notebook/style/index.css +++ b/packages/notebook/style/index.css @@ -11,7 +11,7 @@ @import url('~@jupyterlab/codeeditor/style/index.css'); @import url('~@jupyterlab/statusbar/style/index.css'); @import url('~@jupyterlab/rendermime/style/index.css'); -@import url('~@jupyterlab/cells/style/index.css'); @import url('~@jupyterlab/docregistry/style/index.css'); +@import url('~@jupyterlab/cells/style/index.css'); @import url('./base.css');