@theia/console 1.34.2 → 1.34.3

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 (36) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +30 -30
  3. package/lib/browser/ansi-console-item.d.ts +12 -12
  4. package/lib/browser/ansi-console-item.js +38 -38
  5. package/lib/browser/console-content-widget.d.ts +17 -17
  6. package/lib/browser/console-content-widget.js +90 -90
  7. package/lib/browser/console-contribution.d.ts +33 -33
  8. package/lib/browser/console-contribution.js +144 -144
  9. package/lib/browser/console-frontend-module.d.ts +4 -4
  10. package/lib/browser/console-frontend-module.js +36 -36
  11. package/lib/browser/console-history.d.ts +19 -19
  12. package/lib/browser/console-history.js +74 -74
  13. package/lib/browser/console-keybinding-contexts.d.ts +39 -39
  14. package/lib/browser/console-keybinding-contexts.js +118 -118
  15. package/lib/browser/console-manager.d.ts +7 -7
  16. package/lib/browser/console-manager.js +48 -48
  17. package/lib/browser/console-session-manager.d.ts +31 -31
  18. package/lib/browser/console-session-manager.js +116 -116
  19. package/lib/browser/console-session.d.ts +27 -27
  20. package/lib/browser/console-session.js +56 -56
  21. package/lib/browser/console-widget.d.ts +62 -62
  22. package/lib/browser/console-widget.js +247 -247
  23. package/lib/package.spec.js +25 -25
  24. package/package.json +5 -5
  25. package/src/browser/ansi-console-item.tsx +48 -48
  26. package/src/browser/console-content-widget.tsx +91 -91
  27. package/src/browser/console-contribution.ts +144 -144
  28. package/src/browser/console-frontend-module.ts +37 -37
  29. package/src/browser/console-history.ts +76 -76
  30. package/src/browser/console-keybinding-contexts.ts +107 -107
  31. package/src/browser/console-manager.ts +37 -37
  32. package/src/browser/console-session-manager.ts +121 -121
  33. package/src/browser/console-session.ts +61 -61
  34. package/src/browser/console-widget.ts +273 -273
  35. package/src/browser/style/index.css +49 -49
  36. package/src/package.spec.ts +28 -28
