Skip to content

Commit

Permalink
setup with new typescript version and build
Browse files Browse the repository at this point in the history
  • Loading branch information
gwincr11 committed Mar 13, 2023
1 parent bd607d7 commit 3f9c36b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
8 changes: 6 additions & 2 deletions packages/nbdime/src/diff/widget/linked-cells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,16 @@ class LazyDisplayLinkedListCell extends LinkedListCell {

showLazyCellUp() {
this.showLazyCell();
this._prev?.expandUp();
if (this._prev) {
this._prev.expandUp();
}
}

showLazyCellDown() {
this.showLazyCell();
this._next?.expandDown();
if (this._next) {
this._next.expandDown();
}
}

showLazyCell() {
Expand Down
20 changes: 6 additions & 14 deletions packages/nbdime/src/diff/widget/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
IRenderMimeRegistry
} from '@jupyterlab/rendermime';

import { ILinkedListCell, LazyDisplayLinkedListCell, LinkedListCell } from "./linked-cells";
import { LazyDisplayLinkedListCell, LinkedListCell } from "./linked-cells";
import { CellDiffWidget } from "./cell";
import {
CHUNK_PANEL_CLASS,
Expand All @@ -18,30 +18,28 @@ import {

import { MetadataDiffWidget } from "./metadata";

import { NotebookDiffModel, CellDiffModel } from "../model";
import type { NotebookDiffModel, CellDiffModel } from "../model";

const NBDIFF_CLASS = "jp-Notebook-diff";

type Command<T> = new (renderFunc: ()=> CellDiffWidget) => T


/**
* NotebookDiffWidget
*/
export class NotebookDiffWidget extends Panel {
private _model: NotebookDiffModel;
private _rendermime: IRenderMimeRegistry;
private previousCell: LinkedListCell | null;

constructor(
model: NotebookDiffModel,
rendermime: IRenderMimeRegistry,
displayedCellWrapper: Command<ILinkedListCell> = LinkedListCell,
lazyDisplayWrapper: Command<LazyDisplayLinkedListCell> = LazyDisplayLinkedListCell
) {
super();
this._model = model;
this._rendermime = rendermime;
this.addClass(NBDIFF_CLASS);
this.previousCell = null;
this.displayedCellWrapper = displayedCellWrapper;
this.lazyDisplayWrapper = lazyDisplayWrapper;
}

/**
Expand Down Expand Up @@ -145,10 +143,4 @@ export class NotebookDiffWidget extends Panel {
get model(): NotebookDiffModel {
return this._model;
}

private _model: NotebookDiffModel;
private _rendermime: IRenderMimeRegistry;
private previousCell: LinkedListCell | null;
private displayedCellWrapper: Command<ILinkedListCell>;
private lazyDisplayWrapper: Command<ILinkedListCell>;
}
2 changes: 1 addition & 1 deletion packages/nbdime/src/styles/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
--jp-merge-either-color2: #cff4f4;
--jp-expand-outer-wrapper: rgb(221, 244, 255);
--jp-expand-color: rgb(87, 96, 106);
--jp-expand-a-color: rgba(84, 174, 255, 0.4)
--jp-expand-a-color: rgba(84, 174, 255, 0.4);
--jp-expand-svg-color: rgb(87, 96, 106);
--jp-expand-a-hover-color: rgb(14, 94, 208);
--jp-expand-a-hover-svg-color: rgb(255, 255, 255);
Expand Down
5 changes: 1 addition & 4 deletions packages/webapp/src/app/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
// Distributed under the terms of the Modified BSD License.
"use strict";

import * as nbformat from "@jupyterlab/nbformat";

import type * as nbformat from '@jupyterlab/nbformat';
import { Panel, Widget } from "@lumino/widgets";

import { RenderMimeRegistry } from "@jupyterlab/rendermime";

import { defaultSanitizer } from "@jupyterlab/apputils";

import { PageConfig } from "@jupyterlab/coreutils";

import type {
IDiffEntry
} from 'nbdime/lib/diff/diffentries';
Expand All @@ -27,6 +23,7 @@ import { getBaseUrl, getConfigOption, toggleSpinner } from "./common";
import { exportDiff } from "./staticdiff";

import { rendererFactories } from "./rendermime";
import { MathJaxTypesetter } from "@jupyterlab/mathjax2";

let diffWidget: NotebookDiffWidget | null = null;

Expand Down

0 comments on commit 3f9c36b

Please sign in to comment.