Skip to content

Commit

Permalink
Take review comments into account.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaudinFlorence committed Sep 15, 2023
1 parent c721222 commit 63c9c24
Show file tree
Hide file tree
Showing 25 changed files with 190 additions and 210 deletions.
2 changes: 1 addition & 1 deletion nbdime/tests/test_server_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_git_difftool(git_repo2, server_extension_app):
"closable": False,
"remote": "",
"savable": False,
"hideUnchanged": True
"hideUnchanged": True,
}


Expand Down
2 changes: 1 addition & 1 deletion nbdime/webapp/nbdimeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def make_app(**params):
(r'/api/diff', ApiDiffHandler, params),
(r'/api/merge', ApiMergeHandler, params),
(r'/api/store', ApiMergeStoreHandler, params),
(r'/api/closetool', ApiCloseHandler, params)
(r'/api/closetool', ApiCloseHandler, params),
# Static handler will be added automatically
]
if base_url != '/':
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"updated": "lerna updated",
"watch": "tsc --build --watch"
},
"dependencies": {
"npm-which": "^3.0.1"
},
"devDependencies": {
"@jupyterlab/buildutils": "4.0.0",
"@jupyterlab/testutils": "4.0.0",
Expand All @@ -27,7 +24,8 @@
"jest": "^29.6.4",
"lerna": "^4.0.0",
"mocha": "^10.2.0",
"rimraf": "^2.6.3"
"rimraf": "^2.6.3",
"npm-which": "^3.0.1"
},
"workspaces": [
"packages/*"
Expand Down
7 changes: 4 additions & 3 deletions packages/labextension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,26 @@
"watch": "tsc --build --watch"
},
"dependencies": {
"@jupyterlab/application": "^4.0.0",

"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/codeeditor": "^4.0.0",
"@jupyterlab/docregistry": "^4.0.0",
"@jupyterlab/nbformat": "^4.0.0",
"@jupyterlab/notebook": "^4.0.0",
"@jupyterlab/rendermime": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@jupyterlab/settingregistry": "^4.0.0",
"@lumino/algorithm": "^2.0.1",
"@lumino/commands": "^2.0.0",
"@lumino/coreutils": "^2.1.2",
"@lumino/disposable": "^2.1.2",
"@lumino/widgets": "^2.3.0",
"nbdime": "^6.2.0"
},
"devDependencies": {
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/docregistry": "^4.0.0",
"@lumino/commands": "^2.0.0",
"mkdirp": "^3.0.0",
"rimraf": "^5.0.0",
"typescript": "^4.9.0"
Expand Down
144 changes: 0 additions & 144 deletions packages/labextension/style/base.css

This file was deleted.

142 changes: 141 additions & 1 deletion packages/labextension/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,144 @@
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/
@import url('base.css');
@import url('nbdime/lib/common/collapsible.css');
@import url('nbdime/lib/upstreaming/flexpanel.css');
@import url('nbdime/lib/common/dragpanel.css');
@import url('nbdime/lib/styles/variables.css');
@import url('nbdime/lib/styles/common.css');
@import url('nbdime/lib/styles/diff.css');
@import url('nbdime/lib/styles/merge.css');

.nbdime-Widget {
display: flex;
flex-direction: column;
}

.nbdime-root {
padding: var(--jp-notebook-padding);
min-width: 50px;
min-height: 50px;
outline: none;
overflow: auto;
background: var(--jp-layout-color0);
color: var(--jp-ui-font-color0);
flex: 1 1 auto;
}

.jp-ToolbarButtonComponent-icon.action-notebook-diff {
color: var(--jp-ui-font-color0);
}

.nbdime-toolbarButton .jp-ToolbarButtonComponent-label {
display: none;
}

.jp-PluginList-icon.nbdime-icon {
font-size: 16px;
vertical-align: text-bottom;
}

/* Header syling */

.jp-fa-tabIcon {
padding-top: 6px;
}

.nbdime-Diff {
border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
box-shadow: var(--jp-toolbar-box-shadow);
background: var(--jp-toolbar-background);
color: var(--jp-ui-font-color1);
flex: 0 0 auto;
padding: 2px;
z-index: 1;
}

.nbdime-header-buttonrow > * {
padding-left: 8px;
padding-right: 8px;
}

.nbdime-Diff .nbdime-header-base {
display: inline-block;
width: calc(50% - 8px);
background-color: var(--jp-diff-deleted-color0);
padding: 0px 4px;
vertical-align: top;
}

.nbdime-Diff .nbdime-header-remote {
display: inline-block;
width: calc(49% - 8px);
background-color: var(--jp-diff-added-color0);
padding: 0px 4px;
vertical-align: top;
}

.nbdime-Diff .nbdime-header-local {
display: none;
width: calc(49% - 8px);
padding: 0px 4px;
vertical-align: top;
}

/* Hiding unchanged cells if told to */
.nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff.jp-Diff-unchanged {
display: none;
}

/* Show a marker with the number of cells hidden before */
.nbdime-root.jp-mod-hideUnchanged
.jp-Cell-diff[data-nbdime-NCellsHiddenBefore]::before,
.nbdime-root.jp-mod-hideUnchanged
.jp-Diff-addremchunk[data-nbdime-NCellsHiddenBefore]::before {
content: attr(data-nbdime-NCellsHiddenBefore) ' unchanged cell(s) hidden';
position: absolute;
width: 100%;
top: 0;
background-color: var(--jp-layout-color2);
border-top: solid var(--jp-layout-color3) 1px;
border-bottom: solid var(--jp-layout-color3) 1px;
text-align: center;
}

/* Show a marker with the number of cells hidden after (for hidden cells at end) */
.nbdime-root.jp-mod-hideUnchanged
.jp-Cell-diff[data-nbdime-NCellsHiddenAfter]::after,
.nbdime-root.jp-mod-hideUnchanged
.jp-Diff-addremchunk[data-nbdime-NCellsHiddenAfter]::after {
content: attr(data-nbdime-NCellsHiddenAfter) ' unchanged cell(s) hidden';
position: absolute;
width: 100%;
bottom: 0;
background-color: var(--jp-layout-color2);
border-top: solid var(--jp-layout-color3) 1px;
border-bottom: solid var(--jp-layout-color3) 1px;
text-align: center;
}

.nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenBefore],
.nbdime-root.jp-mod-hideUnchanged
.jp-Diff-addremchunk[data-nbdime-NCellsHiddenBefore] {
padding-top: 40px;
}

