diff --git a/packages/nbdime/src/diff/widget/linked-cells.ts b/packages/nbdime/src/diff/widget/linked-cells.ts index 56cc0f83..ed3e4513 100644 --- a/packages/nbdime/src/diff/widget/linked-cells.ts +++ b/packages/nbdime/src/diff/widget/linked-cells.ts @@ -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() { diff --git a/packages/nbdime/src/diff/widget/notebook.ts b/packages/nbdime/src/diff/widget/notebook.ts index 2be870ff..9ba18899 100644 --- a/packages/nbdime/src/diff/widget/notebook.ts +++ b/packages/nbdime/src/diff/widget/notebook.ts @@ -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, @@ -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 = 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 = LinkedListCell, - lazyDisplayWrapper: Command = LazyDisplayLinkedListCell ) { super(); this._model = model; this._rendermime = rendermime; this.addClass(NBDIFF_CLASS); this.previousCell = null; - this.displayedCellWrapper = displayedCellWrapper; - this.lazyDisplayWrapper = lazyDisplayWrapper; } /** @@ -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; - private lazyDisplayWrapper: Command; } diff --git a/packages/nbdime/src/styles/variables.css b/packages/nbdime/src/styles/variables.css index 49935ff3..258f9610 100644 --- a/packages/nbdime/src/styles/variables.css +++ b/packages/nbdime/src/styles/variables.css @@ -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); diff --git a/packages/webapp/src/app/diff.ts b/packages/webapp/src/app/diff.ts index 30349307..08f2d2c9 100644 --- a/packages/webapp/src/app/diff.ts +++ b/packages/webapp/src/app/diff.ts @@ -2,8 +2,6 @@ // 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"; @@ -11,8 +9,6 @@ import { RenderMimeRegistry } from "@jupyterlab/rendermime"; import { defaultSanitizer } from "@jupyterlab/apputils"; -import { PageConfig } from "@jupyterlab/coreutils"; - import type { IDiffEntry } from 'nbdime/lib/diff/diffentries'; @@ -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;