@@ -1,145 +1,145 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.ConsoleCommandHandler = exports.ConsoleContribution = exports.ConsoleContextMenu = exports.ConsoleCommands = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const browser_1 = require("@theia/core/lib/browser");
30
- const console_manager_1 = require("./console-manager");
31
- const console_keybinding_contexts_1 = require("./console-keybinding-contexts");
32
- const console_content_widget_1 = require("./console-content-widget");
33
- const nls_1 = require("@theia/core/lib/common/nls");
34
- var ConsoleCommands;
35
- (function (ConsoleCommands) {
36
- ConsoleCommands.SELECT_ALL = {
37
- id: 'console.selectAll'
38
- };
39
- ConsoleCommands.COLLAPSE_ALL = {
40
- id: 'console.collapseAll'
41
- };
42
- ConsoleCommands.CLEAR = {
43
- id: 'console.clear'
44
- };
45
- ConsoleCommands.EXECUTE = {
46
- id: 'console.execute'
47
- };
48
- ConsoleCommands.NAVIGATE_BACK = {
49
- id: 'console.navigatePrevious'
50
- };
51
- ConsoleCommands.NAVIGATE_FORWARD = {
52
- id: 'console.navigateNext'
53
- };
54
- })(ConsoleCommands = exports.ConsoleCommands || (exports.ConsoleCommands = {}));
55
- var ConsoleContextMenu;
56
- (function (ConsoleContextMenu) {
57
- ConsoleContextMenu.CLIPBOARD = [...console_content_widget_1.ConsoleContentWidget.CONTEXT_MENU, '1_clipboard'];
58
- ConsoleContextMenu.CLEAR = [...console_content_widget_1.ConsoleContentWidget.CONTEXT_MENU, '2_clear'];
59
- })(ConsoleContextMenu = exports.ConsoleContextMenu || (exports.ConsoleContextMenu = {}));
60
- let ConsoleContribution = class ConsoleContribution {
61
- initialize() { }
62
- registerCommands(commands) {
63
- commands.registerCommand(ConsoleCommands.SELECT_ALL, this.newCommandHandler(console => console.selectAll()));
64
- commands.registerCommand(ConsoleCommands.COLLAPSE_ALL, this.newCommandHandler(console => console.collapseAll()));
65
- commands.registerCommand(ConsoleCommands.CLEAR, this.newCommandHandler(console => console.clear()));
66
- commands.registerCommand(ConsoleCommands.EXECUTE, this.newCommandHandler(console => console.execute()));
67
- commands.registerCommand(ConsoleCommands.NAVIGATE_BACK, this.newCommandHandler(console => console.navigateBack()));
68
- commands.registerCommand(ConsoleCommands.NAVIGATE_FORWARD, this.newCommandHandler(console => console.navigateForward()));
69
- }
70
- registerKeybindings(keybindings) {
71
- keybindings.registerKeybinding({
72
- command: ConsoleCommands.SELECT_ALL.id,
73
- keybinding: 'ctrlcmd+a',
74
- context: console_keybinding_contexts_1.ConsoleKeybindingContexts.consoleContentFocus
75
- });
76
- keybindings.registerKeybinding({
77
- command: ConsoleCommands.EXECUTE.id,
78
- keybinding: 'enter',
79
- context: console_keybinding_contexts_1.ConsoleKeybindingContexts.consoleInputFocus
80
- });
81
- keybindings.registerKeybinding({
82
- command: ConsoleCommands.NAVIGATE_BACK.id,
83
- keybinding: 'up',
84
- context: console_keybinding_contexts_1.ConsoleKeybindingContexts.consoleNavigationBackEnabled
85
- });
86
- keybindings.registerKeybinding({
87
- command: ConsoleCommands.NAVIGATE_FORWARD.id,
88
- keybinding: 'down',
89
- context: console_keybinding_contexts_1.ConsoleKeybindingContexts.consoleNavigationForwardEnabled
90
- });
91
- }
92
- registerMenus(menus) {
93
- menus.registerMenuAction(ConsoleContextMenu.CLIPBOARD, {
94
- commandId: browser_1.CommonCommands.COPY.id,
95
- label: browser_1.CommonCommands.COPY.label,
96
- order: 'a1',
97
- });
98
- menus.registerMenuAction(ConsoleContextMenu.CLIPBOARD, {
99
- commandId: ConsoleCommands.SELECT_ALL.id,
100
- label: browser_1.CommonCommands.SELECT_ALL.label,
101
- order: 'a2'
102
- });
103
- menus.registerMenuAction(ConsoleContextMenu.CLIPBOARD, {
104
- commandId: ConsoleCommands.COLLAPSE_ALL.id,
105
- label: nls_1.nls.localizeByDefault('Collapse All'),
106
- order: 'a3'
107
- });
108
- menus.registerMenuAction(ConsoleContextMenu.CLEAR, {
109
- commandId: ConsoleCommands.CLEAR.id,
110
- label: nls_1.nls.localizeByDefault('Clear Console')
111
- });
112
- }
113
- newCommandHandler(execute) {
114
- return new ConsoleCommandHandler(this.manager, execute);
115
- }
116
- };
117
- __decorate([
118
- (0, inversify_1.inject)(console_manager_1.ConsoleManager),
119
- __metadata("design:type", console_manager_1.ConsoleManager)
120
- ], ConsoleContribution.prototype, "manager", void 0);
121
- ConsoleContribution = __decorate([
122
- (0, inversify_1.injectable)()
123
- ], ConsoleContribution);
124
- exports.ConsoleContribution = ConsoleContribution;
125
- class ConsoleCommandHandler {
126
- constructor(manager, doExecute) {
127
- this.manager = manager;
128
- this.doExecute = doExecute;
129
- }
130
- isEnabled() {
131
- return !!this.manager.currentConsole;
132
- }
133
- isVisible() {
134
- return !!this.manager.currentConsole;
135
- }
136
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
137
- execute(...args) {
138
- const { currentConsole } = this.manager;
139
- if (currentConsole) {
140
- return this.doExecute(currentConsole, ...args);
141
- }
142
- }
143
- }
144
- exports.ConsoleCommandHandler = ConsoleCommandHandler;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.ConsoleCommandHandler = exports.ConsoleContribution = exports.ConsoleContextMenu = exports.ConsoleCommands = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const browser_1 = require("@theia/core/lib/browser");
30
+ const console_manager_1 = require("./console-manager");
31
+ const console_keybinding_contexts_1 = require("./console-keybinding-contexts");
32
+ const console_content_widget_1 = require("./console-content-widget");
33
+ const nls_1 = require("@theia/core/lib/common/nls");
34
+ var ConsoleCommands;
35
+ (function (ConsoleCommands) {
36
+ ConsoleCommands.SELECT_ALL = {
37
+ id: 'console.selectAll'
38
+ };
39
+ ConsoleCommands.COLLAPSE_ALL = {
40
+ id: 'console.collapseAll'
41
+ };
42
+ ConsoleCommands.CLEAR = {
43
+ id: 'console.clear'
44
+ };
45
+ ConsoleCommands.EXECUTE = {
46
+ id: 'console.execute'
47
+ };
48
+ ConsoleCommands.NAVIGATE_BACK = {
49
+ id: 'console.navigatePrevious'
50
+ };
51
+ ConsoleCommands.NAVIGATE_FORWARD = {
52
+ id: 'console.navigateNext'
53
+ };
54
+ })(ConsoleCommands = exports.ConsoleCommands || (exports.ConsoleCommands = {}));
55
+ var ConsoleContextMenu;
56
+ (function (ConsoleContextMenu) {
57
+ ConsoleContextMenu.CLIPBOARD = [...console_content_widget_1.ConsoleContentWidget.CONTEXT_MENU, '1_clipboard'];
58
+ ConsoleContextMenu.CLEAR = [...console_content_widget_1.ConsoleContentWidget.CONTEXT_MENU, '2_clear'];
59
+ })(ConsoleContextMenu = exports.ConsoleContextMenu || (exports.ConsoleContextMenu = {}));
60
+ let ConsoleContribution = class ConsoleContribution {
61
+ initialize() { }
62
+ registerCommands(commands) {
63
+ commands.registerCommand(ConsoleCommands.SELECT_ALL, this.newCommandHandler(console => console.selectAll()));
64
+ commands.registerCommand(ConsoleCommands.COLLAPSE_ALL, this.newCommandHandler(console => console.collapseAll()));
65
+ commands.registerCommand(ConsoleCommands.CLEAR, this.newCommandHandler(console => console.clear()));
66
+ commands.registerCommand(ConsoleCommands.EXECUTE, this.newCommandHandler(console => console.execute()));
67
+ commands.registerCommand(ConsoleCommands.NAVIGATE_BACK, this.newCommandHandler(console => console.navigateBack()));
68
+ commands.registerCommand(ConsoleCommands.NAVIGATE_FORWARD, this.newCommandHandler(console => console.navigateForward()));
69
+ }
70
+ registerKeybindings(keybindings) {
71
+ keybindings.registerKeybinding({
72
+ command: ConsoleCommands.SELECT_ALL.id,
73
+ keybinding: 'ctrlcmd+a',
74
+ context: console_keybinding_contexts_1.ConsoleKeybindingContexts.consoleContentFocus
75
+ });
76
+ keybindings.registerKeybinding({
77
+ command: ConsoleCommands.EXECUTE.id,
78
+ keybinding: 'enter',
79
+ context: console_keybinding_contexts_1.ConsoleKeybindingContexts.consoleInputFocus
80
+ });
81
+ keybindings.registerKeybinding({
82
+ command: ConsoleCommands.NAVIGATE_BACK.id,
83
+ keybinding: 'up',
84
+ context: console_keybinding_contexts_1.ConsoleKeybindingContexts.consoleNavigationBackEnabled
85
+ });
86
+ keybindings.registerKeybinding({
87
+ command: ConsoleCommands.NAVIGATE_FORWARD.id,
88
+ keybinding: 'down',
89
+ context: console_keybinding_contexts_1.ConsoleKeybindingContexts.consoleNavigationForwardEnabled
90
+ });
91
+ }
92
+ registerMenus(menus) {
93
+ menus.registerMenuAction(ConsoleContextMenu.CLIPBOARD, {
94
+ commandId: browser_1.CommonCommands.COPY.id,
95
+ label: browser_1.CommonCommands.COPY.label,
96
+ order: 'a1',
97
+ });
98
+ menus.registerMenuAction(ConsoleContextMenu.CLIPBOARD, {
99
+ commandId: ConsoleCommands.SELECT_ALL.id,
100
+ label: browser_1.CommonCommands.SELECT_ALL.label,
101
+ order: 'a2'
102
+ });
103
+ menus.registerMenuAction(ConsoleContextMenu.CLIPBOARD, {
104
+ commandId: ConsoleCommands.COLLAPSE_ALL.id,
105
+ label: nls_1.nls.localizeByDefault('Collapse All'),
106
+ order: 'a3'
107
+ });
108
+ menus.registerMenuAction(ConsoleContextMenu.CLEAR, {
109
+ commandId: ConsoleCommands.CLEAR.id,
110
+ label: nls_1.nls.localizeByDefault('Clear Console')
111
+ });
112
+ }
113
+ newCommandHandler(execute) {
114
+ return new ConsoleCommandHandler(this.manager, execute);
115
+ }
116
+ };
117
+ __decorate([
118
+ (0, inversify_1.inject)(console_manager_1.ConsoleManager),
119
+ __metadata("design:type", console_manager_1.ConsoleManager)
120
+ ], ConsoleContribution.prototype, "manager", void 0);
121
+ ConsoleContribution = __decorate([
122
+ (0, inversify_1.injectable)()
123
+ ], ConsoleContribution);
124
+ exports.ConsoleContribution = ConsoleContribution;
125
+ class ConsoleCommandHandler {
126
+ constructor(manager, doExecute) {
127
+ this.manager = manager;
128
+ this.doExecute = doExecute;
129
+ }
130
+ isEnabled() {
131
+ return !!this.manager.currentConsole;
132
+ }
133
+ isVisible() {
134
+ return !!this.manager.currentConsole;
135
+ }
136
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
137
+ execute(...args) {
138
+ const { currentConsole } = this.manager;
139
+ if (currentConsole) {
140
+ return this.doExecute(currentConsole, ...args);
141
+ }
142
+ }
143
+ }
144
+ exports.ConsoleCommandHandler = ConsoleCommandHandler;
145
145
  //# sourceMappingURL=console-contribution.js.map
