@theia/toolbar 1.45.1 → 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.
Files changed (53) hide show
  1. package/README.md +32 -32
  2. package/lib/browser/abstract-toolbar-contribution.d.ts +16 -16
  3. package/lib/browser/abstract-toolbar-contribution.js +68 -68
  4. package/lib/browser/application-shell-with-toolbar-override.d.ts +15 -15
  5. package/lib/browser/application-shell-with-toolbar-override.js +101 -101
  6. package/lib/browser/codicons.d.ts +1 -1
  7. package/lib/browser/codicons.js +20 -20
  8. package/lib/browser/font-awesome-icons.d.ts +1 -1
  9. package/lib/browser/font-awesome-icons.js +20 -20
  10. package/lib/browser/package.spec.js +18 -18
  11. package/lib/browser/toolbar-command-contribution.d.ts +25 -25
  12. package/lib/browser/toolbar-command-contribution.js +211 -211
  13. package/lib/browser/toolbar-command-quick-input-service.d.ts +19 -19
  14. package/lib/browser/toolbar-command-quick-input-service.js +112 -112
  15. package/lib/browser/toolbar-constants.d.ts +23 -23
  16. package/lib/browser/toolbar-constants.js +75 -75
  17. package/lib/browser/toolbar-controller.d.ts +34 -34
  18. package/lib/browser/toolbar-controller.js +186 -186
  19. package/lib/browser/toolbar-defaults.d.ts +3 -3
  20. package/lib/browser/toolbar-defaults.js +60 -60
  21. package/lib/browser/toolbar-frontend-module.d.ts +4 -4
  22. package/lib/browser/toolbar-frontend-module.js +25 -25
  23. package/lib/browser/toolbar-icon-selector-dialog.d.ts +65 -65
  24. package/lib/browser/toolbar-icon-selector-dialog.js +235 -235
  25. package/lib/browser/toolbar-interfaces.d.ts +45 -45
  26. package/lib/browser/toolbar-interfaces.js +42 -42
  27. package/lib/browser/toolbar-preference-contribution.d.ts +9 -9
  28. package/lib/browser/toolbar-preference-contribution.js +34 -34
  29. package/lib/browser/toolbar-preference-schema.d.ts +5 -5
  30. package/lib/browser/toolbar-preference-schema.js +73 -73
  31. package/lib/browser/toolbar-storage-provider.d.ts +47 -47
  32. package/lib/browser/toolbar-storage-provider.js +357 -357
  33. package/lib/browser/toolbar.d.ts +56 -56
  34. package/lib/browser/toolbar.js +380 -380
  35. package/package.json +11 -11
  36. package/src/browser/abstract-toolbar-contribution.tsx +53 -53
  37. package/src/browser/application-shell-with-toolbar-override.ts +98 -98
  38. package/src/browser/codicons.ts +18 -18
  39. package/src/browser/font-awesome-icons.ts +18 -18
  40. package/src/browser/package.spec.ts +19 -19
  41. package/src/browser/style/toolbar.css +255 -255
  42. package/src/browser/toolbar-command-contribution.ts +211 -211
  43. package/src/browser/toolbar-command-quick-input-service.ts +86 -86
  44. package/src/browser/toolbar-constants.ts +79 -79
  45. package/src/browser/toolbar-controller.ts +185 -185
  46. package/src/browser/toolbar-defaults.ts +58 -58
  47. package/src/browser/toolbar-frontend-module.ts +30 -30
  48. package/src/browser/toolbar-icon-selector-dialog.tsx +296 -296
  49. package/src/browser/toolbar-interfaces.ts +76 -76
  50. package/src/browser/toolbar-preference-contribution.ts +38 -38
  51. package/src/browser/toolbar-preference-schema.ts +75 -75
  52. package/src/browser/toolbar-storage-provider.ts +352 -352
  53. package/src/browser/toolbar.tsx +424 -424
