diff --git a/README.md b/README.md
index c67b59d08..d1600c29c 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@ To see the extension in action, open the example notebook included in the Binder
- Git (version `>=2.x`)
For older versions of JupyterLab, go to:
+
- [3.x branch](https://github.com/jupyterlab/jupyterlab-git/tree/jlab-3)
- [2.x branch](https://github.com/jupyterlab/jupyterlab-git/tree/jlab-2)
diff --git a/package.json b/package.json
index 4ede86a15..998187a57 100644
--- a/package.json
+++ b/package.json
@@ -1,288 +1,292 @@
{
- "name": "@jupyterlab/git",
- "version": "0.42.0",
- "description": "A JupyterLab extension for version control using git",
- "main": "lib/index.js",
- "types": "lib/index.d.ts",
- "style": "style/index.css",
- "license": "BSD-3-Clause",
- "author": "Jupyter Development Team",
- "keywords": [
- "Jupyter",
- "JupyterLab",
- "JupyterLab3",
- "jupyterlab-extension",
- "Git"
- ],
- "scripts": {
- "build": "jlpm build:lib && jlpm build:labextension:dev",
- "build:labextension": "jupyter labextension build .",
- "build:labextension:dev": "jupyter labextension build --development True .",
- "build:lib": "genversion --es6 --semi src/version.ts && tsc --sourceMap",
- "build:lib:prod": "genversion --es6 --semi src/version.ts && tsc",
- "build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
- "clean": "jlpm clean:lib",
- "clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
- "clean:labextension": "rimraf jupyterlab_git/labextension jupyterlab_git/_version.py",
- "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
- "clean:lintcache": "rimraf .eslintcache .stylelintcache",
- "clean:more": "jlpm clean && rimraf build dist MANIFEST",
- "clean:slate": "jlpm clean:more && jlpm clean:labextension && rimraf node_modules",
- "contributors:generate": "jlpm run all-contributors generate",
- "eslint": "jlpm eslint:check --fix",
- "eslint:check": "eslint . --cache --ext .ts,.tsx",
- "install:extension": "jlpm build",
- "lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
- "lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
- "prepare": "genversion --es6 --semi src/version.ts",
- "prettier": "jlpm prettier:base --write --list-different",
- "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
- "prettier:check": "jlpm prettier:base --check",
- "stylelint": "jlpm stylelint:check --fix",
- "stylelint:check": "stylelint --cache \"style/**/*.css\"",
- "test": "jest --coverage --no-cache",
- "watch": "run-p watch:src watch:labextension",
- "watch:labextension": "jupyter labextension watch .",
- "watch:src": "tsc -w --sourceMap"
- },
- "files": [
- "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
- "schema/**/*.{json,}",
- "style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
- "style/index.js"
- ],
- "sideEffects": [
- "style/*.css",
- "style/index.js"
- ],
- "styleModule": "style/index.js",
- "dependencies": {
- "@jupyterlab/application": "^4.0.6",
- "@jupyterlab/apputils": "^4.1.6",
- "@jupyterlab/codemirror": "^4.0.6",
- "@jupyterlab/console": "^4.0.6",
- "@jupyterlab/coreutils": "^6.0.6",
- "@jupyterlab/docregistry": "^4.0.6",
- "@jupyterlab/filebrowser": "^4.0.6",
- "@jupyterlab/mainmenu": "^4.0.6",
- "@jupyterlab/nbformat": "^4.0.6",
- "@jupyterlab/rendermime": "^4.0.6",
- "@jupyterlab/services": "^7.0.6",
- "@jupyterlab/settingregistry": "^4.0.6",
- "@jupyterlab/terminal": "^4.0.6",
- "@jupyterlab/translation": "^4.0.6",
- "@jupyterlab/ui-components": "^4.0.6",
- "@lumino/collections": "^2.0.0",
- "@lumino/commands": "^2.0.1",
- "@lumino/coreutils": "^2.0.0",
- "@lumino/disposable": "^2.0.0",
- "@lumino/messaging": "^2.0.0",
- "@lumino/polling": "^2.0.0",
- "@lumino/signaling": "^2.0.0",
- "@lumino/widgets": "^2.0.1",
- "@mui/core": "^5.0.0-alpha.54",
- "@mui/icons-material": "^5.11.16",
- "@mui/lab": "^5.0.0-alpha.127",
- "@mui/material": "^5.12.1",
- "@mui/styles": "^5.12.0",
- "diff-match-patch": "^1.0.4",
- "filesize": "^10.0.7",
- "nbdime": "^7.0.0-alpha.0",
- "nbdime-jupyterlab": "^3.0.0-alpha.0",
- "react": "^18.2.0",
- "react-dom": "^18.2.0",
- "react-virtualized-auto-sizer": "^1.0.2",
- "react-window": "^1.8.5",
- "typestyle": "^2.0.1"
- },
- "devDependencies": {
- "@babel/core": "^7.0.0",
- "@babel/preset-env": "^7.0.0",
- "@jupyterlab/builder": "^4.0.0",
- "@jupyterlab/testutils": "^4.0.0",
- "@types/diff-match-patch": "^1.0.32",
- "@types/enzyme": "^3.1.15",
- "@types/jest": "^29.2.0",
- "@types/json-schema": "^7.0.11",
- "@types/react": "^18.0.26",
- "@types/react-addons-linked-state-mixin": "^0.14.22",
- "@types/react-dom": "^18.2.0",
- "@types/react-virtualized-auto-sizer": "^1.0.0",
- "@types/react-window": "^1.8.2",
- "@types/resize-observer-browser": "^0.1.7",
- "@typescript-eslint/eslint-plugin": "^6.1.0",
- "@typescript-eslint/parser": "^6.1.0",
- "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
- "all-contributors-cli": "^6.14.0",
- "css-loader": "^6.7.1",
- "enzyme": "^3.7.0",
- "eslint": "^8.36.0",
- "eslint-config-prettier": "^8.8.0",
- "eslint-plugin-prettier": "^5.0.0",
- "eslint-plugin-react": "^7.33.0",
- "genversion": "^2.2.1",
- "husky": "^8.0.3",
- "identity-obj-proxy": "^3.0.0",
- "jest": "^29.2.0",
- "jest-fetch-mock": "^3.0.0",
- "lint-staged": "^13.2.3",
- "mkdirp": "^1.0.3",
- "npm-run-all": "^4.1.5",
- "prettier": "^3.0.0",
- "rimraf": "^5.0.1",
- "source-map-loader": "^1.0.2",
- "style-loader": "^3.3.1",
- "stylelint": "^15.10.1",
- "stylelint-config-recommended": "^13.0.0",
- "stylelint-config-standard": "^34.0.0",
- "stylelint-csstree-validator": "^3.0.0",
- "stylelint-prettier": "^4.0.0",
- "ts-jest": "^26.0.0",
- "typescript": "~5.0.2",
- "yjs": "^13.5.40"
- },
- "directories": {
- "lib": "lib"
- },
- "lint-staged": {
- "*.{ts,tsx}": [
- "eslint . --ext .ts,.tsx --fix"
- ]
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/jupyterlab/jupyterlab-git.git"
- },
- "bugs": {
- "url": "https://github.com/jupyterlab/jupyterlab-git/issues"
- },
- "homepage": "https://github.com/jupyterlab/jupyterlab-git",
- "jupyterlab": {
- "discovery": {
- "server": {
- "managers": [
- "pip",
- "conda"
+ "name": "@jupyterlab/git",
+ "version": "0.42.0",
+ "description": "A JupyterLab extension for version control using git",
+ "main": "lib/index.js",
+ "types": "lib/index.d.ts",
+ "style": "style/index.css",
+ "license": "BSD-3-Clause",
+ "author": "Jupyter Development Team",
+ "keywords": [
+ "Jupyter",
+ "JupyterLab",
+ "JupyterLab3",
+ "jupyterlab-extension",
+ "Git"
+ ],
+ "scripts": {
+ "build": "jlpm build:lib && jlpm build:labextension:dev",
+ "build:labextension": "jupyter labextension build .",
+ "build:labextension:dev": "jupyter labextension build --development True .",
+ "build:lib": "genversion --es6 --semi src/version.ts && tsc --sourceMap",
+ "build:lib:prod": "genversion --es6 --semi src/version.ts && tsc",
+ "build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
+ "clean": "jlpm clean:lib",
+ "clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
+ "clean:labextension": "rimraf jupyterlab_git/labextension jupyterlab_git/_version.py",
+ "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
+ "clean:lintcache": "rimraf .eslintcache .stylelintcache",
+ "clean:more": "jlpm clean && rimraf build dist MANIFEST",
+ "clean:slate": "jlpm clean:more && jlpm clean:labextension && rimraf node_modules",
+ "contributors:generate": "jlpm run all-contributors generate",
+ "eslint": "jlpm eslint:check --fix",
+ "eslint:check": "eslint . --cache --ext .ts,.tsx",
+ "install:extension": "jlpm build",
+ "lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
+ "lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
+ "prepare": "genversion --es6 --semi src/version.ts",
+ "prettier": "jlpm prettier:base --write --list-different",
+ "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
+ "prettier:check": "jlpm prettier:base --check",
+ "stylelint": "jlpm stylelint:check --fix",
+ "stylelint:check": "stylelint --cache \"style/**/*.css\"",
+ "test": "jest --coverage --no-cache",
+ "watch": "run-p watch:src watch:labextension",
+ "watch:labextension": "jupyter labextension watch .",
+ "watch:src": "tsc -w --sourceMap"
+ },
+ "files": [
+ "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
+ "schema/**/*.{json,}",
+ "style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
+ "style/index.js"
+ ],
+ "sideEffects": [
+ "style/*.css",
+ "style/index.js"
+ ],
+ "styleModule": "style/index.js",
+ "dependencies": {
+ "@emotion/react": "^11.10.6",
+ "@emotion/styled": "^11.10.6",
+ "@jupyterlab/application": "^4.0.6",
+ "@jupyterlab/apputils": "^4.1.6",
+ "@jupyterlab/codeeditor": "^4.0.6",
+ "@jupyterlab/codemirror": "^4.0.6",
+ "@jupyterlab/console": "^4.0.6",
+ "@jupyterlab/coreutils": "^6.0.6",
+ "@jupyterlab/docregistry": "^4.0.6",
+ "@jupyterlab/filebrowser": "^4.0.6",
+ "@jupyterlab/mainmenu": "^4.0.6",
+ "@jupyterlab/nbformat": "^4.0.6",
+ "@jupyterlab/rendermime": "^4.0.6",
+ "@jupyterlab/services": "^7.0.6",
+ "@jupyterlab/settingregistry": "^4.0.6",
+ "@jupyterlab/terminal": "^4.0.6",
+ "@jupyterlab/translation": "^4.0.6",
+ "@jupyterlab/ui-components": "^4.0.6",
+ "@lumino/collections": "^2.0.0",
+ "@lumino/commands": "^2.0.1",
+ "@lumino/coreutils": "^2.0.0",
+ "@lumino/disposable": "^2.0.0",
+ "@lumino/messaging": "^2.0.0",
+ "@lumino/polling": "^2.0.0",
+ "@lumino/signaling": "^2.0.0",
+ "@lumino/widgets": "^2.0.1",
+ "@mui/core": "^5.0.0-alpha.54",
+ "@mui/icons-material": "^5.11.16",
+ "@mui/lab": "^5.0.0-alpha.127",
+ "@mui/material": "^5.12.1",
+ "@mui/styles": "^5.12.0",
+ "diff-match-patch": "^1.0.4",
+ "filesize": "^10.0.7",
+ "nbdime": "^7.0.0-alpha.0",
+ "nbdime-jupyterlab": "^3.0.0-alpha.0",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "react-virtualized-auto-sizer": "^1.0.2",
+ "react-window": "^1.8.5",
+ "typestyle": "^2.0.1"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.0.0",
+ "@babel/preset-env": "^7.0.0",
+ "@jupyterlab/builder": "^4.0.0",
+ "@jupyterlab/testutils": "^4.0.0",
+ "@types/diff-match-patch": "^1.0.32",
+ "@types/enzyme": "^3.1.15",
+ "@types/jest": "^29.2.0",
+ "@types/json-schema": "^7.0.11",
+ "@types/react": "^18.0.26",
+ "@types/react-addons-linked-state-mixin": "^0.14.22",
+ "@types/react-dom": "^18.2.0",
+ "@types/react-virtualized-auto-sizer": "^1.0.0",
+ "@types/react-window": "^1.8.2",
+ "@types/resize-observer-browser": "^0.1.7",
+ "@typescript-eslint/eslint-plugin": "^6.1.0",
+ "@typescript-eslint/parser": "^6.1.0",
+ "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
+ "all-contributors-cli": "^6.14.0",
+ "css-loader": "^6.7.1",
+ "enzyme": "^3.7.0",
+ "eslint": "^8.36.0",
+ "eslint-config-prettier": "^8.8.0",
+ "eslint-plugin-prettier": "^5.0.0",
+ "eslint-plugin-react": "^7.33.0",
+ "genversion": "^2.2.1",
+ "husky": "^8.0.3",
+ "identity-obj-proxy": "^3.0.0",
+ "jest": "^29.2.0",
+ "jest-fetch-mock": "^3.0.0",
+ "lint-staged": "^13.2.3",
+ "mkdirp": "^1.0.3",
+ "npm-run-all": "^4.1.5",
+ "prettier": "^3.0.0",
+ "rimraf": "^5.0.1",
+ "source-map-loader": "^1.0.2",
+ "style-loader": "^3.3.1",
+ "stylelint": "^15.10.1",
+ "stylelint-config-recommended": "^13.0.0",
+ "stylelint-config-standard": "^34.0.0",
+ "stylelint-csstree-validator": "^3.0.0",
+ "stylelint-prettier": "^4.0.0",
+ "ts-jest": "^26.0.0",
+ "typescript": "~5.0.2",
+ "yjs": "^13.5.40"
+ },
+ "directories": {
+ "lib": "lib"
+ },
+ "lint-staged": {
+ "*.{ts,tsx}": [
+ "eslint . --ext .ts,.tsx --fix"
+ ]
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/jupyterlab/jupyterlab-git.git"
+ },
+ "bugs": {
+ "url": "https://github.com/jupyterlab/jupyterlab-git/issues"
+ },
+ "homepage": "https://github.com/jupyterlab/jupyterlab-git",
+ "jupyterlab": {
+ "discovery": {
+ "server": {
+ "managers": [
+ "pip",
+ "conda"
+ ],
+ "base": {
+ "name": "jupyterlab-git"
+ }
+ }
+ },
+ "extension": true,
+ "schemaDir": "schema",
+ "sharedPackages": {
+ "@material-ui/core": {
+ "singleton": true
+ },
+ "@material-ui/icons": {
+ "singleton": true
+ },
+ "@material-ui/lab": {
+ "singleton": true
+ },
+ "nbdime": {
+ "bundled": false,
+ "singleton": true
+ },
+ "nbdime-jupyterlab": {
+ "bundled": false,
+ "singleton": true
+ }
+ },
+ "outputDir": "jupyterlab_git/labextension"
+ },
+ "eslintConfig": {
+ "extends": [
+ "eslint:recommended",
+ "plugin:@typescript-eslint/eslint-recommended",
+ "plugin:@typescript-eslint/recommended",
+ "plugin:prettier/recommended"
],
- "base": {
- "name": "jupyterlab-git"
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "project": "tsconfig.json",
+ "sourceType": "module"
+ },
+ "plugins": [
+ "@typescript-eslint"
+ ],
+ "rules": {
+ "@typescript-eslint/naming-convention": [
+ "error",
+ {
+ "selector": "interface",
+ "format": [
+ "PascalCase"
+ ],
+ "custom": {
+ "regex": "^I[A-Z]",
+ "match": true
+ }
+ }
+ ],
+ "@typescript-eslint/no-unused-vars": [
+ "warn",
+ {
+ "args": "none"
+ }
+ ],
+ "@typescript-eslint/no-explicit-any": "off",
+ "@typescript-eslint/no-namespace": "off",
+ "@typescript-eslint/no-use-before-define": "off",
+ "@typescript-eslint/quotes": [
+ "error",
+ "single",
+ {
+ "avoidEscape": true,
+ "allowTemplateLiterals": false
+ }
+ ],
+ "curly": [
+ "error",
+ "all"
+ ],
+ "eqeqeq": "error",
+ "prefer-arrow-callback": "error"
}
- }
- },
- "extension": true,
- "schemaDir": "schema",
- "sharedPackages": {
- "@material-ui/core": {
- "singleton": true
- },
- "@material-ui/icons": {
- "singleton": true
- },
- "@material-ui/lab": {
- "singleton": true
- },
- "nbdime": {
- "bundled": false,
- "singleton": true
- },
- "nbdime-jupyterlab": {
- "bundled": false,
- "singleton": true
- }
},
- "outputDir": "jupyterlab_git/labextension"
- },
- "eslintConfig": {
- "extends": [
- "eslint:recommended",
- "plugin:@typescript-eslint/eslint-recommended",
- "plugin:@typescript-eslint/recommended",
- "plugin:prettier/recommended"
+ "eslintIgnore": [
+ "node_modules",
+ "dist",
+ "coverage",
+ "**/*.d.ts",
+ "tests",
+ "**/__tests__",
+ "ui-tests"
],
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "project": "tsconfig.json",
- "sourceType": "module"
+ "prettier": {
+ "singleQuote": true,
+ "trailingComma": "none",
+ "arrowParens": "avoid",
+ "endOfLine": "auto",
+ "overrides": [
+ {
+ "files": "package.json",
+ "options": {
+ "tabWidth": 4
+ }
+ }
+ ]
},
- "plugins": [
- "@typescript-eslint"
- ],
- "rules": {
- "@typescript-eslint/naming-convention": [
- "error",
- {
- "selector": "interface",
- "format": [
- "PascalCase"
- ],
- "custom": {
- "regex": "^I[A-Z]",
- "match": true
- }
- }
- ],
- "@typescript-eslint/no-unused-vars": [
- "warn",
- {
- "args": "none"
- }
- ],
- "@typescript-eslint/no-explicit-any": "off",
- "@typescript-eslint/no-namespace": "off",
- "@typescript-eslint/no-use-before-define": "off",
- "@typescript-eslint/quotes": [
- "error",
- "single",
- {
- "avoidEscape": true,
- "allowTemplateLiterals": false
- }
- ],
- "curly": [
- "error",
- "all"
- ],
- "eqeqeq": "error",
- "prefer-arrow-callback": "error"
- }
- },
- "eslintIgnore": [
- "node_modules",
- "dist",
- "coverage",
- "**/*.d.ts",
- "tests",
- "**/__tests__",
- "ui-tests"
- ],
- "prettier": {
- "singleQuote": true,
- "trailingComma": "none",
- "arrowParens": "avoid",
- "endOfLine": "auto",
- "overrides": [
- {
- "files": "package.json",
- "options": {
- "tabWidth": 4
+ "stylelint": {
+ "extends": [
+ "stylelint-config-recommended",
+ "stylelint-config-standard",
+ "stylelint-prettier/recommended"
+ ],
+ "plugins": [
+ "stylelint-csstree-validator"
+ ],
+ "rules": {
+ "csstree/validator": true,
+ "property-no-vendor-prefix": null,
+ "selector-class-pattern": null,
+ "selector-no-vendor-prefix": null,
+ "value-no-vendor-prefix": null
}
- }
- ]
- },
- "stylelint": {
- "extends": [
- "stylelint-config-recommended",
- "stylelint-config-standard",
- "stylelint-prettier/recommended"
- ],
- "plugins": [
- "stylelint-csstree-validator"
- ],
- "rules": {
- "csstree/validator": true,
- "property-no-vendor-prefix": null,
- "selector-no-vendor-prefix": null,
- "value-no-vendor-prefix": null
}
- }
}
diff --git a/src/commandsAndMenu.tsx b/src/commandsAndMenu.tsx
index ff55ba290..283048d94 100644
--- a/src/commandsAndMenu.tsx
+++ b/src/commandsAndMenu.tsx
@@ -5,17 +5,21 @@ import {
MainAreaWidget,
ReactWidget,
showDialog,
- showErrorMessage,
- Toolbar,
- ToolbarButton
+ showErrorMessage
} from '@jupyterlab/apputils';
+import { CodeEditor } from '@jupyterlab/codeeditor';
import { PathExt, URLExt } from '@jupyterlab/coreutils';
import { FileBrowser, FileBrowserModel } from '@jupyterlab/filebrowser';
import { Contents } from '@jupyterlab/services';
import { ISettingRegistry } from '@jupyterlab/settingregistry';
import { ITerminal } from '@jupyterlab/terminal';
import { ITranslator, TranslationBundle } from '@jupyterlab/translation';
-import { closeIcon, ContextMenuSvg } from '@jupyterlab/ui-components';
+import {
+ closeIcon,
+ ContextMenuSvg,
+ Toolbar,
+ ToolbarButton
+} from '@jupyterlab/ui-components';
import { ArrayExt } from '@lumino/algorithm';
import { CommandRegistry } from '@lumino/commands';
import { PromiseDelegate } from '@lumino/coreutils';
@@ -121,6 +125,7 @@ function pluralizedContextLabel(singular: string, plural: string) {
export function addCommands(
app: JupyterFrontEnd,
gitModel: GitExtension,
+ editorFactory: CodeEditor.Factory,
fileBrowserModel: FileBrowserModel,
settings: ISettingRegistry.ISettings,
translator: ITranslator
@@ -543,7 +548,9 @@ export function addCommands(
);
const buildDiffWidget =
- getDiffProvider(fullPath) ?? (isText && createPlainTextDiff);
+ getDiffProvider(fullPath) ??
+ (isText &&
+ (options => createPlainTextDiff({ ...options, editorFactory })));
if (buildDiffWidget) {
const id = `git-diff-${fullPath}-${model.reference.label}-${model.challenger.label}`;
@@ -593,11 +600,11 @@ export function addCommands(
// Create the diff widget
try {
- const widget = await buildDiffWidget(
+ const widget = await buildDiffWidget({
model,
- diffWidget.toolbar,
+ toolbar: diffWidget.toolbar,
translator
- );
+ });
diffWidget.toolbar.addItem('spacer', Toolbar.createSpacerItem());
diff --git a/src/components/diff/ImageDiff.tsx b/src/components/diff/ImageDiff.tsx
index df7067a67..c4e38666a 100644
--- a/src/components/diff/ImageDiff.tsx
+++ b/src/components/diff/ImageDiff.tsx
@@ -1,32 +1,26 @@
+import { ReactWidget } from '@jupyterlab/apputils';
import { Contents } from '@jupyterlab/services';
+import { nullTranslator, TranslationBundle } from '@jupyterlab/translation';
import { PromiseDelegate } from '@lumino/coreutils';
import { Panel } from '@lumino/widgets';
-import { ReactWidget } from '@jupyterlab/apputils';
-
+import Slider, { SliderProps } from '@mui/material/Slider';
+import { styled } from '@mui/material/styles';
+import Tab from '@mui/material/Tab';
+import Tabs from '@mui/material/Tabs';
+import { filesize } from 'filesize';
import * as React from 'react';
import {
- useState,
useCallback,
- useRef,
+ useEffect,
useLayoutEffect,
- useEffect
+ useRef,
+ useState
} from 'react';
-import Slider from '@mui/material/Slider';
-import { styled } from '@mui/material/styles';
-import Tabs from '@mui/material/Tabs';
-import Tab from '@mui/material/Tab';
-
-import { Git } from '../../tokens';
-import {
- ITranslator,
- nullTranslator,
- TranslationBundle
-} from '@jupyterlab/translation';
-import { Toolbar } from '@jupyterlab/apputils';
-
import {
challengerImageClass,
challengerLabelClass,
+ emptyChallImage,
+ emptyRefImage,
imageCol,
imageDiffWidgetClass,
labelsClass,
@@ -37,28 +31,26 @@ import {
onionSkinReferenceImage,
referenceImageClass,
referenceLabelClass,
+ slider,
sliderChallengerCircle,
sliderReferenceCircle,
swipeBackground,
swipeChallengerImage,
swipeContainer,
+ swipeImage,
swipeReferenceImage,
- slider,
tabClass,
tabIndicatorClass,
tabsClass,
- twoUpView,
- swipeImage,
- emptyRefImage,
- emptyChallImage
+ twoUpView
} from '../../style/ImageDiffStyle';
-import { filesize } from 'filesize';
+import { Git } from '../../tokens';
-export const createImageDiff: Git.Diff.ICallback = async (
- model: Git.Diff.IModel,
- toolbar?: Toolbar,
- translator?: ITranslator
-): Promise