@@ -1,5 +1,5 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- import '../../src/browser/style/index.css';
3
- declare const _default: ContainerModule;
4
- export default _default;
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ import '../../src/browser/style/index.css';
3
+ declare const _default: ContainerModule;
4
+ export default _default;
5
5
  //# sourceMappingURL=console-frontend-module.d.ts.map
@@ -1,37 +1,37 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const inversify_1 = require("@theia/core/shared/inversify");
19
- const core_1 = require("@theia/core");
20
- const browser_1 = require("@theia/core/lib/browser");
21
- const console_contribution_1 = require("./console-contribution");
22
- const console_manager_1 = require("./console-manager");
23
- const console_keybinding_contexts_1 = require("./console-keybinding-contexts");
24
- require("../../src/browser/style/index.css");
25
- exports.default = new inversify_1.ContainerModule(bind => {
26
- bind(console_manager_1.ConsoleManager).toSelf().inSingletonScope();
27
- bind(browser_1.KeybindingContext).to(console_keybinding_contexts_1.ConsoleInputFocusContext).inSingletonScope();
28
- bind(browser_1.KeybindingContext).to(console_keybinding_contexts_1.ConsoleContentFocusContext).inSingletonScope();
29
- bind(browser_1.KeybindingContext).to(console_keybinding_contexts_1.ConsoleNavigationBackEnabled).inSingletonScope();
30
- bind(browser_1.KeybindingContext).to(console_keybinding_contexts_1.ConsoleNavigationForwardEnabled).inSingletonScope();
31
- bind(console_contribution_1.ConsoleContribution).toSelf().inSingletonScope();
32
- bind(browser_1.FrontendApplicationContribution).toService(console_contribution_1.ConsoleContribution);
33
- bind(core_1.CommandContribution).toService(console_contribution_1.ConsoleContribution);
34
- bind(browser_1.KeybindingContribution).toService(console_contribution_1.ConsoleContribution);
35
- bind(core_1.MenuContribution).toService(console_contribution_1.ConsoleContribution);
36
- });
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const inversify_1 = require("@theia/core/shared/inversify");
19
+ const core_1 = require("@theia/core");
20
+ const browser_1 = require("@theia/core/lib/browser");
21
+ const console_contribution_1 = require("./console-contribution");
22
+ const console_manager_1 = require("./console-manager");
23
+ const console_keybinding_contexts_1 = require("./console-keybinding-contexts");
24
+ require("../../src/browser/style/index.css");
25
+ exports.default = new inversify_1.ContainerModule(bind => {
26
+ bind(console_manager_1.ConsoleManager).toSelf().inSingletonScope();
27
+ bind(browser_1.KeybindingContext).to(console_keybinding_contexts_1.ConsoleInputFocusContext).inSingletonScope();
28
+ bind(browser_1.KeybindingContext).to(console_keybinding_contexts_1.ConsoleContentFocusContext).inSingletonScope();
29
+ bind(browser_1.KeybindingContext).to(console_keybinding_contexts_1.ConsoleNavigationBackEnabled).inSingletonScope();
30
+ bind(browser_1.KeybindingContext).to(console_keybinding_contexts_1.ConsoleNavigationForwardEnabled).inSingletonScope();
31
+ bind(console_contribution_1.ConsoleContribution).toSelf().inSingletonScope();
32
+ bind(browser_1.FrontendApplicationContribution).toService(console_contribution_1.ConsoleContribution);
33
+ bind(core_1.CommandContribution).toService(console_contribution_1.ConsoleContribution);
34
+ bind(browser_1.KeybindingContribution).toService(console_contribution_1.ConsoleContribution);
35
+ bind(core_1.MenuContribution).toService(console_contribution_1.ConsoleContribution);
36
+ });
37
37
  //# sourceMappingURL=console-frontend-module.js.map
