@jupyterlab/shortcuts-extension 3.3.0-alpha.9 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/lib/componentStyle/ShortcutButtonStyle.d.ts +2 -0
  2. package/lib/componentStyle/ShortcutButtonStyle.js +41 -0
  3. package/lib/componentStyle/ShortcutButtonStyle.js.map +1 -0
  4. package/lib/componentStyle/ShortcutInputStyle.d.ts +11 -0
  5. package/lib/componentStyle/ShortcutInputStyle.js +98 -0
  6. package/lib/componentStyle/ShortcutInputStyle.js.map +1 -0
  7. package/lib/componentStyle/ShortcutItemStyle.d.ts +18 -0
  8. package/lib/componentStyle/ShortcutItemStyle.js +179 -0
  9. package/lib/componentStyle/ShortcutItemStyle.js.map +1 -0
  10. package/lib/componentStyle/ShortcutListStyle.d.ts +2 -0
  11. package/lib/componentStyle/ShortcutListStyle.js +16 -0
  12. package/lib/componentStyle/ShortcutListStyle.js.map +1 -0
  13. package/lib/componentStyle/ShortcutTitleItemStyle.d.ts +3 -0
  14. package/lib/componentStyle/ShortcutTitleItemStyle.js +34 -0
  15. package/lib/componentStyle/ShortcutTitleItemStyle.js.map +1 -0
  16. package/lib/componentStyle/ShortcutUIStyle.d.ts +2 -0
  17. package/lib/componentStyle/ShortcutUIStyle.js +21 -0
  18. package/lib/componentStyle/ShortcutUIStyle.js.map +1 -0
  19. package/lib/componentStyle/TopNavStyle.d.ts +18 -0
  20. package/lib/componentStyle/TopNavStyle.js +138 -0
  21. package/lib/componentStyle/TopNavStyle.js.map +1 -0
  22. package/lib/components/ShortcutInput.d.ts +78 -0
  23. package/lib/components/ShortcutInput.js +342 -0
  24. package/lib/components/ShortcutInput.js.map +1 -0
  25. package/lib/components/ShortcutItem.d.ts +64 -0
  26. package/lib/components/ShortcutItem.js +275 -0
  27. package/lib/components/ShortcutItem.js.map +1 -0
  28. package/lib/components/ShortcutList.d.ts +25 -0
  29. package/lib/components/ShortcutList.js +14 -0
  30. package/lib/components/ShortcutList.js.map +1 -0
  31. package/lib/components/ShortcutTitleItem.d.ts +9 -0
  32. package/lib/components/ShortcutTitleItem.js +13 -0
  33. package/lib/components/ShortcutTitleItem.js.map +1 -0
  34. package/lib/components/ShortcutUI.d.ts +61 -0
  35. package/lib/components/ShortcutUI.js +361 -0
  36. package/lib/components/ShortcutUI.js.map +1 -0
  37. package/lib/components/TopNav.d.ts +52 -0
  38. package/lib/components/TopNav.js +143 -0
  39. package/lib/components/TopNav.js.map +1 -0
  40. package/lib/components/index.d.ts +2 -0
  41. package/lib/components/index.js +2 -0
  42. package/lib/components/index.js.map +1 -0
  43. package/lib/index.js +23 -1
  44. package/lib/index.js.map +1 -1
  45. package/lib/renderer.d.ts +5 -0
  46. package/lib/renderer.js +6 -0
  47. package/lib/renderer.js.map +1 -0
  48. package/package.json +22 -10
  49. package/style/index.css +8 -0
  50. package/style/index.js +8 -0
