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 => { +export const createImageDiff: Git.Diff.Factory = async ({ + model, + toolbar, + translator +}): Promise => { const widget = new ImageDiffWidget( model, (translator ?? nullTranslator).load('jupyterlab_git') @@ -270,12 +262,7 @@ const TwoUp = ({ reference, challenger, fileType }: ImageDiffViewProps) => { ); }; -type SliderProps = { - value: number; - onChange: ( - event: React.ChangeEvent, - newValue: number | number[] - ) => void; +type SliderProps_ = Pick & { width: number; reversed?: boolean; }; @@ -287,7 +274,7 @@ const CustomMUISlider = styled(Slider)({ } }); -const Slider_ = ({ value, onChange, width, reversed }: SliderProps) => { +const Slider_ = ({ value, onChange, width, reversed }: SliderProps_) => { const circleClasses = reversed ? [sliderChallengerCircle, sliderReferenceCircle] : [sliderReferenceCircle, sliderChallengerCircle]; @@ -312,10 +299,7 @@ const Swipe = ({ reference, challenger, fileType }: ImageDiffViewProps) => { const referenceImageRef = useRef(null); const challengerImageRef = useRef(null); - const handleSliderChange = ( - event: React.ChangeEvent, - newValue: number | number[] - ) => { + const handleSliderChange = (event: Event, newValue: number | number[]) => { if (typeof newValue === 'number') { setSliderValue(newValue); } @@ -377,10 +361,7 @@ const OnionSkin = ({ reference, challenger, fileType }: ImageDiffViewProps) => { const referenceImageRef = useRef(null); const challengerImageRef = useRef(null); - const handleSliderChange = ( - event: React.ChangeEvent, - newValue: number | number[] - ) => { + const handleSliderChange = (event: Event, newValue: number | number[]) => { if (typeof newValue === 'number') { setSliderValue(newValue); } diff --git a/src/components/diff/NotebookDiff.ts b/src/components/diff/NotebookDiff.ts index 71e0d5ac4..9566afb1f 100644 --- a/src/components/diff/NotebookDiff.ts +++ b/src/components/diff/NotebookDiff.ts @@ -5,31 +5,26 @@ /* eslint-disable no-inner-declarations */ -import { Toolbar } from '@jupyterlab/apputils'; -import { Contents } from '@jupyterlab/services'; import { INotebookContent } from '@jupyterlab/nbformat'; import { IRenderMimeRegistry } from '@jupyterlab/rendermime'; +import { Contents } from '@jupyterlab/services'; +import { nullTranslator, TranslationBundle } from '@jupyterlab/translation'; import { PromiseDelegate } from '@lumino/coreutils'; import { Message } from '@lumino/messaging'; import { Panel, Widget } from '@lumino/widgets'; import { IDiffEntry } from 'nbdime/lib/diff/diffentries'; -import { IMergeDecision } from 'nbdime/lib/merge/decisions'; -import { NotebookMergeModel } from 'nbdime/lib/merge/model'; -import { CELLMERGE_CLASS, NotebookMergeWidget } from 'nbdime/lib/merge/widget'; -import { UNCHANGED_MERGE_CLASS } from 'nbdime/lib/merge/widget/common'; import { NotebookDiffModel } from 'nbdime/lib/diff/model'; import { CELLDIFF_CLASS, NotebookDiffWidget } from 'nbdime/lib/diff/widget'; import { CHUNK_PANEL_CLASS, UNCHANGED_DIFF_CLASS } from 'nbdime/lib/diff/widget/common'; +import { IMergeDecision } from 'nbdime/lib/merge/decisions'; +import { NotebookMergeModel } from 'nbdime/lib/merge/model'; +import { CELLMERGE_CLASS, NotebookMergeWidget } from 'nbdime/lib/merge/widget'; +import { UNCHANGED_MERGE_CLASS } from 'nbdime/lib/merge/widget/common'; import { requestAPI } from '../../git'; import { Git } from '../../tokens'; -import { - ITranslator, - nullTranslator, - TranslationBundle -} from '@jupyterlab/translation'; /** * Class of the outermost widget, the draggable tab @@ -79,12 +74,14 @@ interface INbdimeMergeDiff { * @param toolbar MainAreaWidget toolbar * @returns Diff notebook widget */ -export const createNotebookDiff = async ( - model: Git.Diff.IModel, - renderMime: IRenderMimeRegistry, - toolbar?: Toolbar, - translator?: ITranslator -): Promise => { +export const createNotebookDiff = async ({ + model, + renderMime, + toolbar, + translator +}: Git.Diff.IFactoryOptions & { + renderMime: IRenderMimeRegistry; +}): Promise => { // Create the notebook diff view const trans = (translator ?? nullTranslator).load('jupyterlab_git'); const diffWidget = new NotebookDiff(model, renderMime, trans); diff --git a/src/components/diff/PlainTextDiff.ts b/src/components/diff/PlainTextDiff.ts index 1098e955c..8bf626828 100644 --- a/src/components/diff/PlainTextDiff.ts +++ b/src/components/diff/PlainTextDiff.ts @@ -1,13 +1,15 @@ -import { Toolbar } from '@jupyterlab/apputils'; -import { EditorLanguageRegistry } from '@jupyterlab/codemirror'; -import { Contents } from '@jupyterlab/services'; +import { CodeEditor } from '@jupyterlab/codeeditor'; import { - ITranslator, - nullTranslator, - TranslationBundle -} from '@jupyterlab/translation'; + CodeMirrorEditorFactory, + EditorExtensionRegistry, + EditorLanguageRegistry +} from '@jupyterlab/codemirror'; +import { Contents } from '@jupyterlab/services'; +import { nullTranslator, TranslationBundle } from '@jupyterlab/translation'; import { PromiseDelegate } from '@lumino/coreutils'; import { Widget } from '@lumino/widgets'; +import { createNbdimeMergeView, MergeView } from 'nbdime/lib/common/mergeview'; +import { StringDiffModel } from 'nbdime/lib/diff/model'; import { Git } from '../../tokens'; /** @@ -17,15 +19,19 @@ import { Git } from '../../tokens'; * @param toolbar MainAreaWidget toolbar * @returns PlainText diff widget */ -export const createPlainTextDiff: Git.Diff.ICallback = async ( - model: Git.Diff.IModel, - toolbar?: Toolbar, - translator?: ITranslator -): Promise => { - const widget = new PlainTextDiff( +export const createPlainTextDiff = async ({ + editorFactory, + model, + toolbar, + translator +}: Git.Diff.IFactoryOptions & { + editorFactory?: CodeEditor.Factory; +}): Promise => { + const widget = new PlainTextDiff({ model, - (translator ?? nullTranslator).load('jupyterlab_git') - ); + editorFactory, + trans: (translator ?? nullTranslator).load('jupyterlab_git') + }); await widget.ready; return widget; }; @@ -34,7 +40,15 @@ export const createPlainTextDiff: Git.Diff.ICallback = async ( * Plain Text Diff widget */ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget { - constructor(model: Git.Diff.IModel, translator?: TranslationBundle) { + constructor({ + model, + trans, + editorFactory + }: { + model: Git.Diff.IModel; + editorFactory?: CodeEditor.Factory; + trans?: TranslationBundle; + }) { super({ node: PlainTextDiff.createNode( model.reference.label, @@ -45,47 +59,9 @@ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget { const getReady = new PromiseDelegate(); this._isReady = getReady.promise; this._container = this.node.lastElementChild as HTMLElement; + this._editorFactory = editorFactory ?? createEditorFactory(); this._model = model; - this._trans = translator ?? nullTranslator.load('jupyterlab_git'); - - // The list of internal strings is available at https://codemirror.net/examples/translate/ - this._translations = { - // @codemirror/view - 'Control character': this._trans.__('Control character'), - // @codemirror/commands - 'Selection deleted': this._trans.__('Selection deleted'), - // @codemirror/language - 'Folded lines': this._trans.__('Folded lines'), - 'Unfolded lines': this._trans.__('Unfolded lines'), - to: this._trans.__('to'), - 'folded code': this._trans.__('folded code'), - unfold: this._trans.__('unfold'), - 'Fold line': this._trans.__('Fold line'), - 'Unfold line': this._trans.__('Unfold line'), - // @codemirror/search - 'Go to line': this._trans.__('Go to line'), - go: this._trans.__('go'), - Find: this._trans.__('Find'), - Replace: this._trans.__('Replace'), - next: this._trans.__('next'), - previous: this._trans.__('previous'), - all: this._trans.__('all'), - 'match case': this._trans.__('match case'), - replace: this._trans.__('replace'), - 'replace all': this._trans.__('replace all'), - close: this._trans.__('close'), - 'current match': this._trans.__('current match'), - 'replaced $ matches': this._trans.__('replaced $ matches'), - 'replaced match on line $': this._trans.__('replaced match on line $'), - 'on line': this._trans.__('on line'), - // From https://codemirror.net/5/addon/merge/merge.js - 'Identical text collapsed. Click to expand.': this._trans.__( - 'Identical text collapsed. Click to expand.' - ), - 'Toggle locked scrolling': this._trans.__('Toggle locked scrolling'), - 'Push to left': this._trans.__('Push to left'), - 'Revert chunk': this._trans.__('Revert chunk') - }; + this._trans = trans ?? nullTranslator.load('jupyterlab_git'); // Load file content early Promise.all([ @@ -110,7 +86,7 @@ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget { * Helper to determine if three-way diff should be shown. */ private get _hasConflict(): boolean { - return this._model.hasConflict; + return this._model.hasConflict ?? false; } /** @@ -139,7 +115,7 @@ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget { * and rejects if unable to retrieve. */ getResolvedFile(): Promise> { - const value = this._mergeView?.editor().getValue() ?? null; + const value = this._mergeView?.getMergedValue() ?? null; if (value !== null) { return Promise.resolve({ type: 'file', @@ -164,7 +140,6 @@ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget { this.createDiffView( this._challenger, this._reference, - this._translations, this._languageRegistry, this._hasConflict ? this._base : null ); @@ -192,7 +167,7 @@ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget { try { // Clear all this._container.innerHTML = ''; - this._mergeView = null; + this._mergeView.dispose(); // ENH request content only if it changed if (this._reference !== null) { @@ -206,9 +181,8 @@ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget { } this.createDiffView( - this._challenger, - this._reference, - this._translations, + this._challenger!, + this._reference!, this._languageRegistry, this._hasConflict ? this._base : null ); @@ -249,40 +223,21 @@ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget { protected async createDiffView( challengerContent: string, referenceContent: string, - translations: Record, - languageRegistry: EditorLanguageRegistry, - baseContent?: string + languageRegistry: EditorLanguageRegistry | null = null, + baseContent: string | null = null ): Promise { if (!this._mergeView) { - const mode = - languageRegistry.findByFileName(this._model.filename) || - languageRegistry.findBest(this._model.filename); - - let options: LocalMergeView.IMergeViewEditorConfiguration = { - value: challengerContent, - orig: referenceContent, - mode: mode.mime, - phrases: translations, - ...this.getDefaultOptions() - }; - - // Show three-way diff on merge conflict - // Note: Empty base content ("") is an edge case. - if (baseContent !== null && baseContent !== undefined) { - options = { - ...options, - origLeft: referenceContent, - value: baseContent, - origRight: challengerContent, - readOnly: false, - revertButtons: true - }; - } + const remote = new StringDiffModel( + referenceContent, + challengerContent, + [], + [] + ); - this._mergeView = mergeView( - this._container, - options - ) as MergeView.MergeViewEditor; + this._mergeView = createNbdimeMergeView({ + remote, + factory: this._editorFactory + }); } return Promise.resolve(); @@ -306,27 +261,25 @@ export class PlainTextDiff extends Widget implements Git.Diff.IDiffWidget {

`; } - protected getDefaultOptions(): Partial { - // FIXME add options from settings and connect settings to update options - return { - lineNumbers: true, - theme: 'jupyter', - connect: 'align', - collapseIdentical: true, - readOnly: true, - revertButtons: false - }; - } - protected _container: HTMLElement; + protected _editorFactory: CodeEditor.Factory; protected _isReady: Promise; - protected _mergeView: MergeView.MergeViewEditor; + // @ts-expect-error complex initialization + protected _mergeView: MergeView; protected _model: Git.Diff.IModel; protected _trans: TranslationBundle; - protected _translations: Record; private _reference: string | null = null; private _challenger: string | null = null; private _languageRegistry: EditorLanguageRegistry | null = null; private _base: string | null = null; } + +function createEditorFactory(): CodeEditor.Factory { + const factory = new CodeMirrorEditorFactory({ + extensions: new EditorExtensionRegistry(), + languages: new EditorLanguageRegistry() + }); + + return factory.newInlineEditor.bind(factory); +} diff --git a/src/index.ts b/src/index.ts index 6a953fe7f..3cc1dac14 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,9 +6,9 @@ import { import { Dialog, ICommandPalette, - showErrorMessage, - Toolbar + showErrorMessage } from '@jupyterlab/apputils'; +import { IEditorServices } from '@jupyterlab/codeeditor'; import { IChangedArgs } from '@jupyterlab/coreutils'; import { IDocumentManager } from '@jupyterlab/docmanager'; import { FileBrowserModel, IFileBrowserFactory } from '@jupyterlab/filebrowser'; @@ -46,6 +46,7 @@ const plugin: JupyterFrontEndPlugin = { id: '@jupyterlab/git:plugin', requires: [ ILayoutRestorer, + IEditorServices, IFileBrowserFactory, IRenderMimeRegistry, ISettingRegistry, @@ -68,6 +69,7 @@ export default [plugin, gitCloneCommandPlugin]; async function activate( app: JupyterFrontEnd, restorer: ILayoutRestorer, + editorServices: IEditorServices, factory: IFileBrowserFactory, renderMime: IRenderMimeRegistry, settingRegistry: ISettingRegistry, @@ -176,7 +178,16 @@ async function activate( // Provided we were able to load application settings, create the extension widgets if (settings) { // Add JupyterLab commands - addCommands(app, gitExtension, fileBrowser.model, settings, translator); + addCommands( + app, + gitExtension, + editorServices.factoryService.newInlineEditor.bind( + editorServices.factoryService + ), + fileBrowser.model, + settings, + translator + ); // Create the Git widget sidebar const gitPlugin = new GitWidget( @@ -245,15 +256,14 @@ async function activate( gitExtension.registerDiffProvider( 'Nbdime', ['.ipynb'], - (model: Git.Diff.IModel, toolbar?: Toolbar, translator?: ITranslator) => - createNotebookDiff(model, renderMime, toolbar, translator) + (options: Git.Diff.IFactoryOptions) => + createNotebookDiff({ ...options, renderMime }) ); gitExtension.registerDiffProvider( 'ImageDiff', ['.jpeg', '.jpg', '.png'], - (model: Git.Diff.IModel, toolbar?: Toolbar, translator?: ITranslator) => - createImageDiff(model, toolbar, translator) + createImageDiff ); return gitExtension; diff --git a/src/model.ts b/src/model.ts index 58771466a..1895d6768 100644 --- a/src/model.ts +++ b/src/model.ts @@ -14,7 +14,7 @@ import { decodeStage } from './utils'; const DEFAULT_REFRESH_INTERVAL = 3000; // ms // Available diff providers const DIFF_PROVIDERS: { - [key: string]: { name: string; callback: Git.Diff.ICallback }; + [key: string]: { name: string; factory: Git.Diff.Factory }; } = {}; /** @@ -24,9 +24,9 @@ const DIFF_PROVIDERS: { */ export function getDiffProvider( filename: string -): Git.Diff.ICallback | undefined { +): Git.Diff.Factory | undefined { return DIFF_PROVIDERS[PathExt.extname(filename)?.toLocaleLowerCase() ?? ''] - ?.callback; + ?.factory; } /** @@ -1831,18 +1831,18 @@ export class GitExtension implements IGitExtension { } /** - * Register a new diff provider for specified file types + * Register a new diff provider for specified file extensions * - * @param fileExtensions File type list - * @param callback Callback to use for the provided file types + * @param fileExtensions File extension list + * @param factory Callback to use for the provided file extensions */ registerDiffProvider( name: string, fileExtensions: string[], - callback: Git.Diff.ICallback + factory: Git.Diff.Factory ): void { - fileExtensions.forEach(fileExtension => { - DIFF_PROVIDERS[fileExtension.toLocaleLowerCase()] = { name, callback }; + fileExtensions.forEach(extension => { + DIFF_PROVIDERS[extension] = { name, factory }; }); } diff --git a/src/tokens.ts b/src/tokens.ts index c03cb6b88..7347567af 100644 --- a/src/tokens.ts +++ b/src/tokens.ts @@ -1,8 +1,8 @@ -import { Toolbar } from '@jupyterlab/apputils'; import { IChangedArgs } from '@jupyterlab/coreutils'; import { DocumentRegistry } from '@jupyterlab/docregistry'; import { Contents, ServerConnection } from '@jupyterlab/services'; import { ITranslator } from '@jupyterlab/translation'; +import { Toolbar } from '@jupyterlab/ui-components'; import { JSONObject, ReadonlyJSONObject, Token } from '@lumino/coreutils'; import { IDisposable } from '@lumino/disposable'; import { ISignal } from '@lumino/signaling'; @@ -540,16 +540,15 @@ export interface IGitExtension extends IDisposable { checkRemoteChangeNotified(): Promise; /** - * Register a new diff provider for specified file types + * Register a new diff provider for specified file extensions * - * @param name provider name - * @param fileExtensions File extensions list - * @param callback Callback to use for the provided file types + * @param fileExtensions File extension list + * @param factory Callback to use for the provided file extensions */ registerDiffProvider( name: string, fileExtensions: string[], - callback: Git.Diff.ICallback + factory: Git.Diff.Factory ): void; /** @@ -675,17 +674,31 @@ export namespace Git { refresh(): Promise; } + /** + * Diff widget factory options + */ + export interface IFactoryOptions { + /** + * Diff model + */ + model: IModel; + /** + * Diff widget toolbar + */ + toolbar?: Toolbar; + /** + * Application translator object + */ + translator?: ITranslator; + } + /** * Callback to generate a comparison widget * * The toolbar is the one of the MainAreaWidget in which the diff widget * will be displayed. */ - export type ICallback = ( - model: IModel, - toolbar?: Toolbar, - trans?: ITranslator - ) => Promise; + export type Factory = (options: IFactoryOptions) => Promise; /** * Content and its context for diff diff --git a/tsconfig.json b/tsconfig.json index 532390a14..2629e2a77 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,7 @@ "resolveJsonModule": true, "outDir": "lib", "rootDir": "src", -"skipLibCheck": true, + "skipLibCheck": true, "strict": true, "strictNullChecks": true, "target": "ES2018", diff --git a/yarn.lock b/yarn.lock index c9533d536..b69daec7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -187,7 +187,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.22.5": +"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.22.5": version: 7.22.15 resolution: "@babel/helper-module-imports@npm:7.22.15" dependencies: @@ -1298,7 +1298,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.16.0, @babel/runtime@npm:^7.18.9, @babel/runtime@npm:^7.22.15, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.3, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.16.0, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.18.9, @babel/runtime@npm:^7.22.15, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.3, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7": version: 7.22.15 resolution: "@babel/runtime@npm:7.22.15" dependencies: @@ -1649,6 +1649,25 @@ __metadata: languageName: node linkType: hard +"@emotion/babel-plugin@npm:^11.11.0": + version: 11.11.0 + resolution: "@emotion/babel-plugin@npm:11.11.0" + dependencies: + "@babel/helper-module-imports": ^7.16.7 + "@babel/runtime": ^7.18.3 + "@emotion/hash": ^0.9.1 + "@emotion/memoize": ^0.8.1 + "@emotion/serialize": ^1.1.2 + babel-plugin-macros: ^3.1.0 + convert-source-map: ^1.5.0 + escape-string-regexp: ^4.0.0 + find-root: ^1.1.0 + source-map: ^0.5.7 + stylis: 4.2.0 + checksum: 6b363edccc10290f7a23242c06f88e451b5feb2ab94152b18bb8883033db5934fb0e421e2d67d09907c13837c21218a3ac28c51707778a54d6cd3706c0c2f3f9 + languageName: node + linkType: hard + "@emotion/cache@npm:^11.11.0": version: 11.11.0 resolution: "@emotion/cache@npm:11.11.0" @@ -1669,7 +1688,7 @@ __metadata: languageName: node linkType: hard -"@emotion/is-prop-valid@npm:^1.1.0": +"@emotion/is-prop-valid@npm:^1.1.0, @emotion/is-prop-valid@npm:^1.2.1": version: 1.2.1 resolution: "@emotion/is-prop-valid@npm:1.2.1" dependencies: @@ -1685,6 +1704,40 @@ __metadata: languageName: node linkType: hard +"@emotion/react@npm:^11.10.6": + version: 11.11.1 + resolution: "@emotion/react@npm:11.11.1" + dependencies: + "@babel/runtime": ^7.18.3 + "@emotion/babel-plugin": ^11.11.0 + "@emotion/cache": ^11.11.0 + "@emotion/serialize": ^1.1.2 + "@emotion/use-insertion-effect-with-fallbacks": ^1.0.1 + "@emotion/utils": ^1.2.1 + "@emotion/weak-memoize": ^0.3.1 + hoist-non-react-statics: ^3.3.1 + peerDependencies: + react: ">=16.8.0" + peerDependenciesMeta: + "@types/react": + optional: true + checksum: aec3c36650f5f0d3d4445ff44d73dd88712b1609645b6af3e6d08049cfbc51f1785fe13dea1a1d4ab1b0800d68f2339ab11e459687180362b1ef98863155aae5 + languageName: node + linkType: hard + +"@emotion/serialize@npm:^1.1.2": + version: 1.1.2 + resolution: "@emotion/serialize@npm:1.1.2" + dependencies: + "@emotion/hash": ^0.9.1 + "@emotion/memoize": ^0.8.1 + "@emotion/unitless": ^0.8.1 + "@emotion/utils": ^1.2.1 + csstype: ^3.0.2 + checksum: 413c352e657f1b5e27ea6437b3ef7dcc3860669b7ae17fd5c18bfbd44e033af1acc56b64d252284a813ca4f3b3e1b0841c42d3fb08e02d2df56fd3cd63d72986 + languageName: node + linkType: hard + "@emotion/sheet@npm:^1.2.2": version: 1.2.2 resolution: "@emotion/sheet@npm:1.2.2" @@ -1692,6 +1745,42 @@ __metadata: languageName: node linkType: hard +"@emotion/styled@npm:^11.10.6": + version: 11.11.0 + resolution: "@emotion/styled@npm:11.11.0" + dependencies: + "@babel/runtime": ^7.18.3 + "@emotion/babel-plugin": ^11.11.0 + "@emotion/is-prop-valid": ^1.2.1 + "@emotion/serialize": ^1.1.2 + "@emotion/use-insertion-effect-with-fallbacks": ^1.0.1 + "@emotion/utils": ^1.2.1 + peerDependencies: + "@emotion/react": ^11.0.0-rc.0 + react: ">=16.8.0" + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 904f641aad3892c65d7d6c0808b036dae1e6d6dad4861c1c7dc0baa59977047c6cad220691206eba7b4059f1a1c6e6c1ef4ebb8c829089e280fa0f2164a01e6b + languageName: node + linkType: hard + +"@emotion/unitless@npm:^0.8.1": + version: 0.8.1 + resolution: "@emotion/unitless@npm:0.8.1" + checksum: 385e21d184d27853bb350999471f00e1429fa4e83182f46cd2c164985999d9b46d558dc8b9cc89975cb337831ce50c31ac2f33b15502e85c299892e67e7b4a88 + languageName: node + linkType: hard + +"@emotion/use-insertion-effect-with-fallbacks@npm:^1.0.1": + version: 1.0.1 + resolution: "@emotion/use-insertion-effect-with-fallbacks@npm:1.0.1" + peerDependencies: + react: ">=16.8.0" + checksum: 700b6e5bbb37a9231f203bb3af11295eed01d73b2293abece0bc2a2237015e944d7b5114d4887ad9a79776504aa51ed2a8b0ddbc117c54495dd01a6b22f93786 + languageName: node + linkType: hard + "@emotion/utils@npm:^1.2.1": version: 1.2.1 resolution: "@emotion/utils@npm:1.2.1" @@ -2515,9 +2604,12 @@ __metadata: dependencies: "@babel/core": ^7.0.0 "@babel/preset-env": ^7.0.0 + "@emotion/react": ^11.10.6 + "@emotion/styled": ^11.10.6 "@jupyterlab/application": ^4.0.6 "@jupyterlab/apputils": ^4.1.6 "@jupyterlab/builder": ^4.0.0 + "@jupyterlab/codeeditor": ^4.0.6 "@jupyterlab/codemirror": ^4.0.6 "@jupyterlab/console": ^4.0.6 "@jupyterlab/coreutils": ^6.0.6 @@ -3810,6 +3902,13 @@ __metadata: languageName: node linkType: hard +"@types/parse-json@npm:^4.0.0": + version: 4.0.0 + resolution: "@types/parse-json@npm:4.0.0" + checksum: fd6bce2b674b6efc3db4c7c3d336bd70c90838e8439de639b909ce22f3720d21344f52427f1d9e57b265fcb7f6c018699b99e5e0c208a1a4823014269a6bf35b + languageName: node + linkType: hard + "@types/prop-types@npm:*, @types/prop-types@npm:^15.7.5": version: 15.7.6 resolution: "@types/prop-types@npm:15.7.6" @@ -4723,6 +4822,17 @@ __metadata: languageName: node linkType: hard +"babel-plugin-macros@npm:^3.1.0": + version: 3.1.0 + resolution: "babel-plugin-macros@npm:3.1.0" + dependencies: + "@babel/runtime": ^7.12.5 + cosmiconfig: ^7.0.0 + resolve: ^1.19.0 + checksum: 765de4abebd3e4688ebdfbff8571ddc8cd8061f839bb6c3e550b0344a4027b04c60491f843296ce3f3379fb356cc873d57a9ee6694262547eb822c14a25be9a6 + languageName: node + linkType: hard + "babel-plugin-polyfill-corejs2@npm:^0.4.5": version: 0.4.5 resolution: "babel-plugin-polyfill-corejs2@npm:0.4.5" @@ -5322,7 +5432,7 @@ __metadata: languageName: node linkType: hard -"convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": +"convert-source-map@npm:^1.5.0, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": version: 1.9.0 resolution: "convert-source-map@npm:1.9.0" checksum: dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 @@ -5345,6 +5455,19 @@ __metadata: languageName: node linkType: hard +"cosmiconfig@npm:^7.0.0": + version: 7.1.0 + resolution: "cosmiconfig@npm:7.1.0" + dependencies: + "@types/parse-json": ^4.0.0 + import-fresh: ^3.2.1 + parse-json: ^5.0.0 + path-type: ^4.0.0 + yaml: ^1.10.0 + checksum: c53bf7befc1591b2651a22414a5e786cd5f2eeaa87f3678a3d49d6069835a9d8d1aef223728e98aa8fec9a95bf831120d245096db12abe019fecb51f5696c96f + languageName: node + linkType: hard + "cosmiconfig@npm:^8.2.0": version: 8.2.0 resolution: "cosmiconfig@npm:8.2.0" @@ -6488,7 +6611,7 @@ __metadata: languageName: node linkType: hard -"find-root@npm:^1.0.0": +"find-root@npm:^1.0.0, find-root@npm:^1.1.0": version: 1.1.0 resolution: "find-root@npm:1.1.0" checksum: b2a59fe4b6c932eef36c45a048ae8f93c85640212ebe8363164814990ee20f154197505965f3f4f102efc33bfb1cbc26fd17c4a2fc739ebc51b886b137cbefaf @@ -6955,7 +7078,7 @@ __metadata: languageName: node linkType: hard -"hoist-non-react-statics@npm:^3.3.2": +"hoist-non-react-statics@npm:^3.3.1, hoist-non-react-statics@npm:^3.3.2": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" dependencies: @@ -10357,7 +10480,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.20.0": +"resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.19.0, resolve@npm:^1.20.0": version: 1.22.6 resolution: "resolve@npm:1.22.6" dependencies: @@ -10383,7 +10506,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin": +"resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.19.0#~builtin, resolve@patch:resolve@^1.20.0#~builtin": version: 1.22.6 resolution: "resolve@patch:resolve@npm%3A1.22.6#~builtin::version=1.22.6&hash=c3c19d" dependencies: @@ -10873,6 +10996,13 @@ __metadata: languageName: node linkType: hard +"source-map@npm:^0.5.7": + version: 0.5.7 + resolution: "source-map@npm:0.5.7" + checksum: 5dc2043b93d2f194142c7f38f74a24670cd7a0063acdaf4bf01d2964b402257ae843c2a8fa822ad5b71013b5fcafa55af7421383da919752f22ff488bc553f4d + languageName: node + linkType: hard + "source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.1": version: 0.6.1 resolution: "source-map@npm:0.6.1" @@ -12347,6 +12477,13 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^1.10.0": + version: 1.10.2 + resolution: "yaml@npm:1.10.2" + checksum: ce4ada136e8a78a0b08dc10b4b900936912d15de59905b2bf415b4d33c63df1d555d23acb2a41b23cf9fb5da41c256441afca3d6509de7247daa062fd2c5ea5f + languageName: node + linkType: hard + "yaml@npm:^2.2.2": version: 2.3.1 resolution: "yaml@npm:2.3.1"