@@ -1,20 +1,20 @@
1
- export declare class ConsoleHistory {
2
- static limit: number;
3
- protected values: string[];
4
- protected index: number;
5
- push(value: string): void;
6
- protected delete(value: string): void;
7
- protected trim(): void;
8
- get current(): string | undefined;
9
- get previous(): string | undefined;
10
- get next(): string | undefined;
11
- store(): ConsoleHistory.Data;
12
- restore(object: ConsoleHistory): void;
13
- }
14
- export declare namespace ConsoleHistory {
15
- interface Data {
16
- values: string[];
17
- index: number;
18
- }
19
- }
1
+ export declare class ConsoleHistory {
2
+ static limit: number;
3
+ protected values: string[];
4
+ protected index: number;
5
+ push(value: string): void;
6
+ protected delete(value: string): void;
7
+ protected trim(): void;
8
+ get current(): string | undefined;
9
+ get previous(): string | undefined;
10
+ get next(): string | undefined;
11
+ store(): ConsoleHistory.Data;
12
+ restore(object: ConsoleHistory): void;
13
+ }
14
+ export declare namespace ConsoleHistory {
15
+ interface Data {
16
+ values: string[];
17
+ index: number;
18
+ }
19
+ }
20
20
  //# sourceMappingURL=console-history.d.ts.map
