jupyter-js-notebook
Advanced tools
Comparing version 0.5.11 to 0.5.12
import { IInputAreaModel } from '../input-area'; | ||
import { IOutputAreaModel } from '../output-area'; | ||
import { IObservableList } from 'phosphor-observablelist'; | ||
import { IChangedArgs, Property } from 'phosphor-properties'; | ||
import { ISignal, Signal } from 'phosphor-signaling'; | ||
import { IChangedArgs } from 'phosphor-properties'; | ||
import { ISignal } from 'phosphor-signaling'; | ||
/** | ||
@@ -47,2 +47,6 @@ * An enum which describes the type of cell. | ||
/** | ||
* A signal emitted when the cell is selected. | ||
*/ | ||
selected: ISignal<IBaseCellModel, void>; | ||
/** | ||
* Get namespaced metadata about the cell. | ||
@@ -58,2 +62,6 @@ */ | ||
dirty: boolean; | ||
/** | ||
* Select the cell model. | ||
*/ | ||
select(): void; | ||
} | ||
@@ -94,19 +102,8 @@ /** | ||
* A signal emitted when the state of the model changes. | ||
* | ||
* **See also:** [[stateChanged]] | ||
*/ | ||
static stateChangedSignal: Signal<IBaseCellModel, IChangedArgs<any>>; | ||
/** | ||
* A signal emitted when the state of the model changes. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[stateChangedSignal]]. | ||
*/ | ||
stateChanged: ISignal<IBaseCellModel, IChangedArgs<any>>; | ||
/** | ||
* A property descriptor for the input area model. | ||
* | ||
* **See also:** [[input]] | ||
* A signal emitted when the cell is selected. | ||
*/ | ||
static inputProperty: Property<IBaseCellModel, IInputAreaModel>; | ||
selected: ISignal<IBaseCellModel, void>; | ||
/** | ||
@@ -139,2 +136,6 @@ * Get the input area model. | ||
/** | ||
* Select the cell model. | ||
*/ | ||
select(): void; | ||
/** | ||
* The type of cell. | ||
@@ -153,19 +154,6 @@ */ | ||
/** | ||
* A property descriptor holding the output area model. | ||
* | ||
* TODO: Do we need this execute signal? | ||
* **See also:** [[output]] | ||
*/ | ||
static outputProperty: Property<CodeCellModel, IOutputAreaModel>; | ||
/** | ||
* Get the output area model. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[outputProperty]]. | ||
*/ | ||
/** | ||
* Set the output area model. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[outputProperty]]. | ||
*/ | ||
@@ -180,20 +168,12 @@ output: IOutputAreaModel; | ||
/** | ||
* A property descriptor which determines whether the input area should be rendered. | ||
* | ||
* **See also:** [[rendered]] | ||
* Get whether we should display a rendered representation. | ||
*/ | ||
static renderedProperty: Property<MarkdownCellModel, boolean>; | ||
/** | ||
* Get whether we should display a rendered representation. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[renderedProperty]]. | ||
*/ | ||
rendered: boolean; | ||
/** | ||
* Get whether we should display a rendered representation. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[renderedProperty]]. | ||
* Select the cell model. | ||
*/ | ||
rendered: boolean; | ||
select(): void; | ||
type: CellType; | ||
@@ -200,0 +180,0 @@ } |
@@ -38,8 +38,5 @@ // Copyright (c) Jupyter Development Team. | ||
* A signal emitted when the state of the model changes. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[stateChangedSignal]]. | ||
*/ | ||
get: function () { | ||
return BaseCellModel.stateChangedSignal.bind(this); | ||
return Private.stateChangedSignal.bind(this); | ||
}, | ||
@@ -49,2 +46,12 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(BaseCellModel.prototype, "selected", { | ||
/** | ||
* A signal emitted when the cell is selected. | ||
*/ | ||
get: function () { | ||
return Private.selectedSignal.bind(this); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(BaseCellModel.prototype, "input", { | ||
@@ -58,3 +65,3 @@ /** | ||
get: function () { | ||
return BaseCellModel.inputProperty.get(this); | ||
return Private.inputProperty.get(this); | ||
}, | ||
@@ -68,3 +75,3 @@ /** | ||
set: function (value) { | ||
BaseCellModel.inputProperty.set(this, value); | ||
Private.inputProperty.set(this, value); | ||
value.stateChanged.connect(this._inputChanged, this); | ||
@@ -98,2 +105,9 @@ }, | ||
/** | ||
* Select the cell model. | ||
*/ | ||
BaseCellModel.prototype.select = function () { | ||
this.selected.emit(void 0); | ||
this.input.textEditor.select(); | ||
}; | ||
/** | ||
* Re-emit changes to the input dirty state. | ||
@@ -106,17 +120,2 @@ */ | ||
}; | ||
/** | ||
* A signal emitted when the state of the model changes. | ||
* | ||
* **See also:** [[stateChanged]] | ||
*/ | ||
BaseCellModel.stateChangedSignal = new phosphor_signaling_1.Signal(); | ||
/** | ||
* A property descriptor for the input area model. | ||
* | ||
* **See also:** [[input]] | ||
*/ | ||
BaseCellModel.inputProperty = new phosphor_properties_1.Property({ | ||
name: 'input', | ||
notify: BaseCellModel.stateChangedSignal, | ||
}); | ||
return BaseCellModel; | ||
@@ -137,17 +136,11 @@ })(); | ||
* Get the output area model. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[outputProperty]]. | ||
*/ | ||
get: function () { | ||
return CodeCellModel.outputProperty.get(this); | ||
return Private.outputProperty.get(this); | ||
}, | ||
/** | ||
* Set the output area model. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[outputProperty]]. | ||
*/ | ||
set: function (value) { | ||
CodeCellModel.outputProperty.set(this, value); | ||
Private.outputProperty.set(this, value); | ||
}, | ||
@@ -157,12 +150,2 @@ enumerable: true, | ||
}); | ||
/** | ||
* A property descriptor holding the output area model. | ||
* | ||
* TODO: Do we need this execute signal? | ||
* **See also:** [[output]] | ||
*/ | ||
CodeCellModel.outputProperty = new phosphor_properties_1.Property({ | ||
name: 'output', | ||
notify: CodeCellModel.stateChangedSignal, | ||
}); | ||
return CodeCellModel; | ||
@@ -183,17 +166,11 @@ })(BaseCellModel); | ||
* Get whether we should display a rendered representation. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[renderedProperty]]. | ||
*/ | ||
get: function () { | ||
return MarkdownCellModel.renderedProperty.get(this); | ||
return Private.renderedProperty.get(this); | ||
}, | ||
/** | ||
* Get whether we should display a rendered representation. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[renderedProperty]]. | ||
*/ | ||
set: function (value) { | ||
MarkdownCellModel.renderedProperty.set(this, value); | ||
Private.renderedProperty.set(this, value); | ||
}, | ||
@@ -204,10 +181,9 @@ enumerable: true, | ||
/** | ||
* A property descriptor which determines whether the input area should be rendered. | ||
* | ||
* **See also:** [[rendered]] | ||
* Select the cell model. | ||
*/ | ||
MarkdownCellModel.renderedProperty = new phosphor_properties_1.Property({ | ||
name: 'rendered', | ||
notify: MarkdownCellModel.stateChangedSignal, | ||
}); | ||
MarkdownCellModel.prototype.select = function () { | ||
this.selected.emit(void 0); | ||
if (!this.rendered) | ||
this.input.textEditor.select(); | ||
}; | ||
return MarkdownCellModel; | ||
@@ -237,1 +213,38 @@ })(BaseCellModel); | ||
exports.isRawCellModel = isRawCellModel; | ||
/** | ||
* A namespace for cell private data. | ||
*/ | ||
var Private; | ||
(function (Private) { | ||
/** | ||
* A signal emitted when the state of the model changes. | ||
*/ | ||
Private.stateChangedSignal = new phosphor_signaling_1.Signal(); | ||
/** | ||
* A signal emitted when a cell model is selected. | ||
*/ | ||
Private.selectedSignal = new phosphor_signaling_1.Signal(); | ||
/** | ||
* A property descriptor for the input area model. | ||
*/ | ||
Private.inputProperty = new phosphor_properties_1.Property({ | ||
name: 'input', | ||
notify: Private.stateChangedSignal, | ||
}); | ||
/** | ||
* A property descriptor holding the output area model. | ||
* | ||
* TODO: Do we need this execute signal? | ||
*/ | ||
Private.outputProperty = new phosphor_properties_1.Property({ | ||
name: 'output', | ||
notify: Private.stateChangedSignal, | ||
}); | ||
/** | ||
* A property descriptor which determines whether the input area should be rendered. | ||
*/ | ||
Private.renderedProperty = new phosphor_properties_1.Property({ | ||
name: 'rendered', | ||
notify: Private.stateChangedSignal, | ||
}); | ||
})(Private || (Private = {})); |
@@ -83,2 +83,6 @@ import { IChangedArgs } from 'phosphor-properties'; | ||
protected modelStateChanged(sender: IMarkdownCellModel, args: IChangedArgs<any>): void; | ||
/** | ||
* A selection handler for the model. | ||
*/ | ||
private _onModelSelected(); | ||
protected input: InputAreaWidget; | ||
@@ -85,0 +89,0 @@ protected rendered: Widget; |
@@ -174,4 +174,12 @@ // Copyright (c) Jupyter Development Team. | ||
}; | ||
/** | ||
* A selection handler for the model. | ||
*/ | ||
MarkdownCellWidget.prototype._onModelSelected = function () { | ||
if (this._model.rendered) { | ||
this.node.focus(); | ||
} | ||
}; | ||
return MarkdownCellWidget; | ||
})(CellWidget); | ||
exports.MarkdownCellWidget = MarkdownCellWidget; |
@@ -102,5 +102,2 @@ import { ICellModel, ICodeCellModel, IMarkdownCellModel } from '../cells'; | ||
* A signal emitted when the state of the model changes. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[stateChangedSignal]]. | ||
*/ | ||
@@ -117,11 +114,5 @@ stateChanged: ISignal<INotebookModel, IChangedArgs<any>>; | ||
* Get the default mimetype for cells new code cells. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[defaultMimetype]]. | ||
*/ | ||
/** | ||
* Set the default mimetype for cells new code cells. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[defaultMimetype]]. | ||
*/ | ||
@@ -131,11 +122,5 @@ defaultMimetype: string; | ||
* Get the mode of the notebook. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[modeProperty]]. | ||
*/ | ||
/** | ||
* Set the mode of the notebook. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[modeProperty]]. | ||
*/ | ||
@@ -145,11 +130,5 @@ mode: NotebookMode; | ||
* Get the selected cell index. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[selectedCellIndexProperty]]. | ||
*/ | ||
/** | ||
* Set the selected cell index. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[selectedCellIndexProperty]]. | ||
*/ | ||
@@ -156,0 +135,0 @@ selectedCellIndex: number; |
@@ -36,5 +36,2 @@ var cells_1 = require('../cells'); | ||
* A signal emitted when the state of the model changes. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[stateChangedSignal]]. | ||
*/ | ||
@@ -63,5 +60,2 @@ get: function () { | ||
* Get the default mimetype for cells new code cells. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[defaultMimetype]]. | ||
*/ | ||
@@ -73,5 +67,2 @@ get: function () { | ||
* Set the default mimetype for cells new code cells. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[defaultMimetype]]. | ||
*/ | ||
@@ -87,5 +78,2 @@ set: function (value) { | ||
* Get the mode of the notebook. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[modeProperty]]. | ||
*/ | ||
@@ -97,5 +85,2 @@ get: function () { | ||
* Set the mode of the notebook. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[modeProperty]]. | ||
*/ | ||
@@ -111,5 +96,2 @@ set: function (value) { | ||
* Get the selected cell index. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[selectedCellIndexProperty]]. | ||
*/ | ||
@@ -121,5 +103,2 @@ get: function () { | ||
* Set the selected cell index. | ||
* | ||
* #### Notes | ||
* This is a pure delegate to the [[selectedCellIndexProperty]]. | ||
*/ | ||
@@ -130,3 +109,3 @@ set: function (value) { | ||
if (cell) | ||
cell.input.textEditor.select(); | ||
cell.select(); | ||
}, | ||
@@ -133,0 +112,0 @@ enumerable: true, |
{ | ||
"name": "jupyter-js-notebook", | ||
"version": "0.5.11", | ||
"version": "0.5.12", | ||
"description": "Notebook widget for Jupyter", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112464
3502