@theia/toolbar 1.45.0 → 1.46.0-next.72
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.
- package/README.md +32 -32
- package/lib/browser/abstract-toolbar-contribution.d.ts +16 -16
- package/lib/browser/abstract-toolbar-contribution.js +68 -68
- package/lib/browser/application-shell-with-toolbar-override.d.ts +15 -15
- package/lib/browser/application-shell-with-toolbar-override.js +101 -101
- package/lib/browser/codicons.d.ts +1 -1
- package/lib/browser/codicons.js +20 -20
- package/lib/browser/font-awesome-icons.d.ts +1 -1
- package/lib/browser/font-awesome-icons.js +20 -20
- package/lib/browser/package.spec.js +18 -18
- package/lib/browser/toolbar-command-contribution.d.ts +25 -25
- package/lib/browser/toolbar-command-contribution.js +211 -211
- package/lib/browser/toolbar-command-quick-input-service.d.ts +19 -19
- package/lib/browser/toolbar-command-quick-input-service.js +112 -112
- package/lib/browser/toolbar-constants.d.ts +23 -23
- package/lib/browser/toolbar-constants.js +75 -75
- package/lib/browser/toolbar-controller.d.ts +34 -34
- package/lib/browser/toolbar-controller.js +186 -186
- package/lib/browser/toolbar-defaults.d.ts +3 -3
- package/lib/browser/toolbar-defaults.js +60 -60
- package/lib/browser/toolbar-frontend-module.d.ts +4 -4
- package/lib/browser/toolbar-frontend-module.js +25 -25
- package/lib/browser/toolbar-icon-selector-dialog.d.ts +65 -65
- package/lib/browser/toolbar-icon-selector-dialog.js +235 -235
- package/lib/browser/toolbar-interfaces.d.ts +45 -45
- package/lib/browser/toolbar-interfaces.js +42 -42
- package/lib/browser/toolbar-preference-contribution.d.ts +9 -9
- package/lib/browser/toolbar-preference-contribution.js +34 -34
- package/lib/browser/toolbar-preference-schema.d.ts +5 -5
- package/lib/browser/toolbar-preference-schema.js +73 -73
- package/lib/browser/toolbar-storage-provider.d.ts +47 -47
- package/lib/browser/toolbar-storage-provider.js +357 -357
- package/lib/browser/toolbar.d.ts +56 -56
- package/lib/browser/toolbar.js +380 -380
- package/package.json +11 -11
- package/src/browser/abstract-toolbar-contribution.tsx +53 -53
- package/src/browser/application-shell-with-toolbar-override.ts +98 -98
- package/src/browser/codicons.ts +18 -18
- package/src/browser/font-awesome-icons.ts +18 -18
- package/src/browser/package.spec.ts +19 -19
- package/src/browser/style/toolbar.css +255 -255
- package/src/browser/toolbar-command-contribution.ts +211 -211
- package/src/browser/toolbar-command-quick-input-service.ts +86 -86
- package/src/browser/toolbar-constants.ts +79 -79
- package/src/browser/toolbar-controller.ts +185 -185
- package/src/browser/toolbar-defaults.ts +58 -58
- package/src/browser/toolbar-frontend-module.ts +30 -30
- package/src/browser/toolbar-icon-selector-dialog.tsx +296 -296
- package/src/browser/toolbar-interfaces.ts +76 -76
- package/src/browser/toolbar-preference-contribution.ts +38 -38
- package/src/browser/toolbar-preference-schema.ts +75 -75
- package/src/browser/toolbar-storage-provider.ts +352 -352
- package/src/browser/toolbar.tsx +424 -424
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2022 Ericsson 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-only 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.ToolbarCommandQuickInputService = void 0;
|
|
28
|
-
const core_1 = require("@theia/core");
|
|
29
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
30
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
31
|
-
const toolbar_icon_selector_dialog_1 = require("./toolbar-icon-selector-dialog");
|
|
32
|
-
const toolbar_interfaces_1 = require("./toolbar-interfaces");
|
|
33
|
-
const toolbar_controller_1 = require("./toolbar-controller");
|
|
34
|
-
let ToolbarCommandQuickInputService = class ToolbarCommandQuickInputService {
|
|
35
|
-
constructor() {
|
|
36
|
-
this.quickPickItems = [];
|
|
37
|
-
this.columnQuickPickItems = [
|
|
38
|
-
{
|
|
39
|
-
label: core_1.nls.localize('theia/toolbar/leftColumn', 'Left Column'),
|
|
40
|
-
id: toolbar_interfaces_1.ToolbarAlignment.LEFT,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: core_1.nls.localize('theia/toolbar/centerColumn', 'Center Column'),
|
|
44
|
-
id: toolbar_interfaces_1.ToolbarAlignment.CENTER,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: core_1.nls.localize('theia/toolbar/rightColumn', 'Right Column'),
|
|
48
|
-
id: toolbar_interfaces_1.ToolbarAlignment.RIGHT
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
openIconDialog() {
|
|
53
|
-
this.quickPickItems = this.generateCommandsList();
|
|
54
|
-
this.quickInputService.showQuickPick(this.quickPickItems, {
|
|
55
|
-
placeholder: core_1.nls.localize('theia/toolbar/addCommandPlaceholder', 'Find a command to add to the toolbar'),
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
openColumnQP() {
|
|
59
|
-
return this.quickInputService.showQuickPick(this.columnQuickPickItems, {
|
|
60
|
-
placeholder: core_1.nls.localize('theia/toolbar/toolbarLocationPlaceholder', 'Where would you like the command added?')
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
generateCommandsList() {
|
|
64
|
-
const { recent, other } = this.quickCommandService.getCommands();
|
|
65
|
-
return [...recent, ...other].map(command => {
|
|
66
|
-
const formattedItem = this.quickCommandService.toItem(command);
|
|
67
|
-
return {
|
|
68
|
-
...formattedItem,
|
|
69
|
-
alwaysShow: true,
|
|
70
|
-
execute: async () => {
|
|
71
|
-
var _a;
|
|
72
|
-
const iconDialog = this.iconDialogFactory(command);
|
|
73
|
-
const iconClass = await iconDialog.open();
|
|
74
|
-
if (iconClass) {
|
|
75
|
-
const { id } = (_a = await this.openColumnQP()) !== null && _a !== void 0 ? _a : {};
|
|
76
|
-
if (toolbar_interfaces_1.ToolbarAlignmentString.is(id)) {
|
|
77
|
-
this.model.addItem({ ...command, iconClass }, id);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
__decorate([
|
|
86
|
-
(0, inversify_1.inject)(core_1.CommandService),
|
|
87
|
-
__metadata("design:type", Object)
|
|
88
|
-
], ToolbarCommandQuickInputService.prototype, "commandService", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
(0, inversify_1.inject)(browser_1.QuickInputService),
|
|
91
|
-
__metadata("design:type", Object)
|
|
92
|
-
], ToolbarCommandQuickInputService.prototype, "quickInputService", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
(0, inversify_1.inject)(core_1.CommandRegistry),
|
|
95
|
-
__metadata("design:type", core_1.CommandRegistry)
|
|
96
|
-
], ToolbarCommandQuickInputService.prototype, "commandRegistry", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
(0, inversify_1.inject)(browser_1.QuickCommandService),
|
|
99
|
-
__metadata("design:type", browser_1.QuickCommandService)
|
|
100
|
-
], ToolbarCommandQuickInputService.prototype, "quickCommandService", void 0);
|
|
101
|
-
__decorate([
|
|
102
|
-
(0, inversify_1.inject)(toolbar_controller_1.ToolbarController),
|
|
103
|
-
__metadata("design:type", toolbar_controller_1.ToolbarController)
|
|
104
|
-
], ToolbarCommandQuickInputService.prototype, "model", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
(0, inversify_1.inject)(toolbar_icon_selector_dialog_1.ToolbarIconDialogFactory),
|
|
107
|
-
__metadata("design:type", Function)
|
|
108
|
-
], ToolbarCommandQuickInputService.prototype, "iconDialogFactory", void 0);
|
|
109
|
-
ToolbarCommandQuickInputService = __decorate([
|
|
110
|
-
(0, inversify_1.injectable)()
|
|
111
|
-
], ToolbarCommandQuickInputService);
|
|
112
|
-
exports.ToolbarCommandQuickInputService = ToolbarCommandQuickInputService;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 Ericsson 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-only 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.ToolbarCommandQuickInputService = void 0;
|
|
28
|
+
const core_1 = require("@theia/core");
|
|
29
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
30
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
31
|
+
const toolbar_icon_selector_dialog_1 = require("./toolbar-icon-selector-dialog");
|
|
32
|
+
const toolbar_interfaces_1 = require("./toolbar-interfaces");
|
|
33
|
+
const toolbar_controller_1 = require("./toolbar-controller");
|
|
34
|
+
let ToolbarCommandQuickInputService = class ToolbarCommandQuickInputService {
|
|
35
|
+
constructor() {
|
|
36
|
+
this.quickPickItems = [];
|
|
37
|
+
this.columnQuickPickItems = [
|
|
38
|
+
{
|
|
39
|
+
label: core_1.nls.localize('theia/toolbar/leftColumn', 'Left Column'),
|
|
40
|
+
id: toolbar_interfaces_1.ToolbarAlignment.LEFT,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: core_1.nls.localize('theia/toolbar/centerColumn', 'Center Column'),
|
|
44
|
+
id: toolbar_interfaces_1.ToolbarAlignment.CENTER,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: core_1.nls.localize('theia/toolbar/rightColumn', 'Right Column'),
|
|
48
|
+
id: toolbar_interfaces_1.ToolbarAlignment.RIGHT
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
openIconDialog() {
|
|
53
|
+
this.quickPickItems = this.generateCommandsList();
|
|
54
|
+
this.quickInputService.showQuickPick(this.quickPickItems, {
|
|
55
|
+
placeholder: core_1.nls.localize('theia/toolbar/addCommandPlaceholder', 'Find a command to add to the toolbar'),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
openColumnQP() {
|
|
59
|
+
return this.quickInputService.showQuickPick(this.columnQuickPickItems, {
|
|
60
|
+
placeholder: core_1.nls.localize('theia/toolbar/toolbarLocationPlaceholder', 'Where would you like the command added?')
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
generateCommandsList() {
|
|
64
|
+
const { recent, other } = this.quickCommandService.getCommands();
|
|
65
|
+
return [...recent, ...other].map(command => {
|
|
66
|
+
const formattedItem = this.quickCommandService.toItem(command);
|
|
67
|
+
return {
|
|
68
|
+
...formattedItem,
|
|
69
|
+
alwaysShow: true,
|
|
70
|
+
execute: async () => {
|
|
71
|
+
var _a;
|
|
72
|
+
const iconDialog = this.iconDialogFactory(command);
|
|
73
|
+
const iconClass = await iconDialog.open();
|
|
74
|
+
if (iconClass) {
|
|
75
|
+
const { id } = (_a = await this.openColumnQP()) !== null && _a !== void 0 ? _a : {};
|
|
76
|
+
if (toolbar_interfaces_1.ToolbarAlignmentString.is(id)) {
|
|
77
|
+
this.model.addItem({ ...command, iconClass }, id);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, inversify_1.inject)(core_1.CommandService),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], ToolbarCommandQuickInputService.prototype, "commandService", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, inversify_1.inject)(browser_1.QuickInputService),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], ToolbarCommandQuickInputService.prototype, "quickInputService", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, inversify_1.inject)(core_1.CommandRegistry),
|
|
95
|
+
__metadata("design:type", core_1.CommandRegistry)
|
|
96
|
+
], ToolbarCommandQuickInputService.prototype, "commandRegistry", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, inversify_1.inject)(browser_1.QuickCommandService),
|
|
99
|
+
__metadata("design:type", browser_1.QuickCommandService)
|
|
100
|
+
], ToolbarCommandQuickInputService.prototype, "quickCommandService", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, inversify_1.inject)(toolbar_controller_1.ToolbarController),
|
|
103
|
+
__metadata("design:type", toolbar_controller_1.ToolbarController)
|
|
104
|
+
], ToolbarCommandQuickInputService.prototype, "model", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, inversify_1.inject)(toolbar_icon_selector_dialog_1.ToolbarIconDialogFactory),
|
|
107
|
+
__metadata("design:type", Function)
|
|
108
|
+
], ToolbarCommandQuickInputService.prototype, "iconDialogFactory", void 0);
|
|
109
|
+
ToolbarCommandQuickInputService = __decorate([
|
|
110
|
+
(0, inversify_1.injectable)()
|
|
111
|
+
], ToolbarCommandQuickInputService);
|
|
112
|
+
exports.ToolbarCommandQuickInputService = ToolbarCommandQuickInputService;
|
|
113
113
|
//# sourceMappingURL=toolbar-command-quick-input-service.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Command, MenuPath } from '@theia/core';
|
|
3
|
-
import URI from '@theia/core/lib/common/uri';
|
|
4
|
-
export declare namespace ToolbarCommands {
|
|
5
|
-
const TOGGLE_TOOLBAR: Command;
|
|
6
|
-
const REMOVE_COMMAND_FROM_TOOLBAR: Command;
|
|
7
|
-
const INSERT_GROUP_LEFT: Command;
|
|
8
|
-
const INSERT_GROUP_RIGHT: Command;
|
|
9
|
-
const ADD_COMMAND_TO_TOOLBAR: Command;
|
|
10
|
-
const RESET_TOOLBAR: Command;
|
|
11
|
-
const CUSTOMIZE_TOOLBAR: Command;
|
|
12
|
-
}
|
|
13
|
-
export declare const UserToolbarURI: unique symbol;
|
|
14
|
-
export declare const USER_TOOLBAR_URI: URI;
|
|
15
|
-
export declare namespace ToolbarMenus {
|
|
16
|
-
const TOOLBAR_ITEM_CONTEXT_MENU: MenuPath;
|
|
17
|
-
const TOOLBAR_BACKGROUND_CONTEXT_MENU: MenuPath;
|
|
18
|
-
const SEARCH_WIDGET_DROPDOWN_MENU: MenuPath;
|
|
19
|
-
}
|
|
20
|
-
export declare type ReactInteraction<T = Element, U = MouseEvent> = React.MouseEvent<T, U> | React.KeyboardEvent<T>;
|
|
21
|
-
export declare namespace ReactKeyboardEvent {
|
|
22
|
-
function is(obj: unknown): obj is React.KeyboardEvent;
|
|
23
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Command, MenuPath } from '@theia/core';
|
|
3
|
+
import URI from '@theia/core/lib/common/uri';
|
|
4
|
+
export declare namespace ToolbarCommands {
|
|
5
|
+
const TOGGLE_TOOLBAR: Command;
|
|
6
|
+
const REMOVE_COMMAND_FROM_TOOLBAR: Command;
|
|
7
|
+
const INSERT_GROUP_LEFT: Command;
|
|
8
|
+
const INSERT_GROUP_RIGHT: Command;
|
|
9
|
+
const ADD_COMMAND_TO_TOOLBAR: Command;
|
|
10
|
+
const RESET_TOOLBAR: Command;
|
|
11
|
+
const CUSTOMIZE_TOOLBAR: Command;
|
|
12
|
+
}
|
|
13
|
+
export declare const UserToolbarURI: unique symbol;
|
|
14
|
+
export declare const USER_TOOLBAR_URI: URI;
|
|
15
|
+
export declare namespace ToolbarMenus {
|
|
16
|
+
const TOOLBAR_ITEM_CONTEXT_MENU: MenuPath;
|
|
17
|
+
const TOOLBAR_BACKGROUND_CONTEXT_MENU: MenuPath;
|
|
18
|
+
const SEARCH_WIDGET_DROPDOWN_MENU: MenuPath;
|
|
19
|
+
}
|
|
20
|
+
export declare type ReactInteraction<T = Element, U = MouseEvent> = React.MouseEvent<T, U> | React.KeyboardEvent<T>;
|
|
21
|
+
export declare namespace ReactKeyboardEvent {
|
|
22
|
+
function is(obj: unknown): obj is React.KeyboardEvent;
|
|
23
|
+
}
|
|
24
24
|
//# sourceMappingURL=toolbar-constants.d.ts.map
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2022 Ericsson 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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ReactKeyboardEvent = exports.ToolbarMenus = exports.USER_TOOLBAR_URI = exports.UserToolbarURI = exports.ToolbarCommands = void 0;
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
21
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
22
|
-
const browser_2 = require("@theia/userstorage/lib/browser");
|
|
23
|
-
var ToolbarCommands;
|
|
24
|
-
(function (ToolbarCommands) {
|
|
25
|
-
ToolbarCommands.TOGGLE_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
26
|
-
id: 'toolbar.view.toggle',
|
|
27
|
-
category: browser_1.CommonCommands.VIEW_CATEGORY,
|
|
28
|
-
label: 'Toggle Toolbar',
|
|
29
|
-
}, 'theia/toolbar/toggleToolbar', core_1.nls.getDefaultKey(browser_1.CommonCommands.VIEW_CATEGORY));
|
|
30
|
-
ToolbarCommands.REMOVE_COMMAND_FROM_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
31
|
-
id: 'toolbar.remove.command',
|
|
32
|
-
category: 'Toolbar',
|
|
33
|
-
label: 'Remove Command From Toolbar',
|
|
34
|
-
}, 'theia/toolbar/removeCommand');
|
|
35
|
-
ToolbarCommands.INSERT_GROUP_LEFT = core_1.Command.toLocalizedCommand({
|
|
36
|
-
id: 'toolbar.insert.group.left',
|
|
37
|
-
category: 'Toolbar',
|
|
38
|
-
label: 'Insert Group Separator (Left)',
|
|
39
|
-
}, 'theia/toolbar/insertGroupLeft');
|
|
40
|
-
ToolbarCommands.INSERT_GROUP_RIGHT = core_1.Command.toLocalizedCommand({
|
|
41
|
-
id: 'toolbar.insert.group.right',
|
|
42
|
-
category: 'Toolbar',
|
|
43
|
-
label: 'Insert Group Separator (Right)',
|
|
44
|
-
}, 'theia/toolbar/insertGroupRight');
|
|
45
|
-
ToolbarCommands.ADD_COMMAND_TO_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
46
|
-
id: 'toolbar.add.command',
|
|
47
|
-
category: 'Toolbar',
|
|
48
|
-
label: 'Add Command to Toolbar',
|
|
49
|
-
}, 'theia/toolbar/addCommand');
|
|
50
|
-
ToolbarCommands.RESET_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
51
|
-
id: 'toolbar.restore.defaults',
|
|
52
|
-
category: 'Toolbar',
|
|
53
|
-
label: 'Restore Toolbar Defaults',
|
|
54
|
-
}, 'theia/toolbar/restoreDefaults');
|
|
55
|
-
ToolbarCommands.CUSTOMIZE_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
56
|
-
id: 'toolbar.customize',
|
|
57
|
-
category: 'Toolbar',
|
|
58
|
-
label: 'Customize Toolbar (Open JSON)',
|
|
59
|
-
}, 'theia/toolbar/openJSON');
|
|
60
|
-
})(ToolbarCommands = exports.ToolbarCommands || (exports.ToolbarCommands = {}));
|
|
61
|
-
exports.UserToolbarURI = Symbol('UserToolbarURI');
|
|
62
|
-
exports.USER_TOOLBAR_URI = new uri_1.default().withScheme(browser_2.UserStorageUri.scheme).withPath('/user/toolbar.json');
|
|
63
|
-
var ToolbarMenus;
|
|
64
|
-
(function (ToolbarMenus) {
|
|
65
|
-
ToolbarMenus.TOOLBAR_ITEM_CONTEXT_MENU = ['toolbar:toolbarItemContextMenu'];
|
|
66
|
-
ToolbarMenus.TOOLBAR_BACKGROUND_CONTEXT_MENU = ['toolbar:backgroundContextMenu'];
|
|
67
|
-
ToolbarMenus.SEARCH_WIDGET_DROPDOWN_MENU = ['searchToolbar:dropdown'];
|
|
68
|
-
})(ToolbarMenus = exports.ToolbarMenus || (exports.ToolbarMenus = {}));
|
|
69
|
-
var ReactKeyboardEvent;
|
|
70
|
-
(function (ReactKeyboardEvent) {
|
|
71
|
-
function is(obj) {
|
|
72
|
-
return (0, core_1.isObject)(obj) && 'key' in obj;
|
|
73
|
-
}
|
|
74
|
-
ReactKeyboardEvent.is = is;
|
|
75
|
-
})(ReactKeyboardEvent = exports.ReactKeyboardEvent || (exports.ReactKeyboardEvent = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 Ericsson 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-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ReactKeyboardEvent = exports.ToolbarMenus = exports.USER_TOOLBAR_URI = exports.UserToolbarURI = exports.ToolbarCommands = void 0;
|
|
19
|
+
const core_1 = require("@theia/core");
|
|
20
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
21
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
22
|
+
const browser_2 = require("@theia/userstorage/lib/browser");
|
|
23
|
+
var ToolbarCommands;
|
|
24
|
+
(function (ToolbarCommands) {
|
|
25
|
+
ToolbarCommands.TOGGLE_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
26
|
+
id: 'toolbar.view.toggle',
|
|
27
|
+
category: browser_1.CommonCommands.VIEW_CATEGORY,
|
|
28
|
+
label: 'Toggle Toolbar',
|
|
29
|
+
}, 'theia/toolbar/toggleToolbar', core_1.nls.getDefaultKey(browser_1.CommonCommands.VIEW_CATEGORY));
|
|
30
|
+
ToolbarCommands.REMOVE_COMMAND_FROM_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
31
|
+
id: 'toolbar.remove.command',
|
|
32
|
+
category: 'Toolbar',
|
|
33
|
+
label: 'Remove Command From Toolbar',
|
|
34
|
+
}, 'theia/toolbar/removeCommand');
|
|
35
|
+
ToolbarCommands.INSERT_GROUP_LEFT = core_1.Command.toLocalizedCommand({
|
|
36
|
+
id: 'toolbar.insert.group.left',
|
|
37
|
+
category: 'Toolbar',
|
|
38
|
+
label: 'Insert Group Separator (Left)',
|
|
39
|
+
}, 'theia/toolbar/insertGroupLeft');
|
|
40
|
+
ToolbarCommands.INSERT_GROUP_RIGHT = core_1.Command.toLocalizedCommand({
|
|
41
|
+
id: 'toolbar.insert.group.right',
|
|
42
|
+
category: 'Toolbar',
|
|
43
|
+
label: 'Insert Group Separator (Right)',
|
|
44
|
+
}, 'theia/toolbar/insertGroupRight');
|
|
45
|
+
ToolbarCommands.ADD_COMMAND_TO_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
46
|
+
id: 'toolbar.add.command',
|
|
47
|
+
category: 'Toolbar',
|
|
48
|
+
label: 'Add Command to Toolbar',
|
|
49
|
+
}, 'theia/toolbar/addCommand');
|
|
50
|
+
ToolbarCommands.RESET_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
51
|
+
id: 'toolbar.restore.defaults',
|
|
52
|
+
category: 'Toolbar',
|
|
53
|
+
label: 'Restore Toolbar Defaults',
|
|
54
|
+
}, 'theia/toolbar/restoreDefaults');
|
|
55
|
+
ToolbarCommands.CUSTOMIZE_TOOLBAR = core_1.Command.toLocalizedCommand({
|
|
56
|
+
id: 'toolbar.customize',
|
|
57
|
+
category: 'Toolbar',
|
|
58
|
+
label: 'Customize Toolbar (Open JSON)',
|
|
59
|
+
}, 'theia/toolbar/openJSON');
|
|
60
|
+
})(ToolbarCommands = exports.ToolbarCommands || (exports.ToolbarCommands = {}));
|
|
61
|
+
exports.UserToolbarURI = Symbol('UserToolbarURI');
|
|
62
|
+
exports.USER_TOOLBAR_URI = new uri_1.default().withScheme(browser_2.UserStorageUri.scheme).withPath('/user/toolbar.json');
|
|
63
|
+
var ToolbarMenus;
|
|
64
|
+
(function (ToolbarMenus) {
|
|
65
|
+
ToolbarMenus.TOOLBAR_ITEM_CONTEXT_MENU = ['toolbar:toolbarItemContextMenu'];
|
|
66
|
+
ToolbarMenus.TOOLBAR_BACKGROUND_CONTEXT_MENU = ['toolbar:backgroundContextMenu'];
|
|
67
|
+
ToolbarMenus.SEARCH_WIDGET_DROPDOWN_MENU = ['searchToolbar:dropdown'];
|
|
68
|
+
})(ToolbarMenus = exports.ToolbarMenus || (exports.ToolbarMenus = {}));
|
|
69
|
+
var ReactKeyboardEvent;
|
|
70
|
+
(function (ReactKeyboardEvent) {
|
|
71
|
+
function is(obj) {
|
|
72
|
+
return (0, core_1.isObject)(obj) && 'key' in obj;
|
|
73
|
+
}
|
|
74
|
+
ReactKeyboardEvent.is = is;
|
|
75
|
+
})(ReactKeyboardEvent = exports.ReactKeyboardEvent || (exports.ReactKeyboardEvent = {}));
|
|
76
76
|
//# sourceMappingURL=toolbar-constants.js.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { Command, ContributionProvider, Emitter, MaybePromise, MessageService } from '@theia/core';
|
|
2
|
-
import { Widget } from '@theia/core/lib/browser';
|
|
3
|
-
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
|
4
|
-
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
5
|
-
import { DeflatedToolbarTree, ToolbarContribution, ToolbarTreeSchema, ToolbarAlignment, ToolbarItemPosition } from './toolbar-interfaces';
|
|
6
|
-
import { ToolbarStorageProvider } from './toolbar-storage-provider';
|
|
7
|
-
export declare class ToolbarController {
|
|
8
|
-
protected readonly storageProvider: ToolbarStorageProvider;
|
|
9
|
-
protected readonly appState: FrontendApplicationStateService;
|
|
10
|
-
protected readonly messageService: MessageService;
|
|
11
|
-
protected readonly defaultsFactory: () => DeflatedToolbarTree;
|
|
12
|
-
protected widgetContributions: ContributionProvider<ToolbarContribution>;
|
|
13
|
-
protected toolbarModelDidUpdateEmitter: Emitter<void>;
|
|
14
|
-
readonly onToolbarModelDidUpdate: import("@theia/core").Event<void>;
|
|
15
|
-
protected toolbarProviderBusyEmitter: Emitter<boolean>;
|
|
16
|
-
readonly onToolbarDidChangeBusyState: import("@theia/core").Event<boolean>;
|
|
17
|
-
readonly ready: Deferred<void>;
|
|
18
|
-
protected _toolbarItems: ToolbarTreeSchema;
|
|
19
|
-
get toolbarItems(): ToolbarTreeSchema;
|
|
20
|
-
set toolbarItems(newTree: ToolbarTreeSchema);
|
|
21
|
-
protected inflateItems(schema: DeflatedToolbarTree): ToolbarTreeSchema;
|
|
22
|
-
getContributionByID(id: string): ToolbarContribution | undefined;
|
|
23
|
-
protected init(): void;
|
|
24
|
-
protected doInit(): Promise<void>;
|
|
25
|
-
protected resolveToolbarItems(): Promise<ToolbarTreeSchema>;
|
|
26
|
-
swapValues(oldPosition: ToolbarItemPosition, newPosition: ToolbarItemPosition, direction: 'location-left' | 'location-right'): Promise<boolean>;
|
|
27
|
-
clearAll(): Promise<boolean>;
|
|
28
|
-
openOrCreateJSONFile(doOpen?: boolean): Promise<Widget | undefined>;
|
|
29
|
-
addItem(command: Command, area: ToolbarAlignment): Promise<boolean>;
|
|
30
|
-
removeItem(position: ToolbarItemPosition, id?: string): Promise<boolean>;
|
|
31
|
-
moveItemToEmptySpace(draggedItemPosition: ToolbarItemPosition, column: ToolbarAlignment, centerPosition?: 'left' | 'right'): Promise<boolean>;
|
|
32
|
-
insertGroup(position: ToolbarItemPosition, insertDirection: 'left' | 'right'): Promise<boolean>;
|
|
33
|
-
withBusy<T = unknown>(action: () => MaybePromise<T>): Promise<T>;
|
|
34
|
-
}
|
|
1
|
+
import { Command, ContributionProvider, Emitter, MaybePromise, MessageService } from '@theia/core';
|
|
2
|
+
import { Widget } from '@theia/core/lib/browser';
|
|
3
|
+
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
|
4
|
+
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
5
|
+
import { DeflatedToolbarTree, ToolbarContribution, ToolbarTreeSchema, ToolbarAlignment, ToolbarItemPosition } from './toolbar-interfaces';
|
|
6
|
+
import { ToolbarStorageProvider } from './toolbar-storage-provider';
|
|
7
|
+
export declare class ToolbarController {
|
|
8
|
+
protected readonly storageProvider: ToolbarStorageProvider;
|
|
9
|
+
protected readonly appState: FrontendApplicationStateService;
|
|
10
|
+
protected readonly messageService: MessageService;
|
|
11
|
+
protected readonly defaultsFactory: () => DeflatedToolbarTree;
|
|
12
|
+
protected widgetContributions: ContributionProvider<ToolbarContribution>;
|
|
13
|
+
protected toolbarModelDidUpdateEmitter: Emitter<void>;
|
|
14
|
+
readonly onToolbarModelDidUpdate: import("@theia/core").Event<void>;
|
|
15
|
+
protected toolbarProviderBusyEmitter: Emitter<boolean>;
|
|
16
|
+
readonly onToolbarDidChangeBusyState: import("@theia/core").Event<boolean>;
|
|
17
|
+
readonly ready: Deferred<void>;
|
|
18
|
+
protected _toolbarItems: ToolbarTreeSchema;
|
|
19
|
+
get toolbarItems(): ToolbarTreeSchema;
|
|
20
|
+
set toolbarItems(newTree: ToolbarTreeSchema);
|
|
21
|
+
protected inflateItems(schema: DeflatedToolbarTree): ToolbarTreeSchema;
|
|
22
|
+
getContributionByID(id: string): ToolbarContribution | undefined;
|
|
23
|
+
protected init(): void;
|
|
24
|
+
protected doInit(): Promise<void>;
|
|
25
|
+
protected resolveToolbarItems(): Promise<ToolbarTreeSchema>;
|
|
26
|
+
swapValues(oldPosition: ToolbarItemPosition, newPosition: ToolbarItemPosition, direction: 'location-left' | 'location-right'): Promise<boolean>;
|
|
27
|
+
clearAll(): Promise<boolean>;
|
|
28
|
+
openOrCreateJSONFile(doOpen?: boolean): Promise<Widget | undefined>;
|
|
29
|
+
addItem(command: Command, area: ToolbarAlignment): Promise<boolean>;
|
|
30
|
+
removeItem(position: ToolbarItemPosition, id?: string): Promise<boolean>;
|
|
31
|
+
moveItemToEmptySpace(draggedItemPosition: ToolbarItemPosition, column: ToolbarAlignment, centerPosition?: 'left' | 'right'): Promise<boolean>;
|
|
32
|
+
insertGroup(position: ToolbarItemPosition, insertDirection: 'left' | 'right'): Promise<boolean>;
|
|
33
|
+
withBusy<T = unknown>(action: () => MaybePromise<T>): Promise<T>;
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=toolbar-controller.d.ts.map
|