@@ -1,75 +1,75 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var ConsoleHistory_1;
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.ConsoleHistory = void 0;
26
- const inversify_1 = require("@theia/core/shared/inversify");
27
- let ConsoleHistory = ConsoleHistory_1 = class ConsoleHistory {
28
- constructor() {
29
- this.values = [];
30
- this.index = -1;
31
- }
32
- push(value) {
33
- this.delete(value);
34
- this.values.push(value);
35
- this.trim();
36
- this.index = this.values.length;
37
- }
38
- delete(value) {
39
- const index = this.values.indexOf(value);
40
- if (index !== -1) {
41
- this.values.splice(index, 1);
42
- }
43
- }
44
- trim() {
45
- const index = this.values.length - ConsoleHistory_1.limit;
46
- if (index > 0) {
47
- this.values = this.values.slice(index);
48
- }
49
- }
50
- get current() {
51
- return this.values[this.index];
52
- }
53
- get previous() {
54
- this.index = Math.max(this.index - 1, -1);
55
- return this.current;
56
- }
57
- get next() {
58
- this.index = Math.min(this.index + 1, this.values.length);
59
- return this.current;
60
- }
61
- store() {
62
- const { values, index } = this;
63
- return { values, index };
64
- }
65
- restore(object) {
66
- this.values = object.values;
67
- this.index = object.index;
68
- }
69
- };
70
- ConsoleHistory.limit = 50;
71
- ConsoleHistory = ConsoleHistory_1 = __decorate([
72
- (0, inversify_1.injectable)()
73
- ], ConsoleHistory);
74
- exports.ConsoleHistory = ConsoleHistory;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var ConsoleHistory_1;
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.ConsoleHistory = void 0;
26
+ const inversify_1 = require("@theia/core/shared/inversify");
27
+ let ConsoleHistory = ConsoleHistory_1 = class ConsoleHistory {
28
+ constructor() {
29
+ this.values = [];
30
+ this.index = -1;
31
+ }
32
+ push(value) {
33
+ this.delete(value);
34
+ this.values.push(value);
35
+ this.trim();
36
+ this.index = this.values.length;
37
+ }
38
+ delete(value) {
39
+ const index = this.values.indexOf(value);
40
+ if (index !== -1) {
41
+ this.values.splice(index, 1);
42
+ }
43
+ }
44
+ trim() {
45
+ const index = this.values.length - ConsoleHistory_1.limit;
46
+ if (index > 0) {
47
+ this.values = this.values.slice(index);
48
+ }
49
+ }
50
+ get current() {
51
+ return this.values[this.index];
52
+ }
53
+ get previous() {
54
+ this.index = Math.max(this.index - 1, -1);
55
+ return this.current;
56
+ }
57
+ get next() {
58
+ this.index = Math.min(this.index + 1, this.values.length);
59
+ return this.current;
60
+ }
61
+ store() {
62
+ const { values, index } = this;
63
+ return { values, index };
64
+ }
65
+ restore(object) {
66
+ this.values = object.values;
67
+ this.index = object.index;
68
+ }
69
+ };
70
+ ConsoleHistory.limit = 50;
71
+ ConsoleHistory = ConsoleHistory_1 = __decorate([
72
+ (0, inversify_1.injectable)()
73
+ ], ConsoleHistory);
74
+ exports.ConsoleHistory = ConsoleHistory;
75
75
  //# sourceMappingURL=console-history.js.map