@@ -1,187 +1,187 @@
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.ToolbarController = void 0;
28
- const core_1 = require("@theia/core");
29
- const frontend_application_state_1 = require("@theia/core/lib/browser/frontend-application-state");
30
- const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
31
- const promise_util_1 = require("@theia/core/lib/common/promise-util");
32
- const inversify_1 = require("@theia/core/shared/inversify");
33
- const toolbar_defaults_1 = require("./toolbar-defaults");
34
- const toolbar_interfaces_1 = require("./toolbar-interfaces");
35
- const toolbar_storage_provider_1 = require("./toolbar-storage-provider");
36
- let ToolbarController = class ToolbarController {
37
- constructor() {
38
- this.toolbarModelDidUpdateEmitter = new core_1.Emitter();
39
- this.onToolbarModelDidUpdate = this.toolbarModelDidUpdateEmitter.event;
40
- this.toolbarProviderBusyEmitter = new core_1.Emitter();
41
- this.onToolbarDidChangeBusyState = this.toolbarProviderBusyEmitter.event;
42
- this.ready = new promise_util_1.Deferred();
43
- }
44
- get toolbarItems() {
45
- return this._toolbarItems;
46
- }
47
- set toolbarItems(newTree) {
48
- this._toolbarItems = newTree;
49
- this.toolbarModelDidUpdateEmitter.fire();
50
- }
51
- inflateItems(schema) {
52
- const newTree = {
53
- items: {
54
- [toolbar_interfaces_1.ToolbarAlignment.LEFT]: [],
55
- [toolbar_interfaces_1.ToolbarAlignment.CENTER]: [],
56
- [toolbar_interfaces_1.ToolbarAlignment.RIGHT]: [],
57
- },
58
- };
59
- for (const column of Object.keys(schema.items)) {
60
- const currentColumn = schema.items[column];
61
- for (const group of currentColumn) {
62
- const newGroup = [];
63
- for (const item of group) {
64
- if (item.group === 'contributed') {
65
- const contribution = this.getContributionByID(item.id);
66
- if (contribution) {
67
- newGroup.push(contribution);
68
- }
69
- }
70
- else if (tab_bar_toolbar_1.TabBarToolbarItem.is(item)) {
71
- newGroup.push({ ...item });
72
- }
73
- }
74
- if (newGroup.length) {
75
- newTree.items[column].push(newGroup);
76
- }
77
- }
78
- }
79
- return newTree;
80
- }
81
- getContributionByID(id) {
82
- return this.widgetContributions.getContributions().find(contribution => contribution.id === id);
83
- }
84
- init() {
85
- this.doInit();
86
- }
87
- async doInit() {
88
- await this.appState.reachedState('ready');
89
- await this.storageProvider.ready;
90
- this.toolbarItems = await this.resolveToolbarItems();
91
- this.storageProvider.onToolbarItemsChanged(async () => {
92
- this.toolbarItems = await this.resolveToolbarItems();
93
- });
94
- this.ready.resolve();
95
- this.widgetContributions.getContributions().forEach(contribution => {
96
- if (contribution.onDidChange) {
97
- contribution.onDidChange(() => this.toolbarModelDidUpdateEmitter.fire());
98
- }
99
- });
100
- }
101
- async resolveToolbarItems() {
102
- await this.storageProvider.ready;
103
- if (this.storageProvider.toolbarItems) {
104
- try {
105
- return this.inflateItems(this.storageProvider.toolbarItems);
106
- }
107
- catch (e) {
108
- this.messageService.error(toolbar_storage_provider_1.TOOLBAR_BAD_JSON_ERROR_MESSAGE);
109
- }
110
- }
111
- return this.inflateItems(this.defaultsFactory());
112
- }
113
- async swapValues(oldPosition, newPosition, direction) {
114
- return this.withBusy(async () => {
115
- await this.openOrCreateJSONFile(false);
116
- return this.storageProvider.swapValues(oldPosition, newPosition, direction);
117
- });
118
- }
119
- async clearAll() {
120
- return this.withBusy(() => this.storageProvider.clearAll());
121
- }
122
- async openOrCreateJSONFile(doOpen = false) {
123
- return this.storageProvider.openOrCreateJSONFile(this.toolbarItems, doOpen);
124
- }
125
- async addItem(command, area) {
126
- return this.withBusy(async () => {
127
- await this.openOrCreateJSONFile(false);
128
- return this.storageProvider.addItem(command, area);
129
- });
130
- }
131
- async removeItem(position, id) {
132
- return this.withBusy(async () => {
133
- await this.openOrCreateJSONFile(false);
134
- return this.storageProvider.removeItem(position);
135
- });
136
- }
137
- async moveItemToEmptySpace(draggedItemPosition, column, centerPosition) {
138
- return this.withBusy(async () => {
139
- await this.openOrCreateJSONFile(false);
140
- return this.storageProvider.moveItemToEmptySpace(draggedItemPosition, column, centerPosition);
141
- });
142
- }
143
- async insertGroup(position, insertDirection) {
144
- return this.withBusy(async () => {
145
- await this.openOrCreateJSONFile(false);
146
- return this.storageProvider.insertGroup(position, insertDirection);
147
- });
148
- }
149
- async withBusy(action) {
150
- this.toolbarProviderBusyEmitter.fire(true);
151
- const toReturn = await action();
152
- this.toolbarProviderBusyEmitter.fire(false);
153
- return toReturn;
154
- }
155
- };
156
- __decorate([
157
- (0, inversify_1.inject)(toolbar_storage_provider_1.ToolbarStorageProvider),
158
- __metadata("design:type", toolbar_storage_provider_1.ToolbarStorageProvider)
159
- ], ToolbarController.prototype, "storageProvider", void 0);
160
- __decorate([
161
- (0, inversify_1.inject)(frontend_application_state_1.FrontendApplicationStateService),
162
- __metadata("design:type", frontend_application_state_1.FrontendApplicationStateService)
163
- ], ToolbarController.prototype, "appState", void 0);
164
- __decorate([
165
- (0, inversify_1.inject)(core_1.MessageService),
166
- __metadata("design:type", core_1.MessageService)
167
- ], ToolbarController.prototype, "messageService", void 0);
168
- __decorate([
169
- (0, inversify_1.inject)(toolbar_defaults_1.ToolbarDefaultsFactory),
170
- __metadata("design:type", Function)
171
- ], ToolbarController.prototype, "defaultsFactory", void 0);
172
- __decorate([
173
- (0, inversify_1.inject)(core_1.ContributionProvider),
174
- (0, inversify_1.named)(toolbar_interfaces_1.ToolbarContribution),
175
- __metadata("design:type", Object)
176
- ], ToolbarController.prototype, "widgetContributions", void 0);
177
- __decorate([
178
- (0, inversify_1.postConstruct)(),
179
- __metadata("design:type", Function),
180
- __metadata("design:paramtypes", []),
181
- __metadata("design:returntype", void 0)
182
- ], ToolbarController.prototype, "init", null);
183
- ToolbarController = __decorate([
184
- (0, inversify_1.injectable)()
185
- ], ToolbarController);
186
- exports.ToolbarController = ToolbarController;
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.ToolbarController = void 0;
28
+ const core_1 = require("@theia/core");
29
+ const frontend_application_state_1 = require("@theia/core/lib/browser/frontend-application-state");
30
+ const tab_bar_toolbar_1 = require("@theia/core/lib/browser/shell/tab-bar-toolbar");
31
+ const promise_util_1 = require("@theia/core/lib/common/promise-util");
32
+ const inversify_1 = require("@theia/core/shared/inversify");
33
+ const toolbar_defaults_1 = require("./toolbar-defaults");
34
+ const toolbar_interfaces_1 = require("./toolbar-interfaces");
35
+ const toolbar_storage_provider_1 = require("./toolbar-storage-provider");
36
+ let ToolbarController = class ToolbarController {
37
+ constructor() {
38
+ this.toolbarModelDidUpdateEmitter = new core_1.Emitter();
39
+ this.onToolbarModelDidUpdate = this.toolbarModelDidUpdateEmitter.event;
40
+ this.toolbarProviderBusyEmitter = new core_1.Emitter();
41
+ this.onToolbarDidChangeBusyState = this.toolbarProviderBusyEmitter.event;
42
+ this.ready = new promise_util_1.Deferred();
43
+ }
44
+ get toolbarItems() {
45
+ return this._toolbarItems;
46
+ }
47
+ set toolbarItems(newTree) {
48
+ this._toolbarItems = newTree;
49
+ this.toolbarModelDidUpdateEmitter.fire();
50
+ }
51
+ inflateItems(schema) {
52
+ const newTree = {
53
+ items: {
54
+ [toolbar_interfaces_1.ToolbarAlignment.LEFT]: [],
55
+ [toolbar_interfaces_1.ToolbarAlignment.CENTER]: [],
56
+ [toolbar_interfaces_1.ToolbarAlignment.RIGHT]: [],
57
+ },
58
+ };
59
+ for (const column of Object.keys(schema.items)) {
60
+ const currentColumn = schema.items[column];
61
+ for (const group of currentColumn) {
62
+ const newGroup = [];
63
+ for (const item of group) {
64
+ if (item.group === 'contributed') {
65
+ const contribution = this.getContributionByID(item.id);
66
+ if (contribution) {
67
+ newGroup.push(contribution);
68
+ }
69
+ }
70
+ else if (tab_bar_toolbar_1.TabBarToolbarItem.is(item)) {
71
+ newGroup.push({ ...item });
72
+ }
73
+ }
74
+ if (newGroup.length) {
75
+ newTree.items[column].push(newGroup);
76
+ }
77
+ }
78
+ }
79
+ return newTree;
80
+ }
81
+ getContributionByID(id) {
82
+ return this.widgetContributions.getContributions().find(contribution => contribution.id === id);
83
+ }
84
+ init() {
85
+ this.doInit();
86
+ }
87
+ async doInit() {
88
+ await this.appState.reachedState('ready');
89
+ await this.storageProvider.ready;
90
+ this.toolbarItems = await this.resolveToolbarItems();
91
+ this.storageProvider.onToolbarItemsChanged(async () => {
92
+ this.toolbarItems = await this.resolveToolbarItems();
93
+ });
94
+ this.ready.resolve();
95
+ this.widgetContributions.getContributions().forEach(contribution => {
96
+ if (contribution.onDidChange) {
97
+ contribution.onDidChange(() => this.toolbarModelDidUpdateEmitter.fire());
98
+ }
99
+ });
100
+ }
101
+ async resolveToolbarItems() {
102
+ await this.storageProvider.ready;
103
+ if (this.storageProvider.toolbarItems) {
104
+ try {
105
+ return this.inflateItems(this.storageProvider.toolbarItems);
106
+ }
107
+ catch (e) {
108
+ this.messageService.error(toolbar_storage_provider_1.TOOLBAR_BAD_JSON_ERROR_MESSAGE);
109
+ }
110
+ }
111
+ return this.inflateItems(this.defaultsFactory());
112
+ }
113
+ async swapValues(oldPosition, newPosition, direction) {
114
+ return this.withBusy(async () => {
115
+ await this.openOrCreateJSONFile(false);
116
+ return this.storageProvider.swapValues(oldPosition, newPosition, direction);
117
+ });
118
+ }
119
+ async clearAll() {
120
+ return this.withBusy(() => this.storageProvider.clearAll());
121
+ }
122
+ async openOrCreateJSONFile(doOpen = false) {
123
+ return this.storageProvider.openOrCreateJSONFile(this.toolbarItems, doOpen);
124
+ }
125
+ async addItem(command, area) {
126
+ return this.withBusy(async () => {
127
+ await this.openOrCreateJSONFile(false);
128
+ return this.storageProvider.addItem(command, area);
129
+ });
130
+ }
131
+ async removeItem(position, id) {
132
+ return this.withBusy(async () => {
133
+ await this.openOrCreateJSONFile(false);
134
+ return this.storageProvider.removeItem(position);
135
+ });
136
+ }
137
+ async moveItemToEmptySpace(draggedItemPosition, column, centerPosition) {
138
+ return this.withBusy(async () => {
139
+ await this.openOrCreateJSONFile(false);
140
+ return this.storageProvider.moveItemToEmptySpace(draggedItemPosition, column, centerPosition);
141
+ });
142
+ }
143
+ async insertGroup(position, insertDirection) {
144
+ return this.withBusy(async () => {
145
+ await this.openOrCreateJSONFile(false);
146
+ return this.storageProvider.insertGroup(position, insertDirection);
147
+ });
148
+ }
149
+ async withBusy(action) {
150
+ this.toolbarProviderBusyEmitter.fire(true);
151
+ const toReturn = await action();
152
+ this.toolbarProviderBusyEmitter.fire(false);
153
+ return toReturn;
154
+ }
155
+ };
156
+ __decorate([
157
+ (0, inversify_1.inject)(toolbar_storage_provider_1.ToolbarStorageProvider),
158
+ __metadata("design:type", toolbar_storage_provider_1.ToolbarStorageProvider)
159
+ ], ToolbarController.prototype, "storageProvider", void 0);
160
+ __decorate([
161
+ (0, inversify_1.inject)(frontend_application_state_1.FrontendApplicationStateService),
162
+ __metadata("design:type", frontend_application_state_1.FrontendApplicationStateService)
163
+ ], ToolbarController.prototype, "appState", void 0);
164
+ __decorate([
165
+ (0, inversify_1.inject)(core_1.MessageService),
166
+ __metadata("design:type", core_1.MessageService)
167
+ ], ToolbarController.prototype, "messageService", void 0);
168
+ __decorate([
169
+ (0, inversify_1.inject)(toolbar_defaults_1.ToolbarDefaultsFactory),
170
+ __metadata("design:type", Function)
171
+ ], ToolbarController.prototype, "defaultsFactory", void 0);
172
+ __decorate([
173
+ (0, inversify_1.inject)(core_1.ContributionProvider),
174
+ (0, inversify_1.named)(toolbar_interfaces_1.ToolbarContribution),
175
+ __metadata("design:type", Object)
176
+ ], ToolbarController.prototype, "widgetContributions", void 0);
177
+ __decorate([
178
+ (0, inversify_1.postConstruct)(),
179
+ __metadata("design:type", Function),
180
+ __metadata("design:paramtypes", []),
181
+ __metadata("design:returntype", void 0)
182
+ ], ToolbarController.prototype, "init", null);
183
+ ToolbarController = __decorate([
184
+ (0, inversify_1.injectable)()
185
+ ], ToolbarController);
186
+ exports.ToolbarController = ToolbarController;
187
187
  //# sourceMappingURL=toolbar-controller.js.map
