@jupyterlab/outputarea 0.18.2 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +34 -0
- package/package.json +17 -11
- package/style/index.css +3 -3
- package/lib/index.js.map +0 -1
- package/lib/model.js.map +0 -1
- package/lib/widget.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Copyright (c) 2015 Project Jupyter Contributors
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
15
|
+
contributors may be used to endorse or promote products derived from
|
|
16
|
+
this software without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
22
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
23
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
24
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
25
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
26
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
|
|
29
|
+
Semver File License
|
|
30
|
+
===================
|
|
31
|
+
|
|
32
|
+
The semver.py file is from https://github.com/podhmo/python-semver
|
|
33
|
+
which is licensed under the "MIT" license. See the semver.py file for details.
|
|
34
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/outputarea",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "JupyterLab - Notebook Output Area",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyterlab",
|
|
6
6
|
"bugs": {
|
|
@@ -24,18 +24,19 @@
|
|
|
24
24
|
"url": "https://github.com/jupyterlab/jupyterlab.git"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "tsc",
|
|
27
|
+
"build": "tsc -b",
|
|
28
28
|
"clean": "rimraf lib",
|
|
29
|
+
"docs": "typedoc --options tdoptions.json --theme ../../typedoc-theme src",
|
|
29
30
|
"prepublishOnly": "npm run build",
|
|
30
|
-
"watch": "tsc -
|
|
31
|
+
"watch": "tsc -b --watch"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@jupyterlab/apputils": "^0.
|
|
34
|
-
"@jupyterlab/coreutils": "^2.1
|
|
35
|
-
"@jupyterlab/observables": "^2.
|
|
36
|
-
"@jupyterlab/rendermime": "^0.
|
|
37
|
-
"@jupyterlab/rendermime-interfaces": "^1.1
|
|
38
|
-
"@jupyterlab/services": "^3.1
|
|
34
|
+
"@jupyterlab/apputils": "^0.19.1",
|
|
35
|
+
"@jupyterlab/coreutils": "^2.2.1",
|
|
36
|
+
"@jupyterlab/observables": "^2.1.1",
|
|
37
|
+
"@jupyterlab/rendermime": "^0.19.1",
|
|
38
|
+
"@jupyterlab/rendermime-interfaces": "^1.2.1",
|
|
39
|
+
"@jupyterlab/services": "^3.2.1",
|
|
39
40
|
"@phosphor/algorithm": "^1.1.2",
|
|
40
41
|
"@phosphor/coreutils": "^1.3.0",
|
|
41
42
|
"@phosphor/disposable": "^1.1.2",
|
|
@@ -45,6 +46,11 @@
|
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"rimraf": "~2.6.2",
|
|
48
|
-
"
|
|
49
|
-
|
|
49
|
+
"typedoc": "~0.12.0",
|
|
50
|
+
"typescript": "~3.1.1"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"gitHead": "7fc900168981e58051253ecc66a18015a052cd2f"
|
|
50
56
|
}
|
package/style/index.css
CHANGED
|
@@ -170,10 +170,10 @@ body.p-mod-override-cursor .jp-OutputArea-output.jp-mod-isolated:before {
|
|
|
170
170
|
|----------------------------------------------------------------------------*/
|
|
171
171
|
|
|
172
172
|
.jp-LinkedOutputView .jp-OutputArea {
|
|
173
|
-
height:
|
|
173
|
+
height: 100%;
|
|
174
174
|
display: block;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
.jp-LinkedOutputView .jp-OutputArea-
|
|
178
|
-
height:
|
|
177
|
+
.jp-LinkedOutputView .jp-OutputArea-output:only-child {
|
|
178
|
+
height: 100%;
|
|
179
179
|
}
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../outputarea/src/index.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,2DAA2D;;;;;AAE3D,8BAA4B;AAE5B,6BAAwB;AACxB,8BAAyB","sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport '../style/index.css';\n\nexport * from './model';\nexport * from './widget';\n"]}
|
package/lib/model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../outputarea/src/model.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,2DAA2D;;AAE3D,mDAAyD;AAIzD,mDAAsD;AAEtD,qDAAiD;AAEjD,yDAMiC;AAEjC,uDAAmE;AAsHnE;;GAEG;AACH;IACE;;OAEG;IACH,YAAY,UAAqC,EAAE;QA8QzC,cAAS,GAAG,KAAK,CAAC;QAClB,SAAI,GAAkC,IAAI,CAAC;QAmD7C,aAAQ,GAAG,KAAK,CAAC;QACjB,gBAAW,GAAG,KAAK,CAAC;QACpB,kBAAa,GAAG,IAAI,kBAAM,CAAyB,IAAI,CAAC,CAAC;QACzD,aAAQ,GAAG,IAAI,kBAAM,CAAqC,IAAI,CAAC,CAAC;QAChE,aAAQ,GAAa,IAAI,CAAC;QAC1B,gBAAW,GAAqB,IAAI,CAAC;QACrC,iBAAY,GAAG,KAAK,CAAC;QAvU3B,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,cAAc;YACjB,OAAO,CAAC,cAAc,IAAI,eAAe,CAAC,qBAAqB,CAAC;QAClE,IAAI,CAAC,IAAI,GAAG,IAAI,4BAAc,EAAgB,CAAC;QAC/C,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,gBAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;gBAC3B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC,CAAC,CAAC;SACJ;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QAErD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n// Distributed under the terms of the Modified BSD License.\n\nimport { each, map, toArray } from '@phosphor/algorithm';\n\nimport { IDisposable } from '@phosphor/disposable';\n\nimport { ISignal, Signal } from '@phosphor/signaling';\n\nimport { nbformat } from '@jupyterlab/coreutils';\n\nimport {\n IObservableList,\n ObservableList,\n IObservableValue,\n ObservableValue,\n IModelDB\n} from '@jupyterlab/observables';\n\nimport { IOutputModel, OutputModel } from '@jupyterlab/rendermime';\n\n/**\n * The model for an output area.\n */\nexport interface IOutputAreaModel extends IDisposable {\n /**\n * A signal emitted when the model state changes.\n */\n readonly stateChanged: ISignal<IOutputAreaModel, void>;\n\n /**\n * A signal emitted when the model changes.\n */\n readonly changed: ISignal<IOutputAreaModel, IOutputAreaModel.ChangedArgs>;\n\n /**\n * The length of the items in the model.\n */\n readonly length: number;\n\n /**\n * Whether the output area is trusted.\n */\n trusted: boolean;\n\n /**\n * The output content factory used by the model.\n */\n readonly contentFactory: IOutputAreaModel.IContentFactory;\n\n /**\n * Get an item at the specified index.\n */\n get(index: number): IOutputModel;\n\n /**\n * Add an output, which may be combined with previous output.\n *\n * #### Notes\n * The output bundle is copied.\n * Contiguous stream outputs of the same `name` are combined.\n */\n add(output: nbformat.IOutput): number;\n\n /**\n * Set the value at the specified index.\n */\n set(index: number, output: nbformat.IOutput): void;\n\n /**\n * Clear all of the output.\n *\n * @param wait - Delay clearing the output until the next message is added.\n */\n clear(wait?: boolean): void;\n\n /**\n * Deserialize the model from JSON.\n *\n * #### Notes\n * This will clear any existing data.\n */\n fromJSON(values: nbformat.IOutput[]): void;\n\n /**\n * Serialize the model to JSON.\n */\n toJSON(): nbformat.IOutput[];\n}\n\n/**\n * The namespace for IOutputAreaModel interfaces.\n */\nexport namespace IOutputAreaModel {\n /**\n * The options used to create a output area model.\n */\n export interface IOptions {\n /**\n * The initial values for the model.\n */\n values?: nbformat.IOutput[];\n\n /**\n * Whether the output is trusted. The default is false.\n */\n trusted?: boolean;\n\n /**\n * The output content factory used by the model.\n *\n * If not given, a default factory will be used.\n */\n contentFactory?: IContentFactory;\n\n /**\n * An optional IModelDB to store the output area model.\n */\n modelDB?: IModelDB;\n }\n\n /**\n * A type alias for changed args.\n */\n export type ChangedArgs = IObservableList.IChangedArgs<IOutputModel>;\n\n /**\n * The interface for an output content factory.\n */\n export interface IContentFactory {\n /**\n * Create an output model.\n */\n createOutputModel(options: IOutputModel.IOptions): IOutputModel;\n }\n}\n\n/**\n * The default implementation of the IOutputAreaModel.\n */\nexport class OutputAreaModel implements IOutputAreaModel {\n /**\n * Construct a new observable outputs instance.\n */\n constructor(options: IOutputAreaModel.IOptions = {}) {\n this._trusted = !!options.trusted;\n this.contentFactory =\n options.contentFactory || OutputAreaModel.defaultContentFactory;\n this.list = new ObservableList<IOutputModel>();\n if (options.values) {\n each(options.values, value => {\n this._add(value);\n });\n }\n this.list.changed.connect(this._onListChanged, this);\n\n // If we are given a IModelDB, keep an up-to-date\n // serialized copy of the OutputAreaModel in it.\n if (options.modelDB) {\n this._modelDB = options.modelDB;\n this._serialized = this._modelDB.createValue('outputs');\n if (this._serialized.get()) {\n this.fromJSON(this._serialized.get() as nbformat.IOutput[]);\n } else {\n this._serialized.set(this.toJSON());\n }\n this._serialized.changed.connect(this._onSerializedChanged, this);\n }\n }\n\n /**\n * A signal emitted when the model state changes.\n */\n get stateChanged(): ISignal<IOutputAreaModel, void> {\n return this._stateChanged;\n }\n\n /**\n * A signal emitted when the model changes.\n */\n get changed(): ISignal<this, IOutputAreaModel.ChangedArgs> {\n return this._changed;\n }\n\n /**\n * Get the length of the items in the model.\n */\n get length(): number {\n return this.list ? this.list.length : 0;\n }\n\n /**\n * Get whether the model is trusted.\n */\n get trusted(): boolean {\n return this._trusted;\n }\n\n /**\n * Set whether the model is trusted.\n *\n * #### Notes\n * Changing the value will cause all of the models to re-set.\n */\n set trusted(value: boolean) {\n if (value === this._trusted) {\n return;\n }\n let trusted = (this._trusted = value);\n for (let i = 0; i < this.list.length; i++) {\n let item = this.list.get(i);\n let value = item.toJSON();\n item.dispose();\n item = this._createItem({ value, trusted });\n this.list.set(i, item);\n }\n }\n\n /**\n * The output content factory used by the model.\n */\n readonly contentFactory: IOutputAreaModel.IContentFactory;\n\n /**\n * Test whether the model is disposed.\n */\n get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n /**\n * Dispose of the resources used by the model.\n */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n this._isDisposed = true;\n this.list.dispose();\n Signal.clearData(this);\n }\n\n /**\n * Get an item at the specified index.\n */\n get(index: number): IOutputModel {\n return this.list.get(index);\n }\n\n /**\n * Set the value at the specified index.\n */\n set(index: number, value: nbformat.IOutput): void {\n // Normalize stream data.\n this._normalize(value);\n let item = this._createItem({ value, trusted: this._trusted });\n this.list.set(index, item);\n }\n\n /**\n * Add an output, which may be combined with previous output.\n *\n * #### Notes\n * The output bundle is copied.\n * Contiguous stream outputs of the same `name` are combined.\n */\n add(output: nbformat.IOutput): number {\n // If we received a delayed clear message, then clear now.\n if (this.clearNext) {\n this.clear();\n this.clearNext = false;\n }\n\n return this._add(output);\n }\n\n /**\n * Clear all of the output.\n *\n * @param wait Delay clearing the output until the next message is added.\n */\n clear(wait: boolean = false): void {\n this._lastStream = '';\n if (wait) {\n this.clearNext = true;\n return;\n }\n each(this.list, (item: IOutputModel) => {\n item.dispose();\n });\n this.list.clear();\n }\n\n /**\n * Deserialize the model from JSON.\n *\n * #### Notes\n * This will clear any existing data.\n */\n fromJSON(values: nbformat.IOutput[]) {\n this.clear();\n each(values, value => {\n this._add(value);\n });\n }\n\n /**\n * Serialize the model to JSON.\n */\n toJSON(): nbformat.IOutput[] {\n return toArray(map(this.list, (output: IOutputModel) => output.toJSON()));\n }\n\n /**\n * Add an item to the list.\n */\n private _add(value: nbformat.IOutput): number {\n let trusted = this._trusted;\n\n // Normalize the value.\n this._normalize(value);\n\n // Consolidate outputs if they are stream outputs of the same kind.\n if (\n nbformat.isStream(value) &&\n this._lastStream &&\n value.name === this._lastName\n ) {\n // In order to get a list change event, we add the previous\n // text to the current item and replace the previous item.\n // This also replaces the metadata of the last item.\n this._lastStream += value.text as string;\n value.text = this._lastStream;\n this._removeOverwrittenChars(value);\n let item = this._createItem({ value, trusted });\n let index = this.length - 1;\n let prev = this.list.get(index);\n prev.dispose();\n this.list.set(index, item);\n return index;\n }\n\n if (nbformat.isStream(value)) {\n this._removeOverwrittenChars(value);\n }\n\n // Create the new item.\n let item = this._createItem({ value, trusted });\n\n // Update the stream information.\n if (nbformat.isStream(value)) {\n this._lastStream = value.text as string;\n this._lastName = value.name;\n } else {\n this._lastStream = '';\n }\n\n // Add the item to our list and return the new length.\n return this.list.push(item);\n }\n\n /**\n * Normalize an output.\n */\n private _normalize(value: nbformat.IOutput): void {\n if (nbformat.isStream(value)) {\n if (Array.isArray(value.text)) {\n value.text = (value.text as string[]).join('\\n');\n }\n }\n }\n\n /**\n * Remove characters that are overridden by backspace characters.\n */\n private _fixBackspace(txt: string): string {\n let tmp = txt;\n do {\n txt = tmp;\n // Cancel out anything-but-newline followed by backspace\n tmp = txt.replace(/[^\\n]\\x08/gm, '');\n } while (tmp.length < txt.length);\n return txt;\n }\n\n /**\n * Remove chunks that should be overridden by the effect of\n * carriage return characters.\n */\n private _fixCarriageReturn(txt: string): string {\n let tmp = txt;\n // Handle multiple carriage returns before a newline\n tmp = tmp.replace(/\\r\\r+\\n/gm, '\\r\\n');\n // Remove chunks that should be overridden by carriage returns\n do {\n // Remove any chunks preceding a carriage return unless carriage\n // return followed by a newline\n tmp = tmp.replace(/^[^\\n]*(?:\\r(?!\\n))+/gm, '');\n } while (tmp.search(/\\r(?!\\n)/) > -1);\n do {\n // Replace remaining \\r\\n characters with a newline\n tmp = tmp.replace(/\\r\\n/gm, '\\n');\n } while (tmp.indexOf('\\r\\n') > -1);\n return tmp;\n }\n\n /*\n * Remove characters overridden by backspaces and carriage returns\n */\n private _removeOverwrittenChars(value: nbformat.IOutput): void {\n let tmp = value.text as string;\n value.text = this._fixCarriageReturn(this._fixBackspace(tmp));\n }\n\n protected clearNext = false;\n protected list: IObservableList<IOutputModel> = null;\n\n /**\n * Create an output item and hook up its signals.\n */\n private _createItem(options: IOutputModel.IOptions): IOutputModel {\n let factory = this.contentFactory;\n let item = factory.createOutputModel(options);\n item.changed.connect(this._onGenericChange, this);\n return item;\n }\n\n /**\n * Handle a change to the list.\n */\n private _onListChanged(\n sender: IObservableList<IOutputModel>,\n args: IObservableList.IChangedArgs<IOutputModel>\n ) {\n if (this._serialized && !this._changeGuard) {\n this._changeGuard = true;\n this._serialized.set(this.toJSON());\n this._changeGuard = false;\n }\n this._changed.emit(args);\n }\n\n /**\n * If the serialized version of the outputs have changed due to a remote\n * action, then update the model accordingly.\n */\n private _onSerializedChanged(\n sender: IObservableValue,\n args: ObservableValue.IChangedArgs\n ) {\n if (!this._changeGuard) {\n this._changeGuard = true;\n this.fromJSON(args.newValue as nbformat.IOutput[]);\n this._changeGuard = false;\n }\n }\n\n /**\n * Handle a change to an item.\n */\n private _onGenericChange(): void {\n this._stateChanged.emit(void 0);\n }\n\n private _lastStream: string;\n private _lastName: 'stdout' | 'stderr';\n private _trusted = false;\n private _isDisposed = false;\n private _stateChanged = new Signal<IOutputAreaModel, void>(this);\n private _changed = new Signal<this, IOutputAreaModel.ChangedArgs>(this);\n private _modelDB: IModelDB = null;\n private _serialized: IObservableValue = null;\n private _changeGuard = false;\n}\n\n/**\n * The namespace for OutputAreaModel class statics.\n */\nexport namespace OutputAreaModel {\n /**\n * The default implementation of a `IModelOutputFactory`.\n */\n export class ContentFactory implements IOutputAreaModel.IContentFactory {\n /**\n * Create an output model.\n */\n createOutputModel(options: IOutputModel.IOptions): IOutputModel {\n return new OutputModel(options);\n }\n }\n\n /**\n * The default output model factory.\n */\n export const defaultContentFactory = new ContentFactory();\n}\n"]}
|
package/lib/widget.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../../outputarea/src/widget.ts"],"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AC,EApFS,OAAO,KAAP,OAAO,QAoFhB","sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport {\n JSONObject,\n PromiseDelegate,\n ReadonlyJSONObject\n} from '@phosphor/coreutils';\n\nimport { Message } from '@phosphor/messaging';\n\nimport { Signal } from '@phosphor/signaling';\n\nimport { Panel, PanelLayout } from '@phosphor/widgets';\n\nimport { Widget } from '@phosphor/widgets';\n\nimport { IClientSession } from '@jupyterlab/apputils';\n\nimport { nbformat } from '@jupyterlab/coreutils';\n\nimport { IOutputModel, RenderMimeRegistry } from '@jupyterlab/rendermime';\n\nimport { IRenderMime } from '@jupyterlab/rendermime-interfaces';\n\nimport { Kernel, KernelMessage } from '@jupyterlab/services';\n\nimport { IOutputAreaModel } from './model';\n\n/**\n * The class name added to an output area widget.\n */\nconst OUTPUT_AREA_CLASS = 'jp-OutputArea';\n\n/**\n * The class name added to the direction children of OutputArea\n */\nconst OUTPUT_AREA_ITEM_CLASS = 'jp-OutputArea-child';\n\n/**\n * The class name added to actual outputs\n */\nconst OUTPUT_AREA_OUTPUT_CLASS = 'jp-OutputArea-output';\n\n/**\n * The class name added to prompt children of OutputArea.\n */\nconst OUTPUT_AREA_PROMPT_CLASS = 'jp-OutputArea-prompt';\n\n/**\n * The class name added to OutputPrompt.\n */\nconst OUTPUT_PROMPT_CLASS = 'jp-OutputPrompt';\n\n/**\n * The class name added to an execution result.\n */\nconst EXECUTE_CLASS = 'jp-OutputArea-executeResult';\n\n/**\n * The class name added stdin items of OutputArea\n */\nconst OUTPUT_AREA_STDIN_ITEM_CLASS = 'jp-OutputArea-stdin-item';\n\n/**\n * The class name added to stdin widgets.\n */\nconst STDIN_CLASS = 'jp-Stdin';\n\n/**\n * The class name added to stdin data prompt nodes.\n */\nconst STDIN_PROMPT_CLASS = 'jp-Stdin-prompt';\n\n/**\n * The class name added to stdin data input nodes.\n */\nconst STDIN_INPUT_CLASS = 'jp-Stdin-input';\n\n/******************************************************************************\n * OutputArea\n ******************************************************************************/\n\n/**\n * An output area widget.\n *\n * #### Notes\n * The widget model must be set separately and can be changed\n * at any time. Consumers of the widget must account for a\n * `null` model, and may want to listen to the `modelChanged`\n * signal.\n */\nexport class OutputArea extends Widget {\n /**\n * Construct an output area widget.\n */\n constructor(options: OutputArea.IOptions) {\n super();\n let model = (this.model = options.model);\n this.addClass(OUTPUT_AREA_CLASS);\n this.rendermime = options.rendermime;\n this.contentFactory =\n options.contentFactory || OutputArea.defaultContentFactory;\n this.layout = new PanelLayout();\n for (let i = 0; i < model.length; i++) {\n let output = model.get(i);\n this._insertOutput(i, output);\n }\n model.changed.connect(this.onModelChanged, this);\n model.stateChanged.connect(this.onStateChanged, this);\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: IOutputAreaModel;\n\n /**\n * The content factory used by the widget.\n */\n readonly contentFactory: OutputArea.IContentFactory;\n\n /**\n * The rendermime instance used by the widget.\n */\n readonly rendermime: RenderMimeRegistry;\n\n /**\n * A read-only sequence of the chidren widgets in the output area.\n */\n get widgets(): ReadonlyArray<Widget> {\n return (this.layout as PanelLayout).widgets;\n }\n\n /**\n * A public signal used to indicate the number of outputs has changed.\n *\n * #### Notes\n * This is useful for parents who want to apply styling based on the number\n * of outputs. Emits the current number of outputs.\n */\n readonly outputLengthChanged = new Signal<this, number>(this);\n\n /**\n * The kernel future associated with the output area.\n */\n get future(): Kernel.IFuture {\n return this._future;\n }\n\n set future(value: Kernel.IFuture) {\n // Bail if the model is disposed.\n if (this.model.isDisposed) {\n throw Error('Model is disposed');\n }\n if (this._future === value) {\n return;\n }\n if (this._future) {\n this._future.dispose();\n }\n this._future = value;\n\n this.model.clear();\n\n // Make sure there were no input widgets.\n if (this.widgets.length) {\n this._clear();\n this.outputLengthChanged.emit(this.model.length);\n }\n\n // Handle published messages.\n value.onIOPub = this._onIOPub;\n\n // Handle the execute reply.\n value.onReply = this._onExecuteReply;\n\n // Handle stdin.\n value.onStdin = msg => {\n if (KernelMessage.isInputRequestMsg(msg)) {\n this.onInputRequest(msg, value);\n }\n };\n }\n\n /**\n * Dispose of the resources used by the output area.\n */\n dispose(): void {\n if (this._future) {\n this._future.dispose();\n }\n this._future = null;\n this._displayIdMap.clear();\n super.dispose();\n }\n\n /**\n * Follow changes on the model state.\n */\n protected onModelChanged(\n sender: IOutputAreaModel,\n args: IOutputAreaModel.ChangedArgs\n ): void {\n switch (args.type) {\n case 'add':\n this._insertOutput(args.newIndex, args.newValues[0]);\n this.outputLengthChanged.emit(this.model.length);\n break;\n case 'remove':\n // Only clear is supported by the model.\n if (this.widgets.length) {\n this._clear();\n this.outputLengthChanged.emit(this.model.length);\n }\n break;\n case 'set':\n this._setOutput(args.newIndex, args.newValues[0]);\n this.outputLengthChanged.emit(this.model.length);\n break;\n default:\n break;\n }\n }\n\n /**\n * Follow changes on the output model state.\n */\n protected onStateChanged(sender: IOutputAreaModel): void {\n for (let i = 0; i < this.model.length; i++) {\n this._setOutput(i, this.model.get(i));\n }\n this.outputLengthChanged.emit(this.model.length);\n }\n\n /**\n * Clear the widget inputs and outputs.\n */\n private _clear(): void {\n // Bail if there is no work to do.\n if (!this.widgets.length) {\n return;\n }\n\n // Remove all of our widgets.\n let length = this.widgets.length;\n for (let i = 0; i < length; i++) {\n let widget = this.widgets[0];\n widget.parent = null;\n widget.dispose();\n }\n\n // Clear the display id map.\n this._displayIdMap.clear();\n\n // When an output area is cleared and then quickly replaced with new\n // content (as happens with @interact in widgets, for example), the\n // quickly changing height can make the page jitter.\n // We introduce a small delay in the minimum height\n // to prevent this jitter.\n let rect = this.node.getBoundingClientRect();\n this.node.style.minHeight = `${rect.height}px`;\n if (this._minHeightTimeout) {\n clearTimeout(this._minHeightTimeout);\n }\n this._minHeightTimeout = window.setTimeout(() => {\n if (this.isDisposed) {\n return;\n }\n this.node.style.minHeight = '';\n }, 50);\n }\n\n /**\n * Handle an input request from a kernel.\n */\n protected onInputRequest(\n msg: KernelMessage.IInputRequestMsg,\n future: Kernel.IFuture\n ): void {\n // Add an output widget to the end.\n let factory = this.contentFactory;\n let stdinPrompt = msg.content.prompt;\n let password = msg.content.password;\n\n let panel = new Panel();\n panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n panel.addClass(OUTPUT_AREA_STDIN_ITEM_CLASS);\n\n let prompt = factory.createOutputPrompt();\n prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);\n panel.addWidget(prompt);\n\n let input = factory.createStdin({ prompt: stdinPrompt, password, future });\n input.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n panel.addWidget(input);\n\n let layout = this.layout as PanelLayout;\n layout.addWidget(panel);\n\n /**\n * Wait for the stdin to complete, add it to the model (so it persists)\n * and remove the stdin widget.\n */\n input.value.then(value => {\n // Use stdin as the stream so it does not get combined with stdout.\n this.model.add({\n output_type: 'stream',\n name: 'stdin',\n text: value + '\\n'\n });\n panel.dispose();\n });\n }\n\n /**\n * Update an output in the layout in place.\n */\n private _setOutput(index: number, model: IOutputModel): void {\n let layout = this.layout as PanelLayout;\n let panel = layout.widgets[index] as Panel;\n let renderer = (panel.widgets\n ? panel.widgets[1]\n : panel) as IRenderMime.IRenderer;\n if (renderer.renderModel) {\n renderer.renderModel(model);\n } else {\n layout.widgets[index].dispose();\n this._insertOutput(index, model);\n }\n }\n\n /**\n * Render and insert a single output into the layout.\n */\n private _insertOutput(index: number, model: IOutputModel): void {\n let output = this.createOutputItem(model);\n output.toggleClass(EXECUTE_CLASS, model.executionCount !== null);\n let layout = this.layout as PanelLayout;\n layout.insertWidget(index, output);\n }\n\n /**\n * Create an output item with a prompt and actual output\n */\n protected createOutputItem(model: IOutputModel): Widget {\n let panel = new Panel();\n panel.addClass(OUTPUT_AREA_ITEM_CLASS);\n\n let prompt = this.contentFactory.createOutputPrompt();\n prompt.executionCount = model.executionCount;\n prompt.addClass(OUTPUT_AREA_PROMPT_CLASS);\n panel.addWidget(prompt);\n\n let output = this.createRenderedMimetype(model);\n output.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n panel.addWidget(output);\n\n return panel;\n }\n\n /**\n * Render a mimetype\n */\n protected createRenderedMimetype(model: IOutputModel): Widget {\n let widget: Widget;\n let mimeType = this.rendermime.preferredMimeType(\n model.data,\n model.trusted ? 'any' : 'ensure'\n );\n if (mimeType) {\n let metadata = model.metadata;\n let mimeMd = metadata[mimeType] as ReadonlyJSONObject;\n let isolated = false;\n // mime-specific higher priority\n if (mimeMd && mimeMd['isolated'] !== undefined) {\n isolated = mimeMd['isolated'] as boolean;\n } else {\n // fallback on global\n isolated = metadata['isolated'] as boolean;\n }\n\n let output = this.rendermime.createRenderer(mimeType);\n if (isolated === true) {\n output = new Private.IsolatedRenderer(output);\n }\n output.renderModel(model).catch(error => {\n // Manually append error message to output\n output.node.innerHTML = `<pre>Javascript Error: ${error.message}</pre>`;\n // Remove mime-type-specific CSS classes\n output.node.className = 'p-Widget jp-RenderedText';\n output.node.setAttribute(\n 'data-mime-type',\n 'application/vnd.jupyter.stderr'\n );\n });\n widget = output;\n } else {\n widget = new Widget();\n widget.node.innerHTML =\n `No ${model.trusted ? '' : '(safe) '}renderer could be ` +\n 'found for output. It has the following MIME types: ' +\n Object.keys(model.data).join(', ');\n }\n return widget;\n }\n\n /**\n * Handle an iopub message.\n */\n private _onIOPub = (msg: KernelMessage.IIOPubMessage) => {\n let model = this.model;\n let msgType = msg.header.msg_type;\n let output: nbformat.IOutput;\n let transient = (msg.content.transient || {}) as JSONObject;\n let displayId = transient['display_id'] as string;\n let targets: number[];\n\n switch (msgType) {\n case 'execute_result':\n case 'display_data':\n case 'stream':\n case 'error':\n output = msg.content as nbformat.IOutput;\n output.output_type = msgType as nbformat.OutputType;\n model.add(output);\n break;\n case 'clear_output':\n let wait = (msg as KernelMessage.IClearOutputMsg).content.wait;\n model.clear(wait);\n break;\n case 'update_display_data':\n output = msg.content as nbformat.IOutput;\n output.output_type = 'display_data';\n targets = this._displayIdMap.get(displayId);\n if (targets) {\n for (let index of targets) {\n model.set(index, output);\n }\n }\n break;\n default:\n break;\n }\n if (displayId && msgType === 'display_data') {\n targets = this._displayIdMap.get(displayId) || [];\n targets.push(model.length - 1);\n this._displayIdMap.set(displayId, targets);\n }\n };\n\n /**\n * Handle an execute reply message.\n */\n private _onExecuteReply = (msg: KernelMessage.IExecuteReplyMsg) => {\n // API responses that contain a pager are special cased and their type\n // is overridden from 'execute_reply' to 'display_data' in order to\n // render output.\n let model = this.model;\n let content = msg.content as KernelMessage.IExecuteOkReply;\n let payload = content && content.payload;\n if (!payload || !payload.length) {\n return;\n }\n let pages = payload.filter((i: any) => (i as any).source === 'page');\n if (!pages.length) {\n return;\n }\n let page = JSON.parse(JSON.stringify(pages[0]));\n let output: nbformat.IOutput = {\n output_type: 'display_data',\n data: (page as any).data as nbformat.IMimeBundle,\n metadata: {}\n };\n model.add(output);\n };\n\n private _minHeightTimeout: number = null;\n private _future: Kernel.IFuture = null;\n private _displayIdMap = new Map<string, number[]>();\n}\n\nexport class SimplifiedOutputArea extends OutputArea {\n /**\n * Handle an input request from a kernel by doing nothing.\n */\n protected onInputRequest(\n msg: KernelMessage.IInputRequestMsg,\n future: Kernel.IFuture\n ): void {\n return;\n }\n\n /**\n * Create an output item without a prompt, just the output widgets\n */\n protected createOutputItem(model: IOutputModel): Widget {\n let output = this.createRenderedMimetype(model);\n output.addClass(OUTPUT_AREA_OUTPUT_CLASS);\n return output;\n }\n}\n\n/**\n * A namespace for OutputArea statics.\n */\nexport namespace OutputArea {\n /**\n * The options to create an `OutputArea`.\n */\n export interface IOptions {\n /**\n * The model used by the widget.\n */\n model: IOutputAreaModel;\n\n /**\n * The content factory used by the widget to create children.\n */\n contentFactory?: IContentFactory;\n\n /**\n * The rendermime instance used by the widget.\n */\n rendermime: RenderMimeRegistry;\n }\n\n /**\n * Execute code on an output area.\n */\n export function execute(\n code: string,\n output: OutputArea,\n session: IClientSession,\n metadata?: JSONObject\n ): Promise<KernelMessage.IExecuteReplyMsg> {\n // Override the default for `stop_on_error`.\n let content: KernelMessage.IExecuteRequest = {\n code,\n stop_on_error: true\n };\n\n if (!session.kernel) {\n return Promise.reject('Session has no kernel.');\n }\n let future = session.kernel.requestExecute(content, false, metadata);\n output.future = future;\n return future.done as Promise<KernelMessage.IExecuteReplyMsg>;\n }\n\n /**\n * An output area widget content factory.\n *\n * The content factory is used to create children in a way\n * that can be customized.\n */\n export interface IContentFactory {\n /**\n * Create an output prompt.\n */\n createOutputPrompt(): IOutputPrompt;\n\n /**\n * Create an stdin widget.\n */\n createStdin(options: Stdin.IOptions): IStdin;\n }\n\n /**\n * The default implementation of `IContentFactory`.\n */\n export class ContentFactory implements IContentFactory {\n /**\n * Create the output prompt for the widget.\n */\n createOutputPrompt(): IOutputPrompt {\n return new OutputPrompt();\n }\n\n /**\n * Create an stdin widget.\n */\n createStdin(options: Stdin.IOptions): IStdin {\n return new Stdin(options);\n }\n }\n\n /**\n * The default `ContentFactory` instance.\n */\n export const defaultContentFactory = new ContentFactory();\n}\n\n/******************************************************************************\n * OutputPrompt\n ******************************************************************************/\n\n/**\n * The interface for an output prompt.\n */\nexport interface IOutputPrompt extends Widget {\n /**\n * The execution count for the prompt.\n */\n executionCount: nbformat.ExecutionCount;\n}\n\n/**\n * The default output prompt implementation\n */\nexport class OutputPrompt extends Widget implements IOutputPrompt {\n /*\n * Create an output prompt widget.\n */\n constructor() {\n super();\n this.addClass(OUTPUT_PROMPT_CLASS);\n }\n\n /**\n * The execution count for the prompt.\n */\n get executionCount(): nbformat.ExecutionCount {\n return this._executionCount;\n }\n set executionCount(value: nbformat.ExecutionCount) {\n this._executionCount = value;\n if (value === null) {\n this.node.textContent = '';\n } else {\n this.node.textContent = `[${value}]:`;\n }\n }\n\n private _executionCount: nbformat.ExecutionCount = null;\n}\n\n/******************************************************************************\n * Stdin\n ******************************************************************************/\n\n/**\n * The stdin interface\n */\nexport interface IStdin extends Widget {\n /**\n * The stdin value.\n */\n readonly value: Promise<string>;\n}\n\n/**\n * The default stdin widget.\n */\nexport class Stdin extends Widget implements IStdin {\n /**\n * Construct a new input widget.\n */\n constructor(options: Stdin.IOptions) {\n super({\n node: Private.createInputWidgetNode(options.prompt, options.password)\n });\n this.addClass(STDIN_CLASS);\n this._input = this.node.getElementsByTagName('input')[0];\n this._input.focus();\n this._future = options.future;\n this._value = options.prompt + ' ';\n }\n\n /**\n * The value of the widget.\n */\n get value() {\n return this._promise.promise.then(() => this._value);\n }\n\n /**\n * Handle the DOM events for the widget.\n *\n * @param event - The DOM event sent to the widget.\n *\n * #### Notes\n * This method implements the DOM `EventListener` interface and is\n * called in response to events on the dock panel's node. It should\n * not be called directly by user code.\n */\n handleEvent(event: Event): void {\n let input = this._input;\n if (event.type === 'keydown') {\n if ((event as KeyboardEvent).keyCode === 13) {\n // Enter\n this._future.sendInputReply({\n value: input.value\n });\n if (input.type === 'password') {\n this._value += Array(input.value.length + 1).join('·');\n } else {\n this._value += input.value;\n }\n this._promise.resolve(void 0);\n }\n }\n }\n\n /**\n * Handle `after-attach` messages sent to the widget.\n */\n protected onAfterAttach(msg: Message): void {\n this._input.addEventListener('keydown', this);\n this.update();\n }\n\n /**\n * Handle `update-request` messages sent to the widget.\n */\n protected onUpdateRequest(msg: Message): void {\n this._input.focus();\n }\n\n /**\n * Handle `before-detach` messages sent to the widget.\n */\n protected onBeforeDetach(msg: Message): void {\n this._input.removeEventListener('keydown', this);\n }\n\n private _future: Kernel.IFuture = null;\n private _input: HTMLInputElement = null;\n private _value: string;\n private _promise = new PromiseDelegate<void>();\n}\n\nexport namespace Stdin {\n /**\n * The options to create a stdin widget.\n */\n export interface IOptions {\n /**\n * The prompt text.\n */\n prompt: string;\n\n /**\n * Whether the input is a password.\n */\n password: boolean;\n\n /**\n * The kernel future associated with the request.\n */\n future: Kernel.IFuture;\n }\n}\n\n/******************************************************************************\n * Private namespace\n ******************************************************************************/\n\n/**\n * A namespace for private data.\n */\nnamespace Private {\n /**\n * Create the node for an InputWidget.\n */\n export function createInputWidgetNode(\n prompt: string,\n password: boolean\n ): HTMLElement {\n let node = document.createElement('div');\n let promptNode = document.createElement('pre');\n promptNode.className = STDIN_PROMPT_CLASS;\n promptNode.textContent = prompt;\n let input = document.createElement('input');\n input.className = STDIN_INPUT_CLASS;\n if (password) {\n input.type = 'password';\n }\n node.appendChild(promptNode);\n promptNode.appendChild(input);\n return node;\n }\n\n /**\n * A renderer for IFrame data.\n */\n export class IsolatedRenderer extends Widget\n implements IRenderMime.IRenderer {\n /**\n * Create an isolated renderer.\n */\n constructor(wrapped: IRenderMime.IRenderer) {\n super({ node: document.createElement('iframe') });\n this.addClass('jp-mod-isolated');\n\n this._wrapped = wrapped;\n\n // Once the iframe is loaded, the subarea is dynamically inserted\n let iframe = this.node as HTMLIFrameElement;\n\n iframe.frameBorder = '0';\n iframe.scrolling = 'auto';\n\n iframe.addEventListener('load', () => {\n // Workaround needed by Firefox, to properly render svg inside\n // iframes, see https://stackoverflow.com/questions/10177190/\n // svg-dynamically-added-to-iframe-does-not-render-correctly\n iframe.contentDocument.open();\n\n // Insert the subarea into the iframe\n // We must directly write the html. At this point, subarea doesn't\n // contain any user content.\n iframe.contentDocument.write(this._wrapped.node.innerHTML);\n\n iframe.contentDocument.close();\n\n let body = iframe.contentDocument.body;\n\n // Adjust the iframe height automatically\n iframe.style.height = body.scrollHeight + 'px';\n });\n }\n\n /**\n * Render a mime model.\n *\n * @param model - The mime model to render.\n *\n * @returns A promise which resolves when rendering is complete.\n *\n * #### Notes\n * This method may be called multiple times during the lifetime\n * of the widget to update it if and when new data is available.\n */\n renderModel(model: IRenderMime.IMimeModel): Promise<void> {\n return this._wrapped.renderModel(model).then(() => {\n let win = (this.node as HTMLIFrameElement).contentWindow;\n if (win) {\n win.location.reload();\n }\n });\n }\n\n private _wrapped: IRenderMime.IRenderer;\n }\n}\n"]}
|