@@ -1,40 +1,40 @@
1
- import { KeybindingContext } from '@theia/core/lib/browser';
2
- import { ConsoleManager } from './console-manager';
3
- import { ConsoleWidget } from './console-widget';
4
- export declare namespace ConsoleKeybindingContexts {
5
- /**
6
- * ID of a keybinding context that is enabled when the console content has the focus.
7
- */
8
- const consoleContentFocus = "consoleContentFocus";
9
- /**
10
- * ID of a keybinding context that is enabled when the console input has the focus.
11
- */
12
- const consoleInputFocus = "consoleInputFocus";
13
- /**
14
- * ID of a keybinding context that is enabled when the console history navigation back is enabled.
15
- */
16
- const consoleNavigationBackEnabled = "consoleNavigationBackEnabled";
17
- /**
18
- * ID of a keybinding context that is enabled when the console history navigation forward is enabled.
19
- */
20
- const consoleNavigationForwardEnabled = "consoleNavigationForwardEnabled";
21
- }
22
- export declare class ConsoleInputFocusContext implements KeybindingContext {
23
- readonly id: string;
24
- protected readonly manager: ConsoleManager;
25
- isEnabled(): boolean;
26
- protected isConsoleEnabled(console: ConsoleWidget): boolean;
27
- }
28
- export declare class ConsoleContentFocusContext extends ConsoleInputFocusContext {
29
- readonly id: string;
30
- protected isConsoleEnabled(console: ConsoleWidget): boolean;
31
- }
32
- export declare class ConsoleNavigationBackEnabled extends ConsoleInputFocusContext {
33
- readonly id: string;
34
- protected isConsoleEnabled(console: ConsoleWidget): boolean;
35
- }
36
- export declare class ConsoleNavigationForwardEnabled extends ConsoleInputFocusContext {
37
- readonly id: string;
38
- protected isConsoleEnabled(console: ConsoleWidget): boolean;
39
- }
1
+ import { KeybindingContext } from '@theia/core/lib/browser';
2
+ import { ConsoleManager } from './console-manager';
3
+ import { ConsoleWidget } from './console-widget';
4
+ export declare namespace ConsoleKeybindingContexts {
5
+ /**
6
+ * ID of a keybinding context that is enabled when the console content has the focus.
7
+ */
8
+ const consoleContentFocus = "consoleContentFocus";
9
+ /**
10
+ * ID of a keybinding context that is enabled when the console input has the focus.
11
+ */
12
+ const consoleInputFocus = "consoleInputFocus";
13
+ /**
14
+ * ID of a keybinding context that is enabled when the console history navigation back is enabled.
15
+ */
16
+ const consoleNavigationBackEnabled = "consoleNavigationBackEnabled";
17
+ /**
18
+ * ID of a keybinding context that is enabled when the console history navigation forward is enabled.
19
+ */
20
+ const consoleNavigationForwardEnabled = "consoleNavigationForwardEnabled";
21
+ }
22
+ export declare class ConsoleInputFocusContext implements KeybindingContext {
23
+ readonly id: string;
24
+ protected readonly manager: ConsoleManager;
25
+ isEnabled(): boolean;
26
+ protected isConsoleEnabled(console: ConsoleWidget): boolean;
27
+ }
28
+ export declare class ConsoleContentFocusContext extends ConsoleInputFocusContext {
29
+ readonly id: string;
30
+ protected isConsoleEnabled(console: ConsoleWidget): boolean;
31
+ }
32
+ export declare class ConsoleNavigationBackEnabled extends ConsoleInputFocusContext {
33
+ readonly id: string;
34
+ protected isConsoleEnabled(console: ConsoleWidget): boolean;
35
+ }
36
+ export declare class ConsoleNavigationForwardEnabled extends ConsoleInputFocusContext {
37
+ readonly id: string;
38
+ protected isConsoleEnabled(console: ConsoleWidget): boolean;
39
+ }
40
40
  //# sourceMappingURL=console-keybinding-contexts.d.ts.map