@@ -1,4 +1,4 @@
1
- import { DeflatedToolbarTree } from './toolbar-interfaces';
2
- export declare const ToolbarDefaultsFactory: unique symbol;
3
- export declare const ToolbarDefaults: () => DeflatedToolbarTree;
1
+ import { DeflatedToolbarTree } from './toolbar-interfaces';
2
+ export declare const ToolbarDefaultsFactory: unique symbol;
3
+ export declare const ToolbarDefaults: () => DeflatedToolbarTree;
4
4
  //# sourceMappingURL=toolbar-defaults.d.ts.map
@@ -1,61 +1,61 @@
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.ToolbarDefaults = exports.ToolbarDefaultsFactory = void 0;
19
- const core_1 = require("@theia/core");
20
- const toolbar_interfaces_1 = require("./toolbar-interfaces");
21
- // This file specifies the default layout of the toolbar. This binding should be overridden for extenders.
22
- // Both Toolbar Command Items and Toolbar Contributions can be specified here.
23
- exports.ToolbarDefaultsFactory = Symbol('ToolbarDefaultsFactory');
24
- const ToolbarDefaults = () => ({
25
- items: {
26
- [toolbar_interfaces_1.ToolbarAlignment.LEFT]: [
27
- [
28
- {
29
- id: 'textEditor.commands.go.back',
30
- command: 'textEditor.commands.go.back',
31
- icon: 'codicon codicon-arrow-left',
32
- },
33
- {
34
- id: 'textEditor.commands.go.forward',
35
- command: 'textEditor.commands.go.forward',
36
- icon: 'codicon codicon-arrow-right',
37
- },
38
- ],
39
- [
40
- {
41
- id: 'workbench.action.splitEditorRight',
42
- command: 'workbench.action.splitEditorRight',
43
- icon: 'codicon codicon-split-horizontal',
44
- },
45
- ],
46
- ],
47
- [toolbar_interfaces_1.ToolbarAlignment.CENTER]: [[]],
48
- [toolbar_interfaces_1.ToolbarAlignment.RIGHT]: [
49
- [
50
- {
51
- id: 'workbench.action.showCommands',
52
- command: 'workbench.action.showCommands',
53
- icon: 'codicon codicon-terminal',
54
- tooltip: core_1.nls.localizeByDefault('Command Palette'),
55
- },
56
- ]
57
- ]
58
- },
59
- });
60
- exports.ToolbarDefaults = ToolbarDefaults;
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.ToolbarDefaults = exports.ToolbarDefaultsFactory = void 0;
19
+ const core_1 = require("@theia/core");
20
+ const toolbar_interfaces_1 = require("./toolbar-interfaces");
21
+ // This file specifies the default layout of the toolbar. This binding should be overridden for extenders.
22
+ // Both Toolbar Command Items and Toolbar Contributions can be specified here.
23
+ exports.ToolbarDefaultsFactory = Symbol('ToolbarDefaultsFactory');
24
+ const ToolbarDefaults = () => ({
25
+ items: {
26
+ [toolbar_interfaces_1.ToolbarAlignment.LEFT]: [
27
+ [
28
+ {
29
+ id: 'textEditor.commands.go.back',
30
+ command: 'textEditor.commands.go.back',
31
+ icon: 'codicon codicon-arrow-left',
32
+ },
33
+ {
34
+ id: 'textEditor.commands.go.forward',
35
+ command: 'textEditor.commands.go.forward',
36
+ icon: 'codicon codicon-arrow-right',
37
+ },
38
+ ],
39
+ [
40
+ {
41
+ id: 'workbench.action.splitEditorRight',
42
+ command: 'workbench.action.splitEditorRight',
43
+ icon: 'codicon codicon-split-horizontal',
44
+ },
45
+ ],
46
+ ],
47
+ [toolbar_interfaces_1.ToolbarAlignment.CENTER]: [[]],
48
+ [toolbar_interfaces_1.ToolbarAlignment.RIGHT]: [
49
+ [
50
+ {
51
+ id: 'workbench.action.showCommands',
52
+ command: 'workbench.action.showCommands',
53
+ icon: 'codicon codicon-terminal',
54
+ tooltip: core_1.nls.localizeByDefault('Command Palette'),
55
+ },
56
+ ]
57
+ ]
58
+ },
59
+ });
60
+ exports.ToolbarDefaults = ToolbarDefaults;
61
61
  //# sourceMappingURL=toolbar-defaults.js.map
