Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #53 from afshin/jupyterlab-2
Browse files Browse the repository at this point in the history
Support JupyterLab 2 beta
  • Loading branch information
afshin authored Dec 31, 2019
2 parents 6fce32c + 0c46208 commit d320dc1
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 40 deletions.
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupyterlab/shortcutui",
"version": "0.4.0",
"version": "0.5.0-beta.1",
"description": "A JupyterLab extension for managing keyboard shortcuts",
"author": "Jenna Landy, Noah Stapp, and Alena Mueller",
"keywords": [
Expand Down Expand Up @@ -30,29 +30,30 @@
"watch": "tsc -w"
},
"dependencies": {
"@jupyterlab/application": "^1.1.0",
"@jupyterlab/apputils": "^1.0.1",
"@jupyterlab/coreutils": "^3.1.0",
"@jupyterlab/mainmenu": "^1.1.0",
"@phosphor/domutils": "^1.1.3",
"@phosphor/keyboard": "^1.1.3",
"@phosphor/widgets": "^1.9.0",
"react": "~16.8.4",
"@jupyterlab/application": "^2.0.0-alpha.4",
"@jupyterlab/apputils": "^2.0.0-alpha.4",
"@jupyterlab/coreutils": "^4.0.0-alpha.4",
"@jupyterlab/mainmenu": "^2.0.0-alpha.4",
"@jupyterlab/settingregistry": "^2.0.0-beta.1",
"@lumino/domutils": "^1.1.6",
"@lumino/keyboard": "^1.1.5",
"@lumino/widgets": "^1.9.4",
"react": "~16.9.0",
"typestyle": "^2.0.4"
},
"devDependencies": {
"@types/react": "~16.8.18",
"@types/react-dom": "~16.8.4",
"prettier": "^1.18.2",
"@types/react": "~16.9.11",
"@types/react-dom": "~16.9.4",
"prettier": "^1.19.1",
"rimraf": "^3.0.0",
"tslint": "^5.18.0",
"tslint": "^5.20.1",
"tslint-plugin-prettier": "^2.0.1",
"typescript": "~3.6.2"
"typescript": "~3.7.3"
},
"jupyterlab": {
"extension": true
},
"resolutions": {
"@types/react": "~16.8.4"
"@types/react": "^16.9.11"
}
}
15 changes: 8 additions & 7 deletions src/ShortcutWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { VDomRenderer, VDomModel } from '@jupyterlab/apputils';

import * as React from 'react';
import { ISettingRegistry } from '@jupyterlab/settingregistry';

import { ShortcutUI } from './components/ShortcutUI';
import { CommandRegistry } from '@lumino/commands';

import { ISettingRegistry } from '@jupyterlab/coreutils';
import { IDisposable } from '@lumino/disposable';

import { CommandRegistry } from '@phosphor/commands';
import { Widget, Title, Menu } from '@lumino/widgets';

import { Widget, Title, Menu } from '@phosphor/widgets';
import * as React from 'react';

import * as ReactDOM from 'react-dom';
import { IDisposable } from '@phosphor/disposable';

import { ShortcutUI } from './components/ShortcutUI';

/** All external actions, setting commands, getting command list ... */
export interface IShortcutUIexternal {
Expand All @@ -37,7 +38,7 @@ export default class ShortcutWidget extends VDomRenderer<VDomModel> {
reactComponent: React.ReactElement<any>;

constructor(external: IShortcutUIexternal) {
super();
super(undefined);
this.height = -1;
this.width = -1;
this.external = external;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ShortcutInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from 'react';

import { classes } from 'typestyle';

import { EN_US } from '@phosphor/keyboard';
import { EN_US } from '@lumino/keyboard';

import {
InputStyle,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ShortcutItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ShortcutObject, ErrorObject, TakenByObject } from '../index';

import { ShortcutInput } from './ShortcutInput';

import { Platform } from '@phosphor/domutils';
import { Platform } from '@lumino/domutils';

import { classes } from 'typestyle';

Expand Down
19 changes: 10 additions & 9 deletions src/components/ShortcutUI.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import { ISettingRegistry } from '@jupyterlab/coreutils';
import { ISettingRegistry } from '@jupyterlab/settingregistry';

import { ArrayExt, StringExt } from '@phosphor/algorithm';
import { ArrayExt, StringExt } from '@lumino/algorithm';

import { ShortcutList } from './ShortcutList';
import { ReadonlyJSONArray } from '@lumino/coreutils';

import { TopNav } from './TopNav';
import {
TopWhitespaceStyle,
ShortcutUIStyle
} from '../componentStyle/ShortcutUIStyle';

import { ShortcutObject, ErrorObject, TakenByObject } from '../index';

import { IShortcutUIexternal } from '../ShortcutWidget';

import {
TopWhitespaceStyle,
ShortcutUIStyle
} from '../componentStyle/ShortcutUIStyle';
import { ShortcutList } from './ShortcutList';

import { TopNav } from './TopNav';

import * as React from 'react';
import { ReadonlyJSONArray } from '@phosphor/coreutils';

const enum MatchType {
Label,
Expand Down
8 changes: 5 additions & 3 deletions src/components/TopNav.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Menu } from '@lumino/widgets';

import * as React from 'react';

import { classes } from 'typestyle';

import { Menu } from '@phosphor/widgets';
import { CellStyle } from '../componentStyle/ShortcutItemStyle';

import {
TopStyle,
Expand All @@ -23,10 +25,10 @@ import {
controlIconStyle
} from '../componentStyle/TopNavStyle';

import { CellStyle } from '../componentStyle/ShortcutItemStyle';
import { IShortcutUIexternal } from '../ShortcutWidget';

import { ShortcutTitleItem } from './ShortcutTitleItem';
import { IShortcutUIexternal } from '../ShortcutWidget';

import { UISize } from './ShortcutUI';

export interface IAdvancedOptionsProps {
Expand Down
9 changes: 5 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import {
JupyterFrontEnd
} from '@jupyterlab/application';

import { ISettingRegistry } from '@jupyterlab/coreutils';

import {
ICommandPalette,
MainAreaWidget,
Expand All @@ -14,12 +12,15 @@ import {

import { IMainMenu } from '@jupyterlab/mainmenu';

import { Widget, Menu } from '@phosphor/widgets';
import { ISettingRegistry } from '@jupyterlab/settingregistry';

import { CommandRegistry } from '@lumino/commands';

import { Widget, Menu } from '@lumino/widgets';

import ShortcutWidget, { IShortcutUIexternal } from './ShortcutWidget';

import '../style/variables.css';
import { CommandRegistry } from '@phosphor/commands';

/** Object for shortcut items */
export class ShortcutObject {
Expand Down

0 comments on commit d320dc1

Please sign in to comment.