@@ -0,0 +1,275 @@
1
+ import { Platform } from '@lumino/domutils';
2
+ import * as React from 'react';
3
+ import { classes } from 'typestyle';
4
+ import { CellStyle, CommaStyle, ConflictContainerStyle, EmptyShortcutCellStyle, ErrorButtonStyle, ErrorMessageStyle, OrStyle, OrTwoStyle, PlusStyle, ResetStyle, RowStyle, ShortcutCellStyle, ShortcutContainerStyle, ShortcutKeysContainerStyle, ShortcutKeysStyle, SingleShortcutCellStyle, SourceCellStyle } from '../componentStyle/ShortcutItemStyle';
5
+ import { ShortcutInput } from './ShortcutInput';
6
+ var ShortCutLocation;
7
+ (function (ShortCutLocation) {
8
+ ShortCutLocation[ShortCutLocation["Left"] = 0] = "Left";
9
+ ShortCutLocation[ShortCutLocation["Right"] = 1] = "Right";
10
+ })(ShortCutLocation || (ShortCutLocation = {}));
11
+ /** Describe commands that are used by shortcuts */
12
+ function getCommands(trans) {
13
+ return {
14
+ shortcutEditLeft: {
15
+ commandId: 'shortcutui:EditLeft',
16
+ label: trans.__('Edit First'),
17
+ caption: trans.__('Edit existing shortcut')
18
+ },
19
+ shortcutEditRight: {
20
+ commandId: 'shortcutui:EditRight',
21
+ label: trans.__('Edit Second'),
22
+ caption: trans.__('Edit existing shortcut')
23
+ },
24
+ shortcutEdit: {
25
+ commandId: 'shortcutui:Edit',
26
+ label: trans.__('Edit'),
27
+ caption: trans.__('Edit existing sortcut')
28
+ },
29
+ shortcutAddNew: {
30
+ commandId: 'shortcutui:AddNew',
31
+ label: trans.__('Add'),
32
+ caption: trans.__('Add new shortcut')
33
+ },
34
+ shortcutAddAnother: {
35
+ commandId: 'shortcutui:AddAnother',
36
+ label: trans.__('Add'),
37
+ caption: trans.__('Add another shortcut')
38
+ },
39
+ shortcutReset: {
40
+ commandId: 'shortcutui:Reset',
41
+ label: trans.__('Reset'),
42
+ caption: trans.__('Reset shortcut back to default')
43
+ }
44
+ };
45
+ }
46
+ /** React component for each command shortcut item */
47
+ export class ShortcutItem extends React.Component {
48
+ constructor(props) {
49
+ super(props);
50
+ /** Toggle display state of input box */
51
+ this.toggleInputNew = () => {
52
+ this.setState({
53
+ displayNewInput: !this.state.displayNewInput
54
+ });
55
+ };
56
+ this.toggleInputReplaceLeft = () => {
57
+ this.setState({
58
+ displayReplaceInputLeft: !this.state.displayReplaceInputLeft
59
+ });
60
+ };
61
+ this.toggleInputReplaceRight = () => {
62
+ this.setState({
63
+ displayReplaceInputRight: !this.state.displayReplaceInputRight
64
+ });
65
+ };
66
+ this.addCommandIfNeeded = (command, action) => {
67
+ const key = this.props.shortcut.commandName + '_' + this.props.shortcut.selector;
68
+ if (!this.props.external.hasCommand(command.commandId + key)) {
69
+ this.props.external.addCommand(command.commandId + key, {
70
+ label: command.label,
71
+ caption: command.caption,
72
+ execute: action
73
+ });
74
+ }
75
+ };
76
+ this.handleRightClick = (e) => {
77
+ this.addCommandIfNeeded(this._commands.shortcutEdit, () => this.toggleInputReplaceLeft());
78
+ this.addCommandIfNeeded(this._commands.shortcutEditLeft, () => this.toggleInputReplaceLeft());
79
+ this.addCommandIfNeeded(this._commands.shortcutEditRight, () => this.toggleInputReplaceRight());
80
+ this.addCommandIfNeeded(this._commands.shortcutAddNew, () => this.toggleInputNew());
81
+ this.addCommandIfNeeded(this._commands.shortcutAddAnother, () => this.toggleInputNew());
82
+ this.addCommandIfNeeded(this._commands.shortcutReset, () => this.props.resetShortcut(this.props.shortcut));
83
+ const key = this.props.shortcut.commandName + '_' + this.props.shortcut.selector;
84
+ this.setState({
85
+ numShortcuts: Object.keys(this.props.shortcut.keys).filter(key => this.props.shortcut.keys[key][0] !== '').length
86
+ }, () => {
87
+ let commandList = [];
88
+ if (this.state.numShortcuts == 2) {
89
+ commandList = commandList.concat([
90
+ this._commands.shortcutEditLeft.commandId + key,
91
+ this._commands.shortcutEditRight.commandId + key
92
+ ]);
93
+ }
94
+ else if (this.state.numShortcuts == 1) {
95
+ commandList = commandList.concat([
96
+ this._commands.shortcutEdit.commandId + key,
97
+ this._commands.shortcutAddAnother.commandId + key
98
+ ]);
99
+ }
100
+ else {
101
+ commandList = commandList.concat([
102
+ this._commands.shortcutAddNew.commandId + key
103
+ ]);
104
+ }
105
+ if (this.props.shortcut.source === 'Custom') {
106
+ commandList = commandList.concat([
107
+ this._commands.shortcutReset.commandId + key
108
+ ]);
109
+ }
110
+ this.props.contextMenu(e, commandList);
111
+ });
112
+ };
113
+ /** Transform special key names into unicode characters */
114
+ this.toSymbols = (value) => {
115
+ return value.split(' ').reduce((result, key) => {
116
+ if (key === 'Ctrl') {
117
+ return (result + ' ⌃').trim();
118
+ }
119
+ else if (key === 'Alt') {
120
+ return (result + ' ⌥').trim();
121
+ }
122
+ else if (key === 'Shift') {
123
+ return (result + ' ⇧').trim();
124
+ }
125
+ else if (key === 'Accel' && Platform.IS_MAC) {
126
+ return (result + ' ⌘').trim();
127
+ }
128
+ else if (key === 'Accel') {
129
+ return (result + ' ⌃').trim();
130
+ }
131
+ else {
132
+ return (result + ' ' + key).trim();
133
+ }
134
+ }, '');
135
+ };
136
+ this._commands = getCommands(props.external.translator.load('jupyterlab'));
137
+ this.state = {
138
+ displayNewInput: false,
139
+ displayReplaceInputLeft: false,
140
+ displayReplaceInputRight: false,
141
+ numShortcuts: Object.keys(this.props.shortcut.keys).filter(key => this.props.shortcut.keys[key][0] !== '').length
142
+ };
143
+ }
144
+ getErrorRow() {
145
+ const trans = this.props.external.translator.load('jupyterlab');
146
+ return (React.createElement("div", { className: classes(RowStyle) },
147
+ React.createElement("div", { className: ConflictContainerStyle(this.props.showSelectors, this.props.errorSize) },
148
+ React.createElement("div", { className: ErrorMessageStyle }, trans.__('Shortcut already in use by %1. Overwrite it?', this.props.shortcut.takenBy.takenByLabel)),
149
+ React.createElement("div", { className: ErrorButtonStyle },
150
+ React.createElement("button", null, trans.__('Cancel')),
151
+ React.createElement("button", { id: "no-blur", onClick: () => {
152
+ var _a;
153
+ (_a = document.getElementById('overwrite')) === null || _a === void 0 ? void 0 : _a.click();
154
+ } }, trans.__('Overwrite'))))));
155
+ }
156
+ getCategoryCell() {
157
+ return React.createElement("div", { className: CellStyle }, this.props.shortcut.category);
158
+ }
159
+ getLabelCell() {
160
+ return (React.createElement("div", { className: CellStyle },
161
+ React.createElement("div", { className: "jp-label" }, this.props.shortcut.label)));
162
+ }
163
+ getResetShortCutLink() {
164
+ const trans = this.props.external.translator.load('jupyterlab');
165
+ return (React.createElement("a", { className: ResetStyle, onClick: () => this.props.resetShortcut(this.props.shortcut) }, trans.__('Reset')));
166
+ }
167
+ getSourceCell() {
168
+ return (React.createElement("div", { className: CellStyle },
169
+ React.createElement("div", { className: SourceCellStyle }, this.props.shortcut.source),
170
+ this.props.shortcut.source === 'Custom' && this.getResetShortCutLink()));
171
+ }
172
+ getOptionalSelectorCell() {
173
+ return this.props.showSelectors ? (React.createElement("div", { className: CellStyle },
174
+ React.createElement("div", { className: "jp-selector" }, this.props.shortcut.selector))) : (React.createElement("div", null));
175
+ }
176
+ getClassNameForShortCuts(nonEmptyKeys) {
177
+ return nonEmptyKeys.length === 0
178
+ ? classes(ShortcutCellStyle, EmptyShortcutCellStyle)
179
+ : nonEmptyKeys.length === 1
180
+ ? classes(ShortcutCellStyle, SingleShortcutCellStyle)
181
+ : ShortcutCellStyle;
182
+ }
183
+ getToggleInputReplaceMethod(location) {
184
+ switch (location) {
185
+ case ShortCutLocation.Left:
186
+ return this.toggleInputReplaceLeft;
187
+ case ShortCutLocation.Right:
188
+ return this.toggleInputReplaceRight;
189
+ }
190
+ }
191
+ getDisplayReplaceInput(location) {
192
+ switch (location) {
193
+ case ShortCutLocation.Left:
194
+ return this.state.displayReplaceInputLeft;
195
+ case ShortCutLocation.Right:
196
+ return this.state.displayReplaceInputRight;
197
+ }
198
+ }
199
+ getOrDiplayIfNeeded(nonEmptyKeys) {
200
+ const trans = this.props.external.translator.load('jupyterlab');
201
+ return (React.createElement("div", { className: nonEmptyKeys.length == 2 || this.state.displayNewInput
202
+ ? OrTwoStyle
203
+ : OrStyle, id: nonEmptyKeys.length == 2
204
+ ? 'secondor'
205
+ : this.state.displayReplaceInputLeft
206
+ ? 'noor'
207
+ : 'or' }, trans.__('or')));
208
+ }
209
+ getShortCutAsInput(key, location) {
210
+ return (React.createElement(ShortcutInput, { handleUpdate: this.props.handleUpdate, deleteShortcut: this.props.deleteShortcut, toggleInput: this.getToggleInputReplaceMethod(location), shortcut: this.props.shortcut, shortcutId: key, toSymbols: this.toSymbols, keyBindingsUsed: this.props.keyBindingsUsed, sortConflict: this.props.sortConflict, clearConflicts: this.props.clearConflicts, displayInput: this.getDisplayReplaceInput(location), newOrReplace: 'replace', placeholder: this.toSymbols(this.props.shortcut.keys[key].join(', ')), translator: this.props.external.translator }));
211
+ }
212
+ getShortCutForDisplayOnly(key) {
213
+ return this.props.shortcut.keys[key].map((keyBinding, index) => (React.createElement("div", { className: ShortcutKeysContainerStyle, key: index },
214
+ React.createElement("div", { className: ShortcutKeysStyle, id: 'shortcut-keys' }, this.toSymbols(keyBinding)),
215
+ index + 1 < this.props.shortcut.keys[key].length ? (React.createElement("div", { className: CommaStyle }, ",")) : null)));
216
+ }
217
+ isLocationBeingEdited(location) {
218
+ return ((location === ShortCutLocation.Left &&
219
+ this.state.displayReplaceInputLeft) ||
220
+ (location === ShortCutLocation.Right &&
221
+ this.state.displayReplaceInputRight));
222
+ }
223
+ getLocationFromIndex(index) {
224
+ return index === 0 ? ShortCutLocation.Left : ShortCutLocation.Right;
225
+ }
226
+ getDivForKey(index, key, nonEmptyKeys) {
227
+ const location = this.getLocationFromIndex(index);
228
+ return (React.createElement("div", { className: ShortcutContainerStyle, key: this.props.shortcut.id + '_' + index, onClick: this.getToggleInputReplaceMethod(location) },
229
+ this.isLocationBeingEdited(location)
230
+ ? this.getShortCutAsInput(key, location)
231
+ : this.getShortCutForDisplayOnly(key),
232
+ location === ShortCutLocation.Left &&
233
+ this.getOrDiplayIfNeeded(nonEmptyKeys)));
234
+ }
235
+ getAddLink() {
236
+ const trans = this.props.external.translator.load('jupyterlab');
237
+ return (React.createElement("a", { className: !this.state.displayNewInput ? PlusStyle : '', onClick: () => {
238
+ this.toggleInputNew(), this.props.clearConflicts();
239
+ }, id: "add-link" }, trans.__('Add')));
240
+ }
241
+ getInputBoxWhenToggled() {
242
+ return this.state.displayNewInput ? (React.createElement(ShortcutInput, { handleUpdate: this.props.handleUpdate, deleteShortcut: this.props.deleteShortcut, toggleInput: this.toggleInputNew, shortcut: this.props.shortcut, shortcutId: "", toSymbols: this.toSymbols, keyBindingsUsed: this.props.keyBindingsUsed, sortConflict: this.props.sortConflict, clearConflicts: this.props.clearConflicts, displayInput: this.state.displayNewInput, newOrReplace: 'new', placeholder: '', translator: this.props.external.translator })) : (React.createElement("div", null));
243
+ }
244
+ getShortCutsCell(nonEmptyKeys) {
245
+ return (React.createElement("div", { className: CellStyle },
246
+ React.createElement("div", { className: this.getClassNameForShortCuts(nonEmptyKeys) },
247
+ nonEmptyKeys.map((key, index) => this.getDivForKey(index, key, nonEmptyKeys)),
248
+ nonEmptyKeys.length === 1 &&
249
+ !this.state.displayNewInput &&
250
+ !this.state.displayReplaceInputLeft &&
251
+ this.getAddLink(),
252
+ nonEmptyKeys.length === 0 &&
253
+ !this.state.displayNewInput &&
254
+ this.getAddLink(),
255
+ this.getInputBoxWhenToggled())));
256
+ }
257
+ render() {
258
+ const nonEmptyKeys = Object.keys(this.props.shortcut.keys).filter((key) => this.props.shortcut.keys[key][0] !== '');
259
+ if (this.props.shortcut.id === 'error_row') {
260
+ return this.getErrorRow();
261
+ }
262
+ else {
263
+ return (React.createElement("div", { className: RowStyle, onContextMenu: e => {
264
+ e.persist();
265
+ this.handleRightClick(e);
266
+ } },
267
+ this.getCategoryCell(),
268
+ this.getLabelCell(),
269
+ this.getShortCutsCell(nonEmptyKeys),
270
+ this.getSourceCell(),
271
+ this.getOptionalSelectorCell()));
272
+ }
273
+ }
274
+ }
275
+ //# sourceMappingURL=ShortcutItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutItem.js","sourceRoot":"","sources":["../../src/components/ShortcutItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,SAAS,EACT,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,aAAa,EAGd,MAAM,iBAAiB,CAAC;AA2BzB,IAAK,gBAGJ;AAHD,WAAK,gBAAgB;IACnB,uDAAI,CAAA;IACJ,yDAAK,CAAA;AACP,CAAC,EAHI,gBAAgB,KAAhB,gBAAgB,QAGpB;AAED,mDAAm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BACE,SAAS,EAAE,QAAQ,EACnB,aAAa,EAAE,CAAC,CAAC,EAAE;oBACjB,CAAC,CAAC,OAAO,EAAE,CAAC;oBACZ,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;gBAC3B,CAAC;gBAEA,IAAI,CAAC,eAAe,EAAE;gBACtB,IAAI,CAAC,YAAY,EAAE;gBACnB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;gBACnC,IAAI,CAAC,aAAa,EAAE;gBACpB,IAAI,CAAC,uBAAuB,EAAE,CAC3B,CACP,CAAC;SACH;IACH,CAAC;CAKF"}
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+ import { ShortcutObject, TakenByObject } from './ShortcutInput';
3
+ import { UISize } from './ShortcutUI';
4
+ import { IShortcutUIexternal } from './TopNav';
5
+ /** Props for ShortcutList component */
6
+ export interface IShortcutListProps {
7
+ shortcuts: ShortcutObject[];
8
+ handleUpdate: Function;
9
+ resetShortcut: Function;
10
+ deleteShortcut: Function;
11
+ showSelectors: boolean;
12
+ keyBindingsUsed: {
13
+ [index: string]: TakenByObject;
14
+ };
15
+ sortConflict: Function;
16
+ clearConflicts: Function;
17
+ height: number;
18
+ errorSize: UISize;
19
+ contextMenu: Function;
20
+ external: IShortcutUIexternal;
21
+ }
22
+ /** React component for list of shortcuts */
23
+ export declare class ShortcutList extends React.Component<IShortcutListProps> {
24
+ render(): JSX.Element;
25
+ }
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { ShortcutListContainerStyle, ShortcutListStyle } from '../componentStyle/ShortcutListStyle';
3
+ import { ShortcutItem } from './ShortcutItem';
4
+ const TOPNAV_HEIGHT = 115;
5
+ /** React component for list of shortcuts */
6
+ export class ShortcutList extends React.Component {
7
+ render() {
8
+ return (React.createElement("div", { className: ShortcutListContainerStyle(TOPNAV_HEIGHT, this.props.height), id: "shortcutListContainer" },
9
+ React.createElement("div", { className: ShortcutListStyle }, this.props.shortcuts.map((shortcut) => {
10
+ return (React.createElement(ShortcutItem, { key: shortcut.commandName + '_' + shortcut.selector, resetShortcut: this.props.resetShortcut, shortcut: shortcut, handleUpdate: this.props.handleUpdate, deleteShortcut: this.props.deleteShortcut, showSelectors: this.props.showSelectors, keyBindingsUsed: this.props.keyBindingsUsed, sortConflict: this.props.sortConflict, clearConflicts: this.props.clearConflicts, errorSize: this.props.errorSize, contextMenu: this.props.contextMenu, external: this.props.external }));
11
+ }))));
12
+ }
13
+ }
14
+ //# sourceMappingURL=ShortcutList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutList.js","sourceRoot":"","sources":["../../src/components/ShortcutList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,MAAM,aAAa,GAAW,GAAG,CAAC;AAkBlC,4CAA4C;AAC5C,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAA6B;IACnE,MAAM;QACJ,OAAO,CACL,6BACE,SAAS,EAAE,0BAA0B,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EACvE,EAAE,EAAC,uBAAuB;YAE1B,6BAAK,SAAS,EAAE,iBAAiB,IAC9B,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAwB,EAAE,EAAE;gBACrD,OAAO,CACL,oBAAC,YAAY,IACX,GAAG,EAAE,QAAQ,CAAC,WAAW,GAAG,GAAG,GAAG,QAAQ,CAAC,QAAQ,EACnD,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EACvC,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EACrC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACzC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EACvC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAC3C,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EACrC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACzC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC7B,CACH,CAAC;YACJ,CAAC,CAAC,CACE,CACF,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ export interface IShortcutTitleItemProps {
3
+ title: string;
4
+ updateSort: Function;
5
+ active: string;
6
+ }
7
+ export declare class ShortcutTitleItem extends React.Component<IShortcutTitleItemProps> {
8
+ render(): JSX.Element;
9
+ }
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { classes } from 'typestyle';
3
+ import { CurrentHeaderStyle, HeaderStyle, SortButtonStyle } from '../componentStyle/ShortcutTitleItemStyle';
4
+ export class ShortcutTitleItem extends React.Component {
5
+ render() {
6
+ return (React.createElement("div", { className: this.props.title.toLowerCase() === this.props.active
7
+ ? classes(HeaderStyle, CurrentHeaderStyle)
8
+ : HeaderStyle, onClick: () => this.props.updateSort(this.props.title.toLowerCase()) },
9
+ this.props.title,
10
+ React.createElement("div", { className: SortButtonStyle }, "\u2303")));
11
+ }
12
+ }
13
+ //# sourceMappingURL=ShortcutTitleItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutTitleItem.js","sourceRoot":"","sources":["../../src/components/ShortcutTitleItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,eAAe,EAChB,MAAM,0CAA0C,CAAC;AAQlD,MAAM,OAAO,iBAAkB,SAAQ,KAAK,CAAC,SAE5C;IACC,MAAM;QACJ,OAAO,CACL,6BACE,SAAS,EACP,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM;gBAClD,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,kBAAkB,CAAC;gBAC1C,CAAC,CAAC,WAAW,EAEjB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YAEnE,IAAI,CAAC,KAAK,CAAC,KAAK;YACjB,6BAAK,SAAS,EAAE,eAAe,aAAS,CACpC,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,61 @@
1
+ import { IShortcutUIexternal } from './TopNav';
2
+ import * as React from 'react';
3
+ import { ShortcutObject, TakenByObject } from './ShortcutInput';
4
+ export declare const enum UISize {
5
+ Regular = 0,
6
+ Small = 1,
7
+ Tiny = 2
8
+ }
9
+ /** Props for ShortcutUI component */
10
+ export interface IShortcutUIProps {
11
+ external: IShortcutUIexternal;
12
+ height: number;
13
+ width: number;
14
+ }
15
+ /** State for ShortcutUI component */
16
+ export interface IShortcutUIState {
17
+ shortcutList: {
18
+ [index: string]: ShortcutObject;
19
+ };
20
+ filteredShortcutList: ShortcutObject[];
21
+ shortcutsFetched: boolean;
22
+ searchQuery: string;
23
+ showSelectors: boolean;
24
+ currentSort: string;
25
+ keyBindingsUsed: {
26
+ [index: string]: TakenByObject;
27
+ };
28
+ contextMenu: any;
29
+ }
30
+ /** Top level React component for widget */
31
+ export declare class ShortcutUI extends React.Component<IShortcutUIProps, IShortcutUIState> {
32
+ constructor(props: any);
33
+ /** Fetch shortcut list on mount */
34
+ componentDidMount(): void;
35
+ /** Fetch shortcut list from SettingRegistry */
36
+ private _refreshShortcutList;
37
+ /** Set the current seach query */
38
+ updateSearchQuery: (event: MouseEvent) => void;
39
+ /** Filter shortcut list using current search query */
40
+ private searchFilterShortcuts;
41
+ /** Reset all shortcuts to their defaults */
42
+ resetShortcuts: () => Promise<void>;
43
+ /** Set new shortcut for command, refresh state */
44
+ handleUpdate: (shortcutObject: ShortcutObject, keys: string[]) => Promise<void>;
45
+ /** Delete shortcut for command, refresh state */
46
+ deleteShortcut: (shortcutObject: ShortcutObject, shortcutId: string) => Promise<void>;
47
+ /** Reset a specific shortcut to its default settings */
48
+ resetShortcut: (shortcutObject: ShortcutObject) => Promise<void>;
49
+ /** Toggles showing command selectors */
50
+ toggleSelectors: () => void;
51
+ /** Set the current list sort order */
52
+ updateSort: (value: string) => void;
53
+ /** Sort shortcut list using current sort property */
54
+ sortShortcuts(): void;
55
+ /** Sort shortcut list so that an error row is right below the one currently being set */
56
+ sortConflict: (newShortcut: ShortcutObject, takenBy: TakenByObject) => void;
57
+ /** Remove conflict flag from all shortcuts */
58
+ clearConflicts: () => void;
59
+ contextMenu: (event: any, commandIDs: string[]) => void;
60
+ render(): JSX.Element | null;
61
+ }