.nbdime-root.jp-mod-hideUnchanged .jp-Cell-diff[data-nbdime-NCellsHiddenAfter],
.nbdime-root.jp-mod-hideUnchanged
.jp-Diff-addremchunk[data-nbdime-NCellsHiddenAfter] {
padding-bottom: 40px;
}

/* Marker for when all cells are unchanged and hidden */
.nbdime-root.jp-mod-hideUnchanged
.jp-Notebook-diff[data-nbdime-AllCellsHidden]::after {
content: 'No changes, ' attr(data-nbdime-AllCellsHidden)
' unchanged cell(s) hidden';
display: block;
width: 100%;
background-color: var(--jp-layout-color2);
border-top: solid var(--jp-layout-color3) 1px;
border-bottom: solid var(--jp-layout-color3) 1px;
text-align: center;
}

2 changes: 1 addition & 1 deletion packages/labextension/style/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/
import './base.css';
import './index.css';
4 changes: 2 additions & 2 deletions packages/nbdime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@codemirror/legacy-modes": "^6.3.2",
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.14.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/codeeditor": "^4.0.0",
"@jupyterlab/codemirror": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
Expand All @@ -36,14 +35,15 @@
"@lumino/algorithm": "^2.0.1",
"@lumino/coreutils": "^2.1.2",
"@lumino/dragdrop": "^2.1.3",
"@lumino/messaging": "^2.0.0",
"@lumino/signaling": "^2.1.2",
"@lumino/widgets": "^2.3.0",
"json-stable-stringify": "^1.0.1"
},
"devDependencies": {
"@babel/core": "^7.5.0",
"@babel/preset-env": "^7.5.0",
"@jupyterlab/apputils": "^4.0.0",
"@lumino/messaging": "^2.0.0",
"@types/jest": "^29.5.4",
"@types/json-stable-stringify": "^1.0.32",
"@types/node": "^18.15.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/nbdime/src/common/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { StreamLanguage } from '@codemirror/language';

import { type EditorView } from '@codemirror/view';
import type { EditorView } from '@codemirror/view';

import type { Text } from '@codemirror/state';

Expand Down
Loading

0 comments on commit 63c9c24

Please sign in to comment.