@jupyterlab/cells 0.17.2 → 0.18.4
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/lib/inputarea.js +1 -1
- package/lib/inputarea.js.map +1 -1
- package/lib/widget.d.ts +2 -2
- package/lib/widget.js +4 -2
- package/lib/widget.js.map +1 -1
- package/package.json +10 -10
package/lib/inputarea.js
CHANGED
package/lib/inputarea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputarea.js","sourceRoot":"","sources":["../../../../cells/src/inputarea.ts"],"names":[],"mappings":";AAAA;;;+EAG+E;;AAE/E,+CAAgD;AAEhD,+CAA2C;AAE3C,uDAAuE;AAEvE,uDAAiE;AAIjE;;GAEG;AACH,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC;;GAEG;AACH,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAEtD;;gFAEgF;AAEhF;;GAEG;AACH,eAAuB,SAAQ,gBAAM;IACnC;;OAEG;IACH,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QA+FF,YAAO,GAAiB,IAAI,CAAC;QAC7B,YAAO,GAAsB,IAAI,CAAC;QAClC,cAAS,GAAW,IAAI,CAAC;QAhG/B,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAChC,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,cAAc,GAAG,CAAC,IAAI,CAAC,cAAc;YACvC,OAAO,CAAC,cAAc,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAE7D,SAAS;QACT,IAAI,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,iBAAiB,EAAE,CAA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,CAAC;QAlBrC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IACD,IAAI,cAAc,CAAC,KAAa;QAC9B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;SAC7B;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;SACjD;IACH,CAAC;CAGF;AAzBD,kCAyBC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\nimport { PanelLayout } from '@phosphor/widgets';\n\nimport { Widget } from '@phosphor/widgets';\n\nimport { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';\n\nimport { CodeMirrorEditorFactory } from '@jupyterlab/codemirror';\n\nimport { ICellModel } from './model';\n\n/**\n * The class name added to input area widgets.\n */\nconst INPUT_AREA_CLASS = 'jp-InputArea';\n\n/**\n * The class name added to the prompt area of cell.\n */\nconst INPUT_AREA_PROMPT_CLASS = 'jp-InputArea-prompt';\n\n/**\n * The class name added to OutputPrompt.\n */\nconst INPUT_PROMPT_CLASS = 'jp-InputPrompt';\n\n/**\n * The class name added to the editor area of the cell.\n */\nconst INPUT_AREA_EDITOR_CLASS = 'jp-InputArea-editor';\n\n/******************************************************************************\n * InputArea\n ******************************************************************************/\n\n/**\n * An input area widget, which hosts a prompt and an editor widget.\n */\nexport class InputArea extends Widget {\n /**\n * Construct an input area widget.\n */\n constructor(options: InputArea.IOptions) {\n super();\n this.addClass(INPUT_AREA_CLASS);\n let model = (this.model = options.model);\n let contentFactory = (this.contentFactory =\n options.contentFactory || InputArea.defaultContentFactory);\n\n // Prompt\n let prompt = (this._prompt = contentFactory.createInputPrompt());\n prompt.addClass(INPUT_AREA_PROMPT_CLASS);\n\n // Editor\n let editorOptions = { model, factory: contentFactory.editorFactory };\n let editor = (this._editor = new CodeEditorWrapper(editorOptions));\n editor.addClass(INPUT_AREA_EDITOR_CLASS);\n\n let layout = (this.layout = new PanelLayout());\n layout.addWidget(prompt);\n layout.addWidget(editor);\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: ICellModel;\n\n /**\n * The content factory used by the widget.\n */\n readonly contentFactory: InputArea.IContentFactory;\n\n /**\n * Get the CodeEditorWrapper used by the cell.\n */\n get editorWidget(): CodeEditorWrapper {\n return this._editor;\n }\n\n /**\n * Get the CodeEditor used by the cell.\n */\n get editor(): CodeEditor.IEditor {\n return this._editor.editor;\n }\n\n /**\n * Get the prompt node used by the cell.\n */\n get promptNode(): HTMLElement {\n return this._prompt.node;\n }\n\n /**\n * Render an input instead of the text editor.\n */\n renderInput(widget: Widget): void {\n let layout = this.layout as PanelLayout;\n if (this._rendered) {\n this._rendered.parent = null;\n }\n this._editor.hide();\n this._rendered = widget;\n layout.addWidget(widget);\n }\n\n /**\n * Show the text editor.\n */\n showEditor(): void {\n if (this._rendered) {\n this._rendered.parent = null;\n }\n this._editor.show();\n }\n\n /**\n * Set the prompt of the input area.\n */\n setPrompt(value: string): void {\n this._prompt.executionCount = value;\n }\n\n /**\n * Dispose of the resources held by the widget.\n */\n dispose() {\n // Do nothing if already disposed.\n if (this.isDisposed) {\n return;\n }\n this._prompt = null;\n this._editor = null;\n this._rendered = null;\n super.dispose();\n }\n\n private _prompt: IInputPrompt = null;\n private _editor: CodeEditorWrapper = null;\n private _rendered: Widget = null;\n}\n\n/**\n * A namespace for `InputArea` statics.\n */\nexport namespace InputArea {\n /**\n * The options used to create an `InputArea`.\n */\n export interface IOptions {\n /**\n * The model used by the widget.\n */\n model: ICellModel;\n\n /**\n * The content factory used by the widget to create children.\n *\n * Defaults to one that uses CodeMirror.\n */\n contentFactory?: IContentFactory;\n }\n\n /**\n * An input 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 * The editor factory we need to include in `CodeEditorWratter.IOptions`.\n *\n * This is a separate readonly attribute rather than a factory method as we need\n * to pass it around.\n */\n readonly editorFactory: CodeEditor.Factory;\n\n /**\n * Create an input prompt.\n */\n createInputPrompt(): IInputPrompt;\n }\n\n /**\n * Default implementation of `IContentFactory`.\n *\n * This defaults to using an `editorFactory` based on CodeMirror.\n */\n export class ContentFactory implements IContentFactory {\n /**\n * Construct a `ContentFactory`.\n */\n constructor(options: ContentFactory.IOptions = {}) {\n this._editor = options.editorFactory || defaultEditorFactory;\n }\n\n /**\n * Return the `CodeEditor.Factory` being used.\n */\n get editorFactory(): CodeEditor.Factory {\n return this._editor;\n }\n\n /**\n * Create an input prompt.\n */\n createInputPrompt(): IInputPrompt {\n return new InputPrompt();\n }\n\n private _editor: CodeEditor.Factory = null;\n }\n\n /**\n * A namespace for the input area content factory.\n */\n export namespace ContentFactory {\n /**\n * Options for the content factory.\n */\n export interface IOptions {\n /**\n * The editor factory used by the content factory.\n *\n * If this is not passed, a default CodeMirror editor factory\n * will be used.\n */\n editorFactory?: CodeEditor.Factory;\n }\n }\n\n /**\n * A function to create the default CodeMirror editor factory.\n */\n function _createDefaultEditorFactory(): CodeEditor.Factory {\n let editorServices = new CodeMirrorEditorFactory();\n return editorServices.newInlineEditor;\n }\n\n /**\n * The default editor factory singleton based on CodeMirror.\n */\n export const defaultEditorFactory: CodeEditor.Factory = _createDefaultEditorFactory();\n\n /**\n * The default `ContentFactory` instance.\n */\n export const defaultContentFactory = new ContentFactory({});\n}\n\n/******************************************************************************\n * InputPrompt\n ******************************************************************************/\n\n/**\n * The interface for the input prompt.\n */\nexport interface IInputPrompt extends Widget {\n /**\n * The execution count of the prompt.\n */\n executionCount: string;\n}\n\n/**\n * The default input prompt implementation.\n */\nexport class InputPrompt extends Widget implements IInputPrompt {\n /*\n * Create an output prompt widget.\n */\n constructor() {\n super();\n this.addClass(INPUT_PROMPT_CLASS);\n }\n\n /**\n * The execution count for the prompt.\n */\n get executionCount(): string {\n return this._executionCount;\n }\n set executionCount(value: string) {\n this._executionCount = value;\n if (value === null) {\n this.node.textContent = ' ';\n } else {\n this.node.textContent = `In [${value || ' '}]:`;\n }\n }\n\n private _executionCount: string = null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"inputarea.js","sourceRoot":"","sources":["../../../../cells/src/inputarea.ts"],"names":[],"mappings":";AAAA;;;+EAG+E;;AAE/E,+CAAgD;AAEhD,+CAA2C;AAE3C,uDAAuE;AAEvE,uDAAiE;AAIjE;;GAEG;AACH,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC;;GAEG;AACH,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAEtD;;gFAEgF;AAEhF;;GAEG;AACH,eAAuB,SAAQ,gBAAM;IACnC;;OAEG;IACH,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QA+FF,YAAO,GAAiB,IAAI,CAAC;QAC7B,YAAO,GAAsB,IAAI,CAAC;QAClC,cAAS,GAAW,IAAI,CAAC;QAhG/B,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAChC,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,cAAc,GAAG,CAAC,IAAI,CAAC,cAAc;YACvC,OAAO,CAAC,cAAc,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAE7D,SAAS;QACT,IAAI,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACjE,MAAM,CAAC,QAAQ,CAAC,uBAAuB,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,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IACD,IAAI,cAAc,CAAC,KAAa;QAC9B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;SAC7B;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,CAAC;SAC9C;IACH,CAAC;CAGF;AAzBD,kCAyBC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\nimport { PanelLayout } from '@phosphor/widgets';\n\nimport { Widget } from '@phosphor/widgets';\n\nimport { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';\n\nimport { CodeMirrorEditorFactory } from '@jupyterlab/codemirror';\n\nimport { ICellModel } from './model';\n\n/**\n * The class name added to input area widgets.\n */\nconst INPUT_AREA_CLASS = 'jp-InputArea';\n\n/**\n * The class name added to the prompt area of cell.\n */\nconst INPUT_AREA_PROMPT_CLASS = 'jp-InputArea-prompt';\n\n/**\n * The class name added to OutputPrompt.\n */\nconst INPUT_PROMPT_CLASS = 'jp-InputPrompt';\n\n/**\n * The class name added to the editor area of the cell.\n */\nconst INPUT_AREA_EDITOR_CLASS = 'jp-InputArea-editor';\n\n/******************************************************************************\n * InputArea\n ******************************************************************************/\n\n/**\n * An input area widget, which hosts a prompt and an editor widget.\n */\nexport class InputArea extends Widget {\n /**\n * Construct an input area widget.\n */\n constructor(options: InputArea.IOptions) {\n super();\n this.addClass(INPUT_AREA_CLASS);\n let model = (this.model = options.model);\n let contentFactory = (this.contentFactory =\n options.contentFactory || InputArea.defaultContentFactory);\n\n // Prompt\n let prompt = (this._prompt = contentFactory.createInputPrompt());\n prompt.addClass(INPUT_AREA_PROMPT_CLASS);\n\n // Editor\n let editorOptions = { model, factory: contentFactory.editorFactory };\n let editor = (this._editor = new CodeEditorWrapper(editorOptions));\n editor.addClass(INPUT_AREA_EDITOR_CLASS);\n\n let layout = (this.layout = new PanelLayout());\n layout.addWidget(prompt);\n layout.addWidget(editor);\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: ICellModel;\n\n /**\n * The content factory used by the widget.\n */\n readonly contentFactory: InputArea.IContentFactory;\n\n /**\n * Get the CodeEditorWrapper used by the cell.\n */\n get editorWidget(): CodeEditorWrapper {\n return this._editor;\n }\n\n /**\n * Get the CodeEditor used by the cell.\n */\n get editor(): CodeEditor.IEditor {\n return this._editor.editor;\n }\n\n /**\n * Get the prompt node used by the cell.\n */\n get promptNode(): HTMLElement {\n return this._prompt.node;\n }\n\n /**\n * Render an input instead of the text editor.\n */\n renderInput(widget: Widget): void {\n let layout = this.layout as PanelLayout;\n if (this._rendered) {\n this._rendered.parent = null;\n }\n this._editor.hide();\n this._rendered = widget;\n layout.addWidget(widget);\n }\n\n /**\n * Show the text editor.\n */\n showEditor(): void {\n if (this._rendered) {\n this._rendered.parent = null;\n }\n this._editor.show();\n }\n\n /**\n * Set the prompt of the input area.\n */\n setPrompt(value: string): void {\n this._prompt.executionCount = value;\n }\n\n /**\n * Dispose of the resources held by the widget.\n */\n dispose() {\n // Do nothing if already disposed.\n if (this.isDisposed) {\n return;\n }\n this._prompt = null;\n this._editor = null;\n this._rendered = null;\n super.dispose();\n }\n\n private _prompt: IInputPrompt = null;\n private _editor: CodeEditorWrapper = null;\n private _rendered: Widget = null;\n}\n\n/**\n * A namespace for `InputArea` statics.\n */\nexport namespace InputArea {\n /**\n * The options used to create an `InputArea`.\n */\n export interface IOptions {\n /**\n * The model used by the widget.\n */\n model: ICellModel;\n\n /**\n * The content factory used by the widget to create children.\n *\n * Defaults to one that uses CodeMirror.\n */\n contentFactory?: IContentFactory;\n }\n\n /**\n * An input 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 * The editor factory we need to include in `CodeEditorWratter.IOptions`.\n *\n * This is a separate readonly attribute rather than a factory method as we need\n * to pass it around.\n */\n readonly editorFactory: CodeEditor.Factory;\n\n /**\n * Create an input prompt.\n */\n createInputPrompt(): IInputPrompt;\n }\n\n /**\n * Default implementation of `IContentFactory`.\n *\n * This defaults to using an `editorFactory` based on CodeMirror.\n */\n export class ContentFactory implements IContentFactory {\n /**\n * Construct a `ContentFactory`.\n */\n constructor(options: ContentFactory.IOptions = {}) {\n this._editor = options.editorFactory || defaultEditorFactory;\n }\n\n /**\n * Return the `CodeEditor.Factory` being used.\n */\n get editorFactory(): CodeEditor.Factory {\n return this._editor;\n }\n\n /**\n * Create an input prompt.\n */\n createInputPrompt(): IInputPrompt {\n return new InputPrompt();\n }\n\n private _editor: CodeEditor.Factory = null;\n }\n\n /**\n * A namespace for the input area content factory.\n */\n export namespace ContentFactory {\n /**\n * Options for the content factory.\n */\n export interface IOptions {\n /**\n * The editor factory used by the content factory.\n *\n * If this is not passed, a default CodeMirror editor factory\n * will be used.\n */\n editorFactory?: CodeEditor.Factory;\n }\n }\n\n /**\n * A function to create the default CodeMirror editor factory.\n */\n function _createDefaultEditorFactory(): CodeEditor.Factory {\n let editorServices = new CodeMirrorEditorFactory();\n return editorServices.newInlineEditor;\n }\n\n /**\n * The default editor factory singleton based on CodeMirror.\n */\n export const defaultEditorFactory: CodeEditor.Factory = _createDefaultEditorFactory();\n\n /**\n * The default `ContentFactory` instance.\n */\n export const defaultContentFactory = new ContentFactory({});\n}\n\n/******************************************************************************\n * InputPrompt\n ******************************************************************************/\n\n/**\n * The interface for the input prompt.\n */\nexport interface IInputPrompt extends Widget {\n /**\n * The execution count of the prompt.\n */\n executionCount: string;\n}\n\n/**\n * The default input prompt implementation.\n */\nexport class InputPrompt extends Widget implements IInputPrompt {\n /*\n * Create an output prompt widget.\n */\n constructor() {\n super();\n this.addClass(INPUT_PROMPT_CLASS);\n }\n\n /**\n * The execution count for the prompt.\n */\n get executionCount(): string {\n return this._executionCount;\n }\n set executionCount(value: string) {\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: string = null;\n}\n"]}
|
package/lib/widget.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IObservableMap } from '@jupyterlab/observables';
|
|
|
5
5
|
import { OutputArea, IOutputPrompt, IStdin, Stdin } from '@jupyterlab/outputarea';
|
|
6
6
|
import { RenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
7
7
|
import { KernelMessage } from '@jupyterlab/services';
|
|
8
|
-
import { JSONValue } from '@phosphor/coreutils';
|
|
8
|
+
import { JSONValue, JSONObject } from '@phosphor/coreutils';
|
|
9
9
|
import { Message } from '@phosphor/messaging';
|
|
10
10
|
import { Widget } from '@phosphor/widgets';
|
|
11
11
|
import { ICellHeader, ICellFooter } from './headerfooter';
|
|
@@ -303,7 +303,7 @@ export declare namespace CodeCell {
|
|
|
303
303
|
/**
|
|
304
304
|
* Execute a cell given a client session.
|
|
305
305
|
*/
|
|
306
|
-
function execute(cell: CodeCell, session: IClientSession): Promise<KernelMessage.IExecuteReplyMsg>;
|
|
306
|
+
function execute(cell: CodeCell, session: IClientSession, metadata?: JSONObject): Promise<KernelMessage.IExecuteReplyMsg>;
|
|
307
307
|
}
|
|
308
308
|
/******************************************************************************
|
|
309
309
|
* MarkdownCell
|
package/lib/widget.js
CHANGED
|
@@ -576,7 +576,7 @@ exports.CodeCell = CodeCell;
|
|
|
576
576
|
/**
|
|
577
577
|
* Execute a cell given a client session.
|
|
578
578
|
*/
|
|
579
|
-
function execute(cell, session) {
|
|
579
|
+
function execute(cell, session, metadata) {
|
|
580
580
|
let model = cell.model;
|
|
581
581
|
let code = model.value.text;
|
|
582
582
|
if (!code.trim() || !session.kernel) {
|
|
@@ -584,11 +584,13 @@ exports.CodeCell = CodeCell;
|
|
|
584
584
|
model.outputs.clear();
|
|
585
585
|
return Promise.resolve(void 0);
|
|
586
586
|
}
|
|
587
|
+
let cellId = { cellId: model.id };
|
|
588
|
+
metadata = Object.assign({}, metadata, cellId);
|
|
587
589
|
model.executionCount = null;
|
|
588
590
|
cell.outputHidden = false;
|
|
589
591
|
cell.setPrompt('*');
|
|
590
592
|
model.trusted = true;
|
|
591
|
-
return outputarea_1.OutputArea.execute(code, cell.outputArea, session)
|
|
593
|
+
return outputarea_1.OutputArea.execute(code, cell.outputArea, session, metadata)
|
|
592
594
|
.then(msg => {
|
|
593
595
|
model.executionCount = msg.content.execution_count;
|
|
594
596
|
return msg;
|
package/lib/widget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../../cells/src/widget.ts"],"names":[],"mappings":";AAAA;;;+EAG+E;;AAE/E,yDAA8D;AAI9D,qDAAsE;AAMtE,uDAOgC;AAEhC,uDAIgC;AAIhC,mDAAiE;AAIjE,+CAA+D;AAE/D,2CAA8D;AAE9D,iDAKwB;AAExB,2CAAmE;AASnE,+CAAoE;AAEpE;;GAEG;AACH,MAAM,UAAU,GAAG,SAAS,CAAC;AAE7B;;GAEG;AACH,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAExD;;GAEG;AACH,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAE1D;;GAEG;AACH,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAElD;;GAEG;AACH,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAEpD;;GAEG;AACH,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAE5D;;GAEG;AACH,MAAM,2BAA2B,GAAG,yBAAyB,CAAC;AAE9D;;GAEG;AACH,MAAM,eAAe,GAAG,kB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,CAAC;CAMF;AAzBD,0BAyBC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\nimport { AttachmentsResolver } from '@jupyterlab/attachments';\n\nimport { IClientSession } from '@jupyterlab/apputils';\n\nimport { IChangedArgs, ActivityMonitor } from '@jupyterlab/coreutils';\n\nimport { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';\n\nimport { IObservableMap } from '@jupyterlab/observables';\n\nimport {\n OutputArea,\n SimplifiedOutputArea,\n IOutputPrompt,\n OutputPrompt,\n IStdin,\n Stdin\n} from '@jupyterlab/outputarea';\n\nimport {\n IRenderMime,\n MimeModel,\n RenderMimeRegistry\n} from '@jupyterlab/rendermime';\n\nimport { KernelMessage } from '@jupyterlab/services';\n\nimport { JSONValue, PromiseDelegate } from '@phosphor/coreutils';\n\nimport { Message } from '@phosphor/messaging';\n\nimport { PanelLayout, Panel, Widget } from '@phosphor/widgets';\n\nimport { InputCollapser, OutputCollapser } from './collapser';\n\nimport {\n CellHeader,\n CellFooter,\n ICellHeader,\n ICellFooter\n} from './headerfooter';\n\nimport { InputArea, IInputPrompt, InputPrompt } from './inputarea';\n\nimport {\n ICellModel,\n ICodeCellModel,\n IMarkdownCellModel,\n IRawCellModel\n} from './model';\n\nimport { InputPlaceholder, OutputPlaceholder } from './placeholder';\n\n/**\n * The CSS class added to cell widgets.\n */\nconst CELL_CLASS = 'jp-Cell';\n\n/**\n * The CSS class added to the cell header.\n */\nconst CELL_HEADER_CLASS = 'jp-Cell-header';\n\n/**\n * The CSS class added to the cell footer.\n */\nconst CELL_FOOTER_CLASS = 'jp-Cell-footer';\n\n/**\n * The CSS class added to the cell input wrapper.\n */\nconst CELL_INPUT_WRAPPER_CLASS = 'jp-Cell-inputWrapper';\n\n/**\n * The CSS class added to the cell output wrapper.\n */\nconst CELL_OUTPUT_WRAPPER_CLASS = 'jp-Cell-outputWrapper';\n\n/**\n * The CSS class added to the cell input area.\n */\nconst CELL_INPUT_AREA_CLASS = 'jp-Cell-inputArea';\n\n/**\n * The CSS class added to the cell output area.\n */\nconst CELL_OUTPUT_AREA_CLASS = 'jp-Cell-outputArea';\n\n/**\n * The CSS class added to the cell input collapser.\n */\nconst CELL_INPUT_COLLAPSER_CLASS = 'jp-Cell-inputCollapser';\n\n/**\n * The CSS class added to the cell output collapser.\n */\nconst CELL_OUTPUT_COLLAPSER_CLASS = 'jp-Cell-outputCollapser';\n\n/**\n * The class name added to the cell when collapsed.\n */\nconst COLLAPSED_CLASS = 'jp-mod-collapsed';\n\n/**\n * The class name added to the cell when readonly.\n */\nconst READONLY_CLASS = 'jp-mod-readOnly';\n\n/**\n * The class name added to code cells.\n */\nconst CODE_CELL_CLASS = 'jp-CodeCell';\n\n/**\n * The class name added to markdown cells.\n */\nconst MARKDOWN_CELL_CLASS = 'jp-MarkdownCell';\n\n/**\n * The class name added to rendered markdown output widgets.\n */\nconst MARKDOWN_OUTPUT_CLASS = 'jp-MarkdownOutput';\n\n/**\n * The class name added to raw cells.\n */\nconst RAW_CELL_CLASS = 'jp-RawCell';\n\n/**\n * The class name added to a rendered input area.\n */\nconst RENDERED_CLASS = 'jp-mod-rendered';\n\nconst NO_OUTPUTS_CLASS = 'jp-mod-noOutputs';\n\n/**\n * The text applied to an empty markdown cell.\n */\nconst DEFAULT_MARKDOWN_TEXT = 'Type Markdown and LaTeX: $ α^2 $';\n\n/**\n * The timeout to wait for change activity to have ceased before rendering.\n */\nconst RENDER_TIMEOUT = 1000;\n\n/******************************************************************************\n * Cell\n ******************************************************************************/\n\n/**\n * A base cell widget.\n */\nexport class Cell extends Widget {\n /**\n * Construct a new base cell widget.\n */\n constructor(options: Cell.IOptions) {\n super();\n this.addClass(CELL_CLASS);\n let model = (this._model = options.model);\n let contentFactory = (this.contentFactory =\n options.contentFactory || Cell.defaultContentFactory);\n this.layout = new PanelLayout();\n\n // Header\n let header = (this._header = contentFactory.createCellHeader());\n header.addClass(CELL_HEADER_CLASS);\n (this.layout as PanelLayout).addWidget(header);\n\n // Input\n let inputWrapper = (this._inputWrapper = new Panel());\n inputWrapper.addClass(CELL_INPUT_WRAPPER_CLASS);\n let inputCollapser = (this._inputCollapser = new InputCollapser());\n inputCollapser.addClass(CELL_INPUT_COLLAPSER_CLASS);\n let input = (this._input = new InputArea({ model, contentFactory }));\n input.addClass(CELL_INPUT_AREA_CLASS);\n inputWrapper.addWidget(inputCollapser);\n inputWrapper.addWidget(input);\n (this.layout as PanelLayout).addWidget(inputWrapper);\n\n this._inputPlaceholder = new InputPlaceholder(() => {\n this.inputHidden = !this.inputHidden;\n });\n\n // Footer\n let footer = (this._footer = this.contentFactory.createCellFooter());\n footer.addClass(CELL_FOOTER_CLASS);\n (this.layout as PanelLayout).addWidget(footer);\n\n // Editor settings\n if (options.editorConfig) {\n Object.keys(options.editorConfig).forEach(\n (key: keyof CodeEditor.IConfig) => {\n this.editor.setOption(key, options.editorConfig[key]);\n }\n );\n }\n }\n\n /**\n * Modify some state for initialization.\n *\n * Should be called at the end of the subclasses's constructor.\n */\n protected initializeState() {\n const jupyter = this.model.metadata.get('jupyter') || ({} as any);\n this.inputHidden = jupyter.source_hidden === true;\n }\n\n /**\n * The content factory used by the widget.\n */\n readonly contentFactory: Cell.IContentFactory;\n\n /**\n * Get the prompt node used by the cell.\n */\n get promptNode(): HTMLElement {\n if (!this._inputHidden) {\n return this._input.promptNode;\n } else {\n return (this._inputPlaceholder.node as HTMLElement)\n .firstElementChild as HTMLElement;\n }\n }\n\n /**\n * Get the CodeEditorWrapper used by the cell.\n */\n get editorWidget(): CodeEditorWrapper {\n return this._input.editorWidget;\n }\n\n /**\n * Get the CodeEditor used by the cell.\n */\n get editor(): CodeEditor.IEditor {\n return this._input.editor;\n }\n\n /**\n * Get the model used by the cell.\n */\n get model(): ICellModel {\n return this._model;\n }\n\n /**\n * Get the input area for the cell.\n */\n get inputArea(): InputArea {\n return this._input;\n }\n\n /**\n * The read only state of the cell.\n */\n get readOnly(): boolean {\n return this._readOnly;\n }\n set readOnly(value: boolean) {\n if (value === this._readOnly) {\n return;\n }\n this._readOnly = value;\n this.update();\n }\n\n /**\n * A promise that resolves when the widget renders for the first time.\n */\n get ready(): Promise<void> {\n return Promise.resolve(undefined);\n }\n\n /**\n * Set the prompt for the widget.\n */\n setPrompt(value: string): void {\n this._input.setPrompt(value);\n }\n\n /**\n * The view state of input being hidden.\n */\n get inputHidden(): boolean {\n return this._inputHidden;\n }\n set inputHidden(value: boolean) {\n if (this._inputHidden === value) {\n return;\n }\n let layout = this._inputWrapper.layout as PanelLayout;\n if (value) {\n this._input.parent = null;\n layout.addWidget(this._inputPlaceholder);\n } else {\n this._inputPlaceholder.parent = null;\n layout.addWidget(this._input);\n }\n this._inputHidden = value;\n this.handleInputHidden(value);\n }\n\n /**\n * Handle the input being hidden.\n *\n * #### Notes\n * This is called by the `inputHidden` setter so that subclasses\n * can perform actions upon the input being hidden without accessing\n * private state.\n */\n protected handleInputHidden(value: boolean): void {\n return;\n }\n\n /**\n * Clone the cell, using the same model.\n */\n clone(): Cell {\n let constructor = this.constructor as typeof Cell;\n return new constructor({\n model: this.model,\n contentFactory: this.contentFactory\n });\n }\n\n /**\n * Dispose of the resources held by the widget.\n */\n dispose() {\n // Do nothing if already disposed.\n if (this.isDisposed) {\n return;\n }\n this._input = null;\n this._model = null;\n this._header = null;\n this._footer = null;\n this._inputCollapser = null;\n this._inputWrapper = null;\n this._inputPlaceholder = null;\n super.dispose();\n }\n\n /**\n * Handle `after-attach` messages.\n */\n protected onAfterAttach(msg: Message): void {\n this.update();\n }\n\n /**\n * Handle `'activate-request'` messages.\n */\n protected onActivateRequest(msg: Message): void {\n this.editor.focus();\n }\n\n /**\n * Handle `update-request` messages.\n */\n protected onUpdateRequest(msg: Message): void {\n if (!this._model) {\n return;\n }\n // Handle read only state.\n if (this.editor.getOption('readOnly') !== this._readOnly) {\n this.editor.setOption('readOnly', this._readOnly);\n this.toggleClass(READONLY_CLASS, this._readOnly);\n }\n }\n\n private _readOnly = false;\n private _model: ICellModel = null;\n private _header: ICellHeader = null;\n private _footer: ICellFooter = null;\n private _inputHidden = false;\n private _input: InputArea = null;\n private _inputCollapser: InputCollapser = null;\n private _inputWrapper: Widget = null;\n private _inputPlaceholder: InputPlaceholder = null;\n}\n\n/**\n * The namespace for the `Cell` class statics.\n */\nexport namespace Cell {\n /**\n * An options object for initializing a cell widget.\n */\n export interface IOptions {\n /**\n * The model used by the cell.\n */\n model: ICellModel;\n\n /**\n * The factory object for customizable cell children.\n */\n contentFactory?: IContentFactory;\n\n /**\n * The configuration options for the text editor widget.\n */\n editorConfig?: Partial<CodeEditor.IConfig>;\n }\n\n /**\n * The factory object for customizable cell children.\n *\n * This is used to allow users of cells to customize child content.\n *\n * This inherits from `OutputArea.IContentFactory` to avoid needless nesting and\n * provide a single factory object for all notebook/cell/outputarea related\n * widgets.\n */\n export interface IContentFactory\n extends OutputArea.IContentFactory,\n InputArea.IContentFactory {\n /**\n * Create a new cell header for the parent widget.\n */\n createCellHeader(): ICellHeader;\n\n /**\n * Create a new cell header for the parent widget.\n */\n createCellFooter(): ICellFooter;\n }\n\n /**\n * The default implementation of an `IContentFactory`.\n *\n * This includes a CodeMirror editor factory to make it easy to use out of the box.\n */\n export class ContentFactory implements IContentFactory {\n /**\n * Create a content factory for a cell.\n */\n constructor(options: ContentFactory.IOptions = {}) {\n this._editorFactory =\n options.editorFactory || InputArea.defaultEditorFactory;\n }\n\n /**\n * The readonly editor factory that create code editors\n */\n get editorFactory(): CodeEditor.Factory {\n return this._editorFactory;\n }\n\n /**\n * Create a new cell header for the parent widget.\n */\n createCellHeader(): ICellHeader {\n return new CellHeader();\n }\n\n /**\n * Create a new cell header for the parent widget.\n */\n createCellFooter(): ICellFooter {\n return new CellFooter();\n }\n\n /**\n * Create an input prompt.\n */\n createInputPrompt(): IInputPrompt {\n return new InputPrompt();\n }\n\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 private _editorFactory: CodeEditor.Factory = null;\n }\n\n /**\n * A namespace for cell content factory.\n */\n export namespace ContentFactory {\n /**\n * Options for the content factory.\n */\n export interface IOptions {\n /**\n * The editor factory used by the content factory.\n *\n * If this is not passed, a default CodeMirror editor factory\n * will be used.\n */\n editorFactory?: CodeEditor.Factory;\n }\n }\n\n /**\n * The default content factory for cells.\n */\n export const defaultContentFactory = new ContentFactory();\n}\n\n/******************************************************************************\n * CodeCell\n ******************************************************************************/\n\n/**\n * A widget for a code cell.\n */\nexport class CodeCell extends Cell {\n /**\n * Construct a code cell widget.\n */\n constructor(options: CodeCell.IOptions) {\n super(options);\n this.addClass(CODE_CELL_CLASS);\n\n // Only save options not handled by parent constructor.\n let rendermime = (this._rendermime = options.rendermime);\n let contentFactory = this.contentFactory;\n let model = this.model;\n\n // Insert the output before the cell footer.\n let outputWrapper = (this._outputWrapper = new Panel());\n outputWrapper.addClass(CELL_OUTPUT_WRAPPER_CLASS);\n let outputCollapser = (this._outputCollapser = new OutputCollapser());\n outputCollapser.addClass(CELL_OUTPUT_COLLAPSER_CLASS);\n let output = (this._output = new OutputArea({\n model: model.outputs,\n rendermime,\n contentFactory: contentFactory\n }));\n output.addClass(CELL_OUTPUT_AREA_CLASS);\n // Set a CSS if there are no outputs, and connect a signal for future\n // changes to the number of outputs. This is for conditional styling\n // if there are no outputs.\n if (model.outputs.length === 0) {\n this.addClass(NO_OUTPUTS_CLASS);\n }\n output.outputLengthChanged.connect(this._outputLengthHandler, this);\n outputWrapper.addWidget(outputCollapser);\n outputWrapper.addWidget(output);\n (this.layout as PanelLayout).insertWidget(2, outputWrapper);\n\n this._outputPlaceholder = new OutputPlaceholder(() => {\n this.outputHidden = !this.outputHidden;\n });\n\n // Modify state\n this.initializeState();\n model.stateChanged.connect(this.onStateChanged, this);\n model.metadata.changed.connect(this.onMetadataChanged, this);\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: ICodeCellModel;\n\n /**\n * Modify some state for initialization.\n *\n * Should be called at the end of the subclasses's constructor.\n */\n protected initializeState() {\n super.initializeState();\n\n const metadataScrolled = this.model.metadata.get('scrolled');\n this.outputsScrolled = metadataScrolled === true;\n\n const jupyter = this.model.metadata.get('jupyter') || ({} as any);\n const collapsed = this.model.metadata.get('collapsed');\n this.outputHidden = collapsed === true || jupyter.outputs_hidden === true;\n\n this.setPrompt(`${this.model.executionCount || ''}`);\n }\n\n /**\n * Get the output area for the cell.\n */\n get outputArea(): OutputArea {\n return this._output;\n }\n\n /**\n * The view state of output being collapsed.\n */\n get outputHidden(): boolean {\n return this._outputHidden;\n }\n set outputHidden(value: boolean) {\n if (this._outputHidden === value) {\n return;\n }\n let layout = this._outputWrapper.layout as PanelLayout;\n if (value) {\n layout.removeWidget(this._output);\n layout.addWidget(this._outputPlaceholder);\n if (this.inputHidden && !this._outputWrapper.isHidden) {\n this._outputWrapper.hide();\n }\n } else {\n if (this._outputWrapper.isHidden) {\n this._outputWrapper.show();\n }\n layout.removeWidget(this._outputPlaceholder);\n layout.addWidget(this._output);\n }\n this._outputHidden = value;\n }\n\n /**\n * Whether the output is in a scrolled state?\n */\n get outputsScrolled(): boolean {\n return this._outputsScrolled;\n }\n set outputsScrolled(value: boolean) {\n this.toggleClass('jp-mod-outputsScrolled', value);\n this._outputsScrolled = value;\n }\n\n /**\n * Handle the input being hidden.\n *\n * #### Notes\n * This method is called by the case cell implementation and is\n * subclasses here so the code cell can watch to see when input\n * is hidden without accessing private state.\n */\n protected handleInputHidden(value: boolean): void {\n if (!value && this._outputWrapper.isHidden) {\n this._outputWrapper.show();\n } else if (value && !this._outputWrapper.isHidden && this._outputHidden) {\n this._outputWrapper.hide();\n }\n }\n\n /**\n * Clone the cell, using the same model.\n */\n clone(): CodeCell {\n let constructor = this.constructor as typeof CodeCell;\n return new constructor({\n model: this.model,\n contentFactory: this.contentFactory,\n rendermime: this._rendermime\n });\n }\n\n /**\n * Clone the OutputArea alone, returning a simplified output area, using the same model.\n */\n cloneOutputArea(): OutputArea {\n return new SimplifiedOutputArea({\n model: this.model.outputs,\n contentFactory: this.contentFactory,\n rendermime: this._rendermime\n });\n }\n\n /**\n * Dispose of the resources used by the widget.\n */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n this._output.outputLengthChanged.disconnect(\n this._outputLengthHandler,\n this\n );\n this._rendermime = null;\n this._output = null;\n this._outputWrapper = null;\n this._outputCollapser = null;\n this._outputPlaceholder = null;\n super.dispose();\n }\n\n /**\n * Handle `update-request` messages.\n */\n protected onUpdateRequest(msg: Message): void {\n let value = this.model.metadata.get('collapsed') as boolean;\n this.toggleClass(COLLAPSED_CLASS, value);\n if (this._output) {\n // TODO: handle scrolled state.\n }\n super.onUpdateRequest(msg);\n }\n\n /**\n * Handle changes in the model.\n */\n protected onStateChanged(model: ICellModel, args: IChangedArgs<any>): void {\n switch (args.name) {\n case 'executionCount':\n this.setPrompt(`${(model as ICodeCellModel).executionCount || ''}`);\n break;\n default:\n break;\n }\n }\n\n /**\n * Handle changes in the metadata.\n */\n protected onMetadataChanged(\n model: IObservableMap<JSONValue>,\n args: IObservableMap.IChangedArgs<JSONValue>\n ): void {\n switch (args.key) {\n case 'collapsed':\n case 'scrolled':\n this.update();\n break;\n default:\n break;\n }\n }\n\n /**\n * Handle changes in the number of outputs in the output area.\n */\n private _outputLengthHandler(sender: OutputArea, args: number) {\n let force = args === 0 ? true : false;\n this.toggleClass(NO_OUTPUTS_CLASS, force);\n /* Turn off scrolling outputs if there are none */\n if (force) {\n this.outputsScrolled = false;\n }\n }\n\n private _rendermime: RenderMimeRegistry = null;\n private _outputHidden = false;\n private _outputsScrolled: boolean;\n private _outputWrapper: Widget = null;\n private _outputCollapser: OutputCollapser = null;\n private _outputPlaceholder: OutputPlaceholder = null;\n private _output: OutputArea = null;\n}\n\n/**\n * The namespace for the `CodeCell` class statics.\n */\nexport namespace CodeCell {\n /**\n * An options object for initializing a base cell widget.\n */\n export interface IOptions extends Cell.IOptions {\n /**\n * The model used by the cell.\n */\n model: ICodeCellModel;\n\n /**\n * The mime renderer for the cell widget.\n */\n rendermime: RenderMimeRegistry;\n }\n\n /**\n * Execute a cell given a client session.\n */\n export function execute(\n cell: CodeCell,\n session: IClientSession\n ): Promise<KernelMessage.IExecuteReplyMsg> {\n let model = cell.model;\n let code = model.value.text;\n if (!code.trim() || !session.kernel) {\n model.executionCount = null;\n model.outputs.clear();\n return Promise.resolve(void 0);\n }\n\n model.executionCount = null;\n cell.outputHidden = false;\n cell.setPrompt('*');\n model.trusted = true;\n\n return OutputArea.execute(code, cell.outputArea, session)\n .then(msg => {\n model.executionCount = msg.content.execution_count;\n return msg;\n })\n .catch(e => {\n if (e.message === 'Canceled') {\n cell.setPrompt('');\n }\n throw e;\n });\n }\n}\n\n/******************************************************************************\n * MarkdownCell\n ******************************************************************************/\n\n/**\n * A widget for a Markdown cell.\n *\n * #### Notes\n * Things get complicated if we want the rendered text to update\n * any time the text changes, the text editor model changes,\n * or the input area model changes. We don't support automatically\n * updating the rendered text in all of these cases.\n */\nexport class MarkdownCell extends Cell {\n /**\n * Construct a Markdown cell widget.\n */\n constructor(options: MarkdownCell.IOptions) {\n super(options);\n this.addClass(MARKDOWN_CELL_CLASS);\n // Ensure we can resolve attachments:\n this._rendermime = options.rendermime.clone({\n resolver: new AttachmentsResolver({\n parent: options.rendermime.resolver,\n model: this.model.attachments\n })\n });\n\n // Throttle the rendering rate of the widget.\n this._monitor = new ActivityMonitor({\n signal: this.model.contentChanged,\n timeout: RENDER_TIMEOUT\n });\n this._monitor.activityStopped.connect(() => {\n if (this._rendered) {\n this.update();\n }\n }, this);\n\n this._updateRenderedInput().then(() => {\n this._ready.resolve(void 0);\n });\n\n super.initializeState();\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: IMarkdownCellModel;\n\n /**\n * A promise that resolves when the widget renders for the first time.\n */\n get ready(): Promise<void> {\n return this._ready.promise;\n }\n\n /**\n * Whether the cell is rendered.\n */\n get rendered(): boolean {\n return this._rendered;\n }\n set rendered(value: boolean) {\n if (value === this._rendered) {\n return;\n }\n this._rendered = value;\n this._handleRendered();\n }\n\n /**\n * Render an input instead of the text editor.\n */\n protected renderInput(widget: Widget): void {\n this.addClass(RENDERED_CLASS);\n this.inputArea.renderInput(widget);\n }\n\n /**\n * Show the text editor instead of rendered input.\n */\n protected showEditor(): void {\n this.removeClass(RENDERED_CLASS);\n this.inputArea.showEditor();\n }\n\n /*\n * Handle `update-request` messages.\n */\n protected onUpdateRequest(msg: Message): void {\n // Make sure we are properly rendered.\n this._handleRendered();\n super.onUpdateRequest(msg);\n }\n\n /**\n * Handle the rendered state.\n */\n private _handleRendered(): void {\n if (!this._rendered) {\n this.showEditor();\n } else {\n this._updateRenderedInput();\n this.renderInput(this._renderer);\n }\n }\n\n /**\n * Update the rendered input.\n */\n private _updateRenderedInput(): Promise<void> {\n let model = this.model;\n let text = (model && model.value.text) || DEFAULT_MARKDOWN_TEXT;\n // Do not re-render if the text has not changed.\n if (text !== this._prevText) {\n let mimeModel = new MimeModel({ data: { 'text/markdown': text } });\n if (!this._renderer) {\n this._renderer = this._rendermime.createRenderer('text/markdown');\n this._renderer.addClass(MARKDOWN_OUTPUT_CLASS);\n }\n this._prevText = text;\n return this._renderer.renderModel(mimeModel);\n }\n return Promise.resolve(void 0);\n }\n\n /**\n * Clone the cell, using the same model.\n */\n clone(): MarkdownCell {\n let constructor = this.constructor as typeof MarkdownCell;\n return new constructor({\n model: this.model,\n contentFactory: this.contentFactory,\n rendermime: this._rendermime\n });\n }\n\n private _monitor: ActivityMonitor<any, any> = null;\n private _renderer: IRenderMime.IRenderer = null;\n private _rendermime: RenderMimeRegistry;\n private _rendered = true;\n private _prevText = '';\n private _ready = new PromiseDelegate<void>();\n}\n\n/**\n * The namespace for the `CodeCell` class statics.\n */\nexport namespace MarkdownCell {\n /**\n * An options object for initializing a base cell widget.\n */\n export interface IOptions extends Cell.IOptions {\n /**\n * The model used by the cell.\n */\n model: IMarkdownCellModel;\n\n /**\n * The mime renderer for the cell widget.\n */\n rendermime: RenderMimeRegistry;\n }\n}\n\n/******************************************************************************\n * RawCell\n ******************************************************************************/\n\n/**\n * A widget for a raw cell.\n */\nexport class RawCell extends Cell {\n /**\n * Construct a raw cell widget.\n */\n constructor(options: Cell.IOptions) {\n super(options);\n this.addClass(RAW_CELL_CLASS);\n super.initializeState();\n }\n\n /**\n * Clone the cell, using the same model.\n */\n clone(): RawCell {\n let constructor = this.constructor as typeof RawCell;\n return new constructor({\n model: this.model,\n contentFactory: this.contentFactory\n });\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: IRawCellModel;\n}\n\n/**\n * The namespace for the `RawCell` class statics.\n */\nexport namespace RawCell {\n /**\n * An options object for initializing a base cell widget.\n */\n export interface IOptions extends Cell.IOptions {\n /**\n * The model used by the cell.\n */\n model: IRawCellModel;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../../cells/src/widget.ts"],"names":[],"mappings":";AAAA;;;+EAG+E;;AAE/E,yDAA8D;AAI9D,qDAAsE;AAMtE,uDAOgC;AAEhC,uDAIgC;AAIhC,mDAA6E;AAI7E,+CAA+D;AAE/D,2CAA8D;AAE9D,iDAKwB;AAExB,2CAAmE;AASnE,+CAAoE;AAEpE;;GAEG;AACH,MAAM,UAAU,GAAG,SAAS,CAAC;AAE7B;;GAEG;AACH,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C;;GAEG;AACH,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAExD;;GAEG;AACH,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAE1D;;GAEG;AACH,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAElD;;GAEG;AACH,MAAM,sBAAsB,GAAG,o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OAAO,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC9B,KAAK,CAAC,eAAe,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,WAAW,GAAG,IAAI,CAAC,WAA6B,CAAC;QACrD,OAAO,IAAI,WAAW,CAAC;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC,CAAC;IACL,CAAC;CAMF;AAzBD,0BAyBC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\nimport { AttachmentsResolver } from '@jupyterlab/attachments';\n\nimport { IClientSession } from '@jupyterlab/apputils';\n\nimport { IChangedArgs, ActivityMonitor } from '@jupyterlab/coreutils';\n\nimport { CodeEditor, CodeEditorWrapper } from '@jupyterlab/codeeditor';\n\nimport { IObservableMap } from '@jupyterlab/observables';\n\nimport {\n OutputArea,\n SimplifiedOutputArea,\n IOutputPrompt,\n OutputPrompt,\n IStdin,\n Stdin\n} from '@jupyterlab/outputarea';\n\nimport {\n IRenderMime,\n MimeModel,\n RenderMimeRegistry\n} from '@jupyterlab/rendermime';\n\nimport { KernelMessage } from '@jupyterlab/services';\n\nimport { JSONValue, PromiseDelegate, JSONObject } from '@phosphor/coreutils';\n\nimport { Message } from '@phosphor/messaging';\n\nimport { PanelLayout, Panel, Widget } from '@phosphor/widgets';\n\nimport { InputCollapser, OutputCollapser } from './collapser';\n\nimport {\n CellHeader,\n CellFooter,\n ICellHeader,\n ICellFooter\n} from './headerfooter';\n\nimport { InputArea, IInputPrompt, InputPrompt } from './inputarea';\n\nimport {\n ICellModel,\n ICodeCellModel,\n IMarkdownCellModel,\n IRawCellModel\n} from './model';\n\nimport { InputPlaceholder, OutputPlaceholder } from './placeholder';\n\n/**\n * The CSS class added to cell widgets.\n */\nconst CELL_CLASS = 'jp-Cell';\n\n/**\n * The CSS class added to the cell header.\n */\nconst CELL_HEADER_CLASS = 'jp-Cell-header';\n\n/**\n * The CSS class added to the cell footer.\n */\nconst CELL_FOOTER_CLASS = 'jp-Cell-footer';\n\n/**\n * The CSS class added to the cell input wrapper.\n */\nconst CELL_INPUT_WRAPPER_CLASS = 'jp-Cell-inputWrapper';\n\n/**\n * The CSS class added to the cell output wrapper.\n */\nconst CELL_OUTPUT_WRAPPER_CLASS = 'jp-Cell-outputWrapper';\n\n/**\n * The CSS class added to the cell input area.\n */\nconst CELL_INPUT_AREA_CLASS = 'jp-Cell-inputArea';\n\n/**\n * The CSS class added to the cell output area.\n */\nconst CELL_OUTPUT_AREA_CLASS = 'jp-Cell-outputArea';\n\n/**\n * The CSS class added to the cell input collapser.\n */\nconst CELL_INPUT_COLLAPSER_CLASS = 'jp-Cell-inputCollapser';\n\n/**\n * The CSS class added to the cell output collapser.\n */\nconst CELL_OUTPUT_COLLAPSER_CLASS = 'jp-Cell-outputCollapser';\n\n/**\n * The class name added to the cell when collapsed.\n */\nconst COLLAPSED_CLASS = 'jp-mod-collapsed';\n\n/**\n * The class name added to the cell when readonly.\n */\nconst READONLY_CLASS = 'jp-mod-readOnly';\n\n/**\n * The class name added to code cells.\n */\nconst CODE_CELL_CLASS = 'jp-CodeCell';\n\n/**\n * The class name added to markdown cells.\n */\nconst MARKDOWN_CELL_CLASS = 'jp-MarkdownCell';\n\n/**\n * The class name added to rendered markdown output widgets.\n */\nconst MARKDOWN_OUTPUT_CLASS = 'jp-MarkdownOutput';\n\n/**\n * The class name added to raw cells.\n */\nconst RAW_CELL_CLASS = 'jp-RawCell';\n\n/**\n * The class name added to a rendered input area.\n */\nconst RENDERED_CLASS = 'jp-mod-rendered';\n\nconst NO_OUTPUTS_CLASS = 'jp-mod-noOutputs';\n\n/**\n * The text applied to an empty markdown cell.\n */\nconst DEFAULT_MARKDOWN_TEXT = 'Type Markdown and LaTeX: $ α^2 $';\n\n/**\n * The timeout to wait for change activity to have ceased before rendering.\n */\nconst RENDER_TIMEOUT = 1000;\n\n/******************************************************************************\n * Cell\n ******************************************************************************/\n\n/**\n * A base cell widget.\n */\nexport class Cell extends Widget {\n /**\n * Construct a new base cell widget.\n */\n constructor(options: Cell.IOptions) {\n super();\n this.addClass(CELL_CLASS);\n let model = (this._model = options.model);\n let contentFactory = (this.contentFactory =\n options.contentFactory || Cell.defaultContentFactory);\n this.layout = new PanelLayout();\n\n // Header\n let header = (this._header = contentFactory.createCellHeader());\n header.addClass(CELL_HEADER_CLASS);\n (this.layout as PanelLayout).addWidget(header);\n\n // Input\n let inputWrapper = (this._inputWrapper = new Panel());\n inputWrapper.addClass(CELL_INPUT_WRAPPER_CLASS);\n let inputCollapser = (this._inputCollapser = new InputCollapser());\n inputCollapser.addClass(CELL_INPUT_COLLAPSER_CLASS);\n let input = (this._input = new InputArea({ model, contentFactory }));\n input.addClass(CELL_INPUT_AREA_CLASS);\n inputWrapper.addWidget(inputCollapser);\n inputWrapper.addWidget(input);\n (this.layout as PanelLayout).addWidget(inputWrapper);\n\n this._inputPlaceholder = new InputPlaceholder(() => {\n this.inputHidden = !this.inputHidden;\n });\n\n // Footer\n let footer = (this._footer = this.contentFactory.createCellFooter());\n footer.addClass(CELL_FOOTER_CLASS);\n (this.layout as PanelLayout).addWidget(footer);\n\n // Editor settings\n if (options.editorConfig) {\n Object.keys(options.editorConfig).forEach(\n (key: keyof CodeEditor.IConfig) => {\n this.editor.setOption(key, options.editorConfig[key]);\n }\n );\n }\n }\n\n /**\n * Modify some state for initialization.\n *\n * Should be called at the end of the subclasses's constructor.\n */\n protected initializeState() {\n const jupyter = this.model.metadata.get('jupyter') || ({} as any);\n this.inputHidden = jupyter.source_hidden === true;\n }\n\n /**\n * The content factory used by the widget.\n */\n readonly contentFactory: Cell.IContentFactory;\n\n /**\n * Get the prompt node used by the cell.\n */\n get promptNode(): HTMLElement {\n if (!this._inputHidden) {\n return this._input.promptNode;\n } else {\n return (this._inputPlaceholder.node as HTMLElement)\n .firstElementChild as HTMLElement;\n }\n }\n\n /**\n * Get the CodeEditorWrapper used by the cell.\n */\n get editorWidget(): CodeEditorWrapper {\n return this._input.editorWidget;\n }\n\n /**\n * Get the CodeEditor used by the cell.\n */\n get editor(): CodeEditor.IEditor {\n return this._input.editor;\n }\n\n /**\n * Get the model used by the cell.\n */\n get model(): ICellModel {\n return this._model;\n }\n\n /**\n * Get the input area for the cell.\n */\n get inputArea(): InputArea {\n return this._input;\n }\n\n /**\n * The read only state of the cell.\n */\n get readOnly(): boolean {\n return this._readOnly;\n }\n set readOnly(value: boolean) {\n if (value === this._readOnly) {\n return;\n }\n this._readOnly = value;\n this.update();\n }\n\n /**\n * A promise that resolves when the widget renders for the first time.\n */\n get ready(): Promise<void> {\n return Promise.resolve(undefined);\n }\n\n /**\n * Set the prompt for the widget.\n */\n setPrompt(value: string): void {\n this._input.setPrompt(value);\n }\n\n /**\n * The view state of input being hidden.\n */\n get inputHidden(): boolean {\n return this._inputHidden;\n }\n set inputHidden(value: boolean) {\n if (this._inputHidden === value) {\n return;\n }\n let layout = this._inputWrapper.layout as PanelLayout;\n if (value) {\n this._input.parent = null;\n layout.addWidget(this._inputPlaceholder);\n } else {\n this._inputPlaceholder.parent = null;\n layout.addWidget(this._input);\n }\n this._inputHidden = value;\n this.handleInputHidden(value);\n }\n\n /**\n * Handle the input being hidden.\n *\n * #### Notes\n * This is called by the `inputHidden` setter so that subclasses\n * can perform actions upon the input being hidden without accessing\n * private state.\n */\n protected handleInputHidden(value: boolean): void {\n return;\n }\n\n /**\n * Clone the cell, using the same model.\n */\n clone(): Cell {\n let constructor = this.constructor as typeof Cell;\n return new constructor({\n model: this.model,\n contentFactory: this.contentFactory\n });\n }\n\n /**\n * Dispose of the resources held by the widget.\n */\n dispose() {\n // Do nothing if already disposed.\n if (this.isDisposed) {\n return;\n }\n this._input = null;\n this._model = null;\n this._header = null;\n this._footer = null;\n this._inputCollapser = null;\n this._inputWrapper = null;\n this._inputPlaceholder = null;\n super.dispose();\n }\n\n /**\n * Handle `after-attach` messages.\n */\n protected onAfterAttach(msg: Message): void {\n this.update();\n }\n\n /**\n * Handle `'activate-request'` messages.\n */\n protected onActivateRequest(msg: Message): void {\n this.editor.focus();\n }\n\n /**\n * Handle `update-request` messages.\n */\n protected onUpdateRequest(msg: Message): void {\n if (!this._model) {\n return;\n }\n // Handle read only state.\n if (this.editor.getOption('readOnly') !== this._readOnly) {\n this.editor.setOption('readOnly', this._readOnly);\n this.toggleClass(READONLY_CLASS, this._readOnly);\n }\n }\n\n private _readOnly = false;\n private _model: ICellModel = null;\n private _header: ICellHeader = null;\n private _footer: ICellFooter = null;\n private _inputHidden = false;\n private _input: InputArea = null;\n private _inputCollapser: InputCollapser = null;\n private _inputWrapper: Widget = null;\n private _inputPlaceholder: InputPlaceholder = null;\n}\n\n/**\n * The namespace for the `Cell` class statics.\n */\nexport namespace Cell {\n /**\n * An options object for initializing a cell widget.\n */\n export interface IOptions {\n /**\n * The model used by the cell.\n */\n model: ICellModel;\n\n /**\n * The factory object for customizable cell children.\n */\n contentFactory?: IContentFactory;\n\n /**\n * The configuration options for the text editor widget.\n */\n editorConfig?: Partial<CodeEditor.IConfig>;\n }\n\n /**\n * The factory object for customizable cell children.\n *\n * This is used to allow users of cells to customize child content.\n *\n * This inherits from `OutputArea.IContentFactory` to avoid needless nesting and\n * provide a single factory object for all notebook/cell/outputarea related\n * widgets.\n */\n export interface IContentFactory\n extends OutputArea.IContentFactory,\n InputArea.IContentFactory {\n /**\n * Create a new cell header for the parent widget.\n */\n createCellHeader(): ICellHeader;\n\n /**\n * Create a new cell header for the parent widget.\n */\n createCellFooter(): ICellFooter;\n }\n\n /**\n * The default implementation of an `IContentFactory`.\n *\n * This includes a CodeMirror editor factory to make it easy to use out of the box.\n */\n export class ContentFactory implements IContentFactory {\n /**\n * Create a content factory for a cell.\n */\n constructor(options: ContentFactory.IOptions = {}) {\n this._editorFactory =\n options.editorFactory || InputArea.defaultEditorFactory;\n }\n\n /**\n * The readonly editor factory that create code editors\n */\n get editorFactory(): CodeEditor.Factory {\n return this._editorFactory;\n }\n\n /**\n * Create a new cell header for the parent widget.\n */\n createCellHeader(): ICellHeader {\n return new CellHeader();\n }\n\n /**\n * Create a new cell header for the parent widget.\n */\n createCellFooter(): ICellFooter {\n return new CellFooter();\n }\n\n /**\n * Create an input prompt.\n */\n createInputPrompt(): IInputPrompt {\n return new InputPrompt();\n }\n\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 private _editorFactory: CodeEditor.Factory = null;\n }\n\n /**\n * A namespace for cell content factory.\n */\n export namespace ContentFactory {\n /**\n * Options for the content factory.\n */\n export interface IOptions {\n /**\n * The editor factory used by the content factory.\n *\n * If this is not passed, a default CodeMirror editor factory\n * will be used.\n */\n editorFactory?: CodeEditor.Factory;\n }\n }\n\n /**\n * The default content factory for cells.\n */\n export const defaultContentFactory = new ContentFactory();\n}\n\n/******************************************************************************\n * CodeCell\n ******************************************************************************/\n\n/**\n * A widget for a code cell.\n */\nexport class CodeCell extends Cell {\n /**\n * Construct a code cell widget.\n */\n constructor(options: CodeCell.IOptions) {\n super(options);\n this.addClass(CODE_CELL_CLASS);\n\n // Only save options not handled by parent constructor.\n let rendermime = (this._rendermime = options.rendermime);\n let contentFactory = this.contentFactory;\n let model = this.model;\n\n // Insert the output before the cell footer.\n let outputWrapper = (this._outputWrapper = new Panel());\n outputWrapper.addClass(CELL_OUTPUT_WRAPPER_CLASS);\n let outputCollapser = (this._outputCollapser = new OutputCollapser());\n outputCollapser.addClass(CELL_OUTPUT_COLLAPSER_CLASS);\n let output = (this._output = new OutputArea({\n model: model.outputs,\n rendermime,\n contentFactory: contentFactory\n }));\n output.addClass(CELL_OUTPUT_AREA_CLASS);\n // Set a CSS if there are no outputs, and connect a signal for future\n // changes to the number of outputs. This is for conditional styling\n // if there are no outputs.\n if (model.outputs.length === 0) {\n this.addClass(NO_OUTPUTS_CLASS);\n }\n output.outputLengthChanged.connect(this._outputLengthHandler, this);\n outputWrapper.addWidget(outputCollapser);\n outputWrapper.addWidget(output);\n (this.layout as PanelLayout).insertWidget(2, outputWrapper);\n\n this._outputPlaceholder = new OutputPlaceholder(() => {\n this.outputHidden = !this.outputHidden;\n });\n\n // Modify state\n this.initializeState();\n model.stateChanged.connect(this.onStateChanged, this);\n model.metadata.changed.connect(this.onMetadataChanged, this);\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: ICodeCellModel;\n\n /**\n * Modify some state for initialization.\n *\n * Should be called at the end of the subclasses's constructor.\n */\n protected initializeState() {\n super.initializeState();\n\n const metadataScrolled = this.model.metadata.get('scrolled');\n this.outputsScrolled = metadataScrolled === true;\n\n const jupyter = this.model.metadata.get('jupyter') || ({} as any);\n const collapsed = this.model.metadata.get('collapsed');\n this.outputHidden = collapsed === true || jupyter.outputs_hidden === true;\n\n this.setPrompt(`${this.model.executionCount || ''}`);\n }\n\n /**\n * Get the output area for the cell.\n */\n get outputArea(): OutputArea {\n return this._output;\n }\n\n /**\n * The view state of output being collapsed.\n */\n get outputHidden(): boolean {\n return this._outputHidden;\n }\n set outputHidden(value: boolean) {\n if (this._outputHidden === value) {\n return;\n }\n let layout = this._outputWrapper.layout as PanelLayout;\n if (value) {\n layout.removeWidget(this._output);\n layout.addWidget(this._outputPlaceholder);\n if (this.inputHidden && !this._outputWrapper.isHidden) {\n this._outputWrapper.hide();\n }\n } else {\n if (this._outputWrapper.isHidden) {\n this._outputWrapper.show();\n }\n layout.removeWidget(this._outputPlaceholder);\n layout.addWidget(this._output);\n }\n this._outputHidden = value;\n }\n\n /**\n * Whether the output is in a scrolled state?\n */\n get outputsScrolled(): boolean {\n return this._outputsScrolled;\n }\n set outputsScrolled(value: boolean) {\n this.toggleClass('jp-mod-outputsScrolled', value);\n this._outputsScrolled = value;\n }\n\n /**\n * Handle the input being hidden.\n *\n * #### Notes\n * This method is called by the case cell implementation and is\n * subclasses here so the code cell can watch to see when input\n * is hidden without accessing private state.\n */\n protected handleInputHidden(value: boolean): void {\n if (!value && this._outputWrapper.isHidden) {\n this._outputWrapper.show();\n } else if (value && !this._outputWrapper.isHidden && this._outputHidden) {\n this._outputWrapper.hide();\n }\n }\n\n /**\n * Clone the cell, using the same model.\n */\n clone(): CodeCell {\n let constructor = this.constructor as typeof CodeCell;\n return new constructor({\n model: this.model,\n contentFactory: this.contentFactory,\n rendermime: this._rendermime\n });\n }\n\n /**\n * Clone the OutputArea alone, returning a simplified output area, using the same model.\n */\n cloneOutputArea(): OutputArea {\n return new SimplifiedOutputArea({\n model: this.model.outputs,\n contentFactory: this.contentFactory,\n rendermime: this._rendermime\n });\n }\n\n /**\n * Dispose of the resources used by the widget.\n */\n dispose(): void {\n if (this.isDisposed) {\n return;\n }\n this._output.outputLengthChanged.disconnect(\n this._outputLengthHandler,\n this\n );\n this._rendermime = null;\n this._output = null;\n this._outputWrapper = null;\n this._outputCollapser = null;\n this._outputPlaceholder = null;\n super.dispose();\n }\n\n /**\n * Handle `update-request` messages.\n */\n protected onUpdateRequest(msg: Message): void {\n let value = this.model.metadata.get('collapsed') as boolean;\n this.toggleClass(COLLAPSED_CLASS, value);\n if (this._output) {\n // TODO: handle scrolled state.\n }\n super.onUpdateRequest(msg);\n }\n\n /**\n * Handle changes in the model.\n */\n protected onStateChanged(model: ICellModel, args: IChangedArgs<any>): void {\n switch (args.name) {\n case 'executionCount':\n this.setPrompt(`${(model as ICodeCellModel).executionCount || ''}`);\n break;\n default:\n break;\n }\n }\n\n /**\n * Handle changes in the metadata.\n */\n protected onMetadataChanged(\n model: IObservableMap<JSONValue>,\n args: IObservableMap.IChangedArgs<JSONValue>\n ): void {\n switch (args.key) {\n case 'collapsed':\n case 'scrolled':\n this.update();\n break;\n default:\n break;\n }\n }\n\n /**\n * Handle changes in the number of outputs in the output area.\n */\n private _outputLengthHandler(sender: OutputArea, args: number) {\n let force = args === 0 ? true : false;\n this.toggleClass(NO_OUTPUTS_CLASS, force);\n /* Turn off scrolling outputs if there are none */\n if (force) {\n this.outputsScrolled = false;\n }\n }\n\n private _rendermime: RenderMimeRegistry = null;\n private _outputHidden = false;\n private _outputsScrolled: boolean;\n private _outputWrapper: Widget = null;\n private _outputCollapser: OutputCollapser = null;\n private _outputPlaceholder: OutputPlaceholder = null;\n private _output: OutputArea = null;\n}\n\n/**\n * The namespace for the `CodeCell` class statics.\n */\nexport namespace CodeCell {\n /**\n * An options object for initializing a base cell widget.\n */\n export interface IOptions extends Cell.IOptions {\n /**\n * The model used by the cell.\n */\n model: ICodeCellModel;\n\n /**\n * The mime renderer for the cell widget.\n */\n rendermime: RenderMimeRegistry;\n }\n\n /**\n * Execute a cell given a client session.\n */\n export function execute(\n cell: CodeCell,\n session: IClientSession,\n metadata?: JSONObject\n ): Promise<KernelMessage.IExecuteReplyMsg> {\n let model = cell.model;\n let code = model.value.text;\n if (!code.trim() || !session.kernel) {\n model.executionCount = null;\n model.outputs.clear();\n return Promise.resolve(void 0);\n }\n\n let cellId = { cellId: model.id };\n metadata = { ...metadata, ...cellId };\n model.executionCount = null;\n cell.outputHidden = false;\n cell.setPrompt('*');\n model.trusted = true;\n\n return OutputArea.execute(code, cell.outputArea, session, metadata)\n .then(msg => {\n model.executionCount = msg.content.execution_count;\n return msg;\n })\n .catch(e => {\n if (e.message === 'Canceled') {\n cell.setPrompt('');\n }\n throw e;\n });\n }\n}\n\n/******************************************************************************\n * MarkdownCell\n ******************************************************************************/\n\n/**\n * A widget for a Markdown cell.\n *\n * #### Notes\n * Things get complicated if we want the rendered text to update\n * any time the text changes, the text editor model changes,\n * or the input area model changes. We don't support automatically\n * updating the rendered text in all of these cases.\n */\nexport class MarkdownCell extends Cell {\n /**\n * Construct a Markdown cell widget.\n */\n constructor(options: MarkdownCell.IOptions) {\n super(options);\n this.addClass(MARKDOWN_CELL_CLASS);\n // Ensure we can resolve attachments:\n this._rendermime = options.rendermime.clone({\n resolver: new AttachmentsResolver({\n parent: options.rendermime.resolver,\n model: this.model.attachments\n })\n });\n\n // Throttle the rendering rate of the widget.\n this._monitor = new ActivityMonitor({\n signal: this.model.contentChanged,\n timeout: RENDER_TIMEOUT\n });\n this._monitor.activityStopped.connect(() => {\n if (this._rendered) {\n this.update();\n }\n }, this);\n\n this._updateRenderedInput().then(() => {\n this._ready.resolve(void 0);\n });\n\n super.initializeState();\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: IMarkdownCellModel;\n\n /**\n * A promise that resolves when the widget renders for the first time.\n */\n get ready(): Promise<void> {\n return this._ready.promise;\n }\n\n /**\n * Whether the cell is rendered.\n */\n get rendered(): boolean {\n return this._rendered;\n }\n set rendered(value: boolean) {\n if (value === this._rendered) {\n return;\n }\n this._rendered = value;\n this._handleRendered();\n }\n\n /**\n * Render an input instead of the text editor.\n */\n protected renderInput(widget: Widget): void {\n this.addClass(RENDERED_CLASS);\n this.inputArea.renderInput(widget);\n }\n\n /**\n * Show the text editor instead of rendered input.\n */\n protected showEditor(): void {\n this.removeClass(RENDERED_CLASS);\n this.inputArea.showEditor();\n }\n\n /*\n * Handle `update-request` messages.\n */\n protected onUpdateRequest(msg: Message): void {\n // Make sure we are properly rendered.\n this._handleRendered();\n super.onUpdateRequest(msg);\n }\n\n /**\n * Handle the rendered state.\n */\n private _handleRendered(): void {\n if (!this._rendered) {\n this.showEditor();\n } else {\n this._updateRenderedInput();\n this.renderInput(this._renderer);\n }\n }\n\n /**\n * Update the rendered input.\n */\n private _updateRenderedInput(): Promise<void> {\n let model = this.model;\n let text = (model && model.value.text) || DEFAULT_MARKDOWN_TEXT;\n // Do not re-render if the text has not changed.\n if (text !== this._prevText) {\n let mimeModel = new MimeModel({ data: { 'text/markdown': text } });\n if (!this._renderer) {\n this._renderer = this._rendermime.createRenderer('text/markdown');\n this._renderer.addClass(MARKDOWN_OUTPUT_CLASS);\n }\n this._prevText = text;\n return this._renderer.renderModel(mimeModel);\n }\n return Promise.resolve(void 0);\n }\n\n /**\n * Clone the cell, using the same model.\n */\n clone(): MarkdownCell {\n let constructor = this.constructor as typeof MarkdownCell;\n return new constructor({\n model: this.model,\n contentFactory: this.contentFactory,\n rendermime: this._rendermime\n });\n }\n\n private _monitor: ActivityMonitor<any, any> = null;\n private _renderer: IRenderMime.IRenderer = null;\n private _rendermime: RenderMimeRegistry;\n private _rendered = true;\n private _prevText = '';\n private _ready = new PromiseDelegate<void>();\n}\n\n/**\n * The namespace for the `CodeCell` class statics.\n */\nexport namespace MarkdownCell {\n /**\n * An options object for initializing a base cell widget.\n */\n export interface IOptions extends Cell.IOptions {\n /**\n * The model used by the cell.\n */\n model: IMarkdownCellModel;\n\n /**\n * The mime renderer for the cell widget.\n */\n rendermime: RenderMimeRegistry;\n }\n}\n\n/******************************************************************************\n * RawCell\n ******************************************************************************/\n\n/**\n * A widget for a raw cell.\n */\nexport class RawCell extends Cell {\n /**\n * Construct a raw cell widget.\n */\n constructor(options: Cell.IOptions) {\n super(options);\n this.addClass(RAW_CELL_CLASS);\n super.initializeState();\n }\n\n /**\n * Clone the cell, using the same model.\n */\n clone(): RawCell {\n let constructor = this.constructor as typeof RawCell;\n return new constructor({\n model: this.model,\n contentFactory: this.contentFactory\n });\n }\n\n /**\n * The model used by the widget.\n */\n readonly model: IRawCellModel;\n}\n\n/**\n * The namespace for the `RawCell` class statics.\n */\nexport namespace RawCell {\n /**\n * An options object for initializing a base cell widget.\n */\n export interface IOptions extends Cell.IOptions {\n /**\n * The model used by the cell.\n */\n model: IRawCellModel;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/cells",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "JupyterLab - Notebook Cells",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyterlab",
|
|
6
6
|
"bugs": {
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"watch": "tsc -w --listEmittedFiles"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@jupyterlab/apputils": "^0.
|
|
34
|
-
"@jupyterlab/attachments": "^0.
|
|
35
|
-
"@jupyterlab/codeeditor": "^0.
|
|
36
|
-
"@jupyterlab/codemirror": "^0.
|
|
37
|
-
"@jupyterlab/coreutils": "^2.
|
|
38
|
-
"@jupyterlab/observables": "^2.0.
|
|
39
|
-
"@jupyterlab/outputarea": "^0.
|
|
40
|
-
"@jupyterlab/rendermime": "^0.
|
|
41
|
-
"@jupyterlab/services": "^3.
|
|
33
|
+
"@jupyterlab/apputils": "^0.18.4",
|
|
34
|
+
"@jupyterlab/attachments": "^0.18.4",
|
|
35
|
+
"@jupyterlab/codeeditor": "^0.18.4",
|
|
36
|
+
"@jupyterlab/codemirror": "^0.18.4",
|
|
37
|
+
"@jupyterlab/coreutils": "^2.1.4",
|
|
38
|
+
"@jupyterlab/observables": "^2.0.7",
|
|
39
|
+
"@jupyterlab/outputarea": "^0.18.4",
|
|
40
|
+
"@jupyterlab/rendermime": "^0.18.4",
|
|
41
|
+
"@jupyterlab/services": "^3.1.4",
|
|
42
42
|
"@phosphor/coreutils": "^1.3.0",
|
|
43
43
|
"@phosphor/messaging": "^1.2.2",
|
|
44
44
|
"@phosphor/signaling": "^1.2.2",
|