Notebook Views Insert Cells Modal (#16836)

* Add html-to-image package

* Add image card type
This commit is contained in:
Daniel Grajeda
2021-08-31 14:11:21 -06:00
committed by GitHub
parent a96bf181c0
commit e02ae0865a
14 changed files with 305 additions and 99 deletions

View File

@@ -21,10 +21,12 @@ function cellCollides(c1: INotebookViewCell, c2: INotebookViewCell): boolean {
export class NotebookViewModel implements INotebookView {
private _onDeleted = new Emitter<INotebookView>();
private _onCellVisibilityChanged = new Emitter<ICellModel>();
private _isNew: boolean = false;
public readonly guid: string;
public readonly onDeleted = this._onDeleted.event;
public readonly onCellVisibilityChanged = this._onCellVisibilityChanged.event;
constructor(
protected _name: string,
@@ -119,10 +121,12 @@ export class NotebookViewModel implements INotebookView {
public insertCell(cell: ICellModel) {
this.updateCell(cell, this, { hidden: false });
this._onCellVisibilityChanged.fire(cell);
}
public hideCell(cell: ICellModel) {
this.updateCell(cell, this, { hidden: true });
this._onCellVisibilityChanged.fire(cell);
}
public moveCell(cell: ICellModel, x: number, y: number) {

View File

@@ -26,8 +26,9 @@ export interface INotebookViews {
export interface INotebookView {
readonly guid: string;
readonly onDeleted: Event<INotebookView>;
isNew: boolean;
readonly onCellVisibilityChanged: Event<ICellModel>;
isNew: boolean;
cells: Readonly<ICellModel[]>;
hiddenCells: Readonly<ICellModel[]>;
displayedCells: Readonly<ICellModel[]>;