@@ -1,5 +1,5 @@
1
- import '../../src/browser/style/toolbar.css';
2
- import { ContainerModule } from '@theia/core/shared/inversify';
3
- declare const _default: ContainerModule;
4
- export default _default;
1
+ import '../../src/browser/style/toolbar.css';
2
+ import { ContainerModule } from '@theia/core/shared/inversify';
3
+ declare const _default: ContainerModule;
4
+ export default _default;
5
5
  //# sourceMappingURL=toolbar-frontend-module.d.ts.map
@@ -1,26 +1,26 @@
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
- require("../../src/browser/style/toolbar.css");
19
- const inversify_1 = require("@theia/core/shared/inversify");
20
- const application_shell_with_toolbar_override_1 = require("./application-shell-with-toolbar-override");
21
- const toolbar_command_contribution_1 = require("./toolbar-command-contribution");
22
- exports.default = new inversify_1.ContainerModule((bind, unbind, _isBound, rebind) => {
23
- (0, application_shell_with_toolbar_override_1.bindToolbarApplicationShell)(bind, rebind, unbind);
24
- (0, toolbar_command_contribution_1.bindToolbar)(bind);
25
- });
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
+ require("../../src/browser/style/toolbar.css");
19
+ const inversify_1 = require("@theia/core/shared/inversify");
20
+ const application_shell_with_toolbar_override_1 = require("./application-shell-with-toolbar-override");
21
+ const toolbar_command_contribution_1 = require("./toolbar-command-contribution");
22
+ exports.default = new inversify_1.ContainerModule((bind, unbind, _isBound, rebind) => {
23
+ (0, application_shell_with_toolbar_override_1.bindToolbarApplicationShell)(bind, rebind, unbind);
24
+ (0, toolbar_command_contribution_1.bindToolbar)(bind);
25
+ });
26
26
  //# sourceMappingURL=toolbar-frontend-module.js.map