@theia/editor-preview 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 +52 -52
- package/lib/browser/editor-preview-contribution.d.ts +12 -12
- package/lib/browser/editor-preview-contribution.js +79 -79
- package/lib/browser/editor-preview-frontend-module.d.ts +4 -4
- package/lib/browser/editor-preview-frontend-module.js +42 -42
- package/lib/browser/editor-preview-manager.d.ts +24 -24
- package/lib/browser/editor-preview-manager.js +142 -142
- package/lib/browser/editor-preview-preferences.d.ts +11 -11
- package/lib/browser/editor-preview-preferences.js +47 -47
- package/lib/browser/editor-preview-tree-decorator.d.ts +23 -23
- package/lib/browser/editor-preview-tree-decorator.js +110 -110
- package/lib/browser/editor-preview-widget-factory.d.ts +13 -13
- package/lib/browser/editor-preview-widget-factory.js +52 -52
- package/lib/browser/editor-preview-widget.d.ts +21 -21
- package/lib/browser/editor-preview-widget.js +84 -84
- package/lib/package.spec.js +25 -25
- package/package.json +6 -6
- package/src/browser/editor-preview-contribution.ts +67 -67
- package/src/browser/editor-preview-frontend-module.ts +46 -46
- package/src/browser/editor-preview-manager.ts +125 -125
- package/src/browser/editor-preview-preferences.ts +53 -53
- package/src/browser/editor-preview-tree-decorator.ts +107 -107
- package/src/browser/editor-preview-widget-factory.ts +45 -45
- package/src/browser/editor-preview-widget.ts +90 -90
- package/src/browser/style/editor-preview-widget.css +23 -23
- package/src/browser/style/index.css +17 -17
- package/src/package.spec.ts +28 -28
package/README.md
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
<div align='center'>
|
|
2
|
-
|
|
3
|
-
<br />
|
|
4
|
-
|
|
5
|
-
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
-
|
|
7
|
-
<h2>ECLIPSE THEIA - EDITOR-PREVIEW EXTENSION</h2>
|
|
8
|
-
|
|
9
|
-
<hr />
|
|
10
|
-
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
## Description
|
|
14
|
-
|
|
15
|
-
The `@theia/editor-preview` extension contributes the preview editor which supports the same functionality as a regular editor widget with the exception:
|
|
16
|
-
- if a preview editor has not "transitioned to a permanent editor" at the time an additional request to
|
|
17
|
-
preview a file is received, instead of opening a new editor, it will display the contents of the
|
|
18
|
-
newly requested file.
|
|
19
|
-
|
|
20
|
-
Events that will transition the preview to a permanent editor are as follows:
|
|
21
|
-
* Modifying file contents being previewed
|
|
22
|
-
* Double clicking the preview tab
|
|
23
|
-
* Performing a drag/drop operation of the editor preview tab resulting in the tab being moved.
|
|
24
|
-
* Issuing a request to open the file being previewed (e.g. double clicking the file in the
|
|
25
|
-
navigator)
|
|
26
|
-
|
|
27
|
-
The preview editor is enabled by default when the extension is included in a Theia application, but
|
|
28
|
-
may be disabled by modifying the preference:
|
|
29
|
-
```json
|
|
30
|
-
editor.enablePreview
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
In addition to this value, the preference:
|
|
34
|
-
```json
|
|
35
|
-
list.openMode
|
|
36
|
-
```
|
|
37
|
-
must be set to "singleClick" to enable opening files in preview mode.
|
|
38
|
-
|
|
39
|
-
## Additional Information
|
|
40
|
-
|
|
41
|
-
- [API documentation for `@theia/editor-preview`](https://eclipse-theia.github.io/theia/docs/next/modules/editor_preview.html)
|
|
42
|
-
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
43
|
-
- [Theia - Website](https://theia-ide.org/)
|
|
44
|
-
|
|
45
|
-
## License
|
|
46
|
-
|
|
47
|
-
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
48
|
-
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
49
|
-
|
|
50
|
-
## Trademark
|
|
51
|
-
"Theia" is a trademark of the Eclipse Foundation
|
|
52
|
-
https://www.eclipse.org/theia
|
|
1
|
+
<div align='center'>
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
+
|
|
7
|
+
<h2>ECLIPSE THEIA - EDITOR-PREVIEW EXTENSION</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/editor-preview` extension contributes the preview editor which supports the same functionality as a regular editor widget with the exception:
|
|
16
|
+
- if a preview editor has not "transitioned to a permanent editor" at the time an additional request to
|
|
17
|
+
preview a file is received, instead of opening a new editor, it will display the contents of the
|
|
18
|
+
newly requested file.
|
|
19
|
+
|
|
20
|
+
Events that will transition the preview to a permanent editor are as follows:
|
|
21
|
+
* Modifying file contents being previewed
|
|
22
|
+
* Double clicking the preview tab
|
|
23
|
+
* Performing a drag/drop operation of the editor preview tab resulting in the tab being moved.
|
|
24
|
+
* Issuing a request to open the file being previewed (e.g. double clicking the file in the
|
|
25
|
+
navigator)
|
|
26
|
+
|
|
27
|
+
The preview editor is enabled by default when the extension is included in a Theia application, but
|
|
28
|
+
may be disabled by modifying the preference:
|
|
29
|
+
```json
|
|
30
|
+
editor.enablePreview
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
In addition to this value, the preference:
|
|
34
|
+
```json
|
|
35
|
+
list.openMode
|
|
36
|
+
```
|
|
37
|
+
must be set to "singleClick" to enable opening files in preview mode.
|
|
38
|
+
|
|
39
|
+
## Additional Information
|
|
40
|
+
|
|
41
|
+
- [API documentation for `@theia/editor-preview`](https://eclipse-theia.github.io/theia/docs/next/modules/editor_preview.html)
|
|
42
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
43
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
48
|
+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
49
|
+
|
|
50
|
+
## Trademark
|
|
51
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
52
|
+
https://www.eclipse.org/theia
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ApplicationShell, KeybindingContribution, KeybindingRegistry, Widget } from '@theia/core/lib/browser';
|
|
2
|
-
import { Command, CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core/lib/common';
|
|
3
|
-
export declare namespace EditorPreviewCommands {
|
|
4
|
-
const PIN_PREVIEW_COMMAND: Command;
|
|
5
|
-
}
|
|
6
|
-
export declare class EditorPreviewContribution implements CommandContribution, MenuContribution, KeybindingContribution {
|
|
7
|
-
protected readonly shell: ApplicationShell;
|
|
8
|
-
registerCommands(registry: CommandRegistry): void;
|
|
9
|
-
registerKeybindings(registry: KeybindingRegistry): void;
|
|
10
|
-
registerMenus(registry: MenuModelRegistry): void;
|
|
11
|
-
protected getTargetWidget(event?: Event): Widget | undefined;
|
|
12
|
-
}
|
|
1
|
+
import { ApplicationShell, KeybindingContribution, KeybindingRegistry, Widget } from '@theia/core/lib/browser';
|
|
2
|
+
import { Command, CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core/lib/common';
|
|
3
|
+
export declare namespace EditorPreviewCommands {
|
|
4
|
+
const PIN_PREVIEW_COMMAND: Command;
|
|
5
|
+
}
|
|
6
|
+
export declare class EditorPreviewContribution implements CommandContribution, MenuContribution, KeybindingContribution {
|
|
7
|
+
protected readonly shell: ApplicationShell;
|
|
8
|
+
registerCommands(registry: CommandRegistry): void;
|
|
9
|
+
registerKeybindings(registry: KeybindingRegistry): void;
|
|
10
|
+
registerMenus(registry: MenuModelRegistry): void;
|
|
11
|
+
protected getTargetWidget(event?: Event): Widget | undefined;
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=editor-preview-contribution.d.ts.map
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 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.EditorPreviewContribution = exports.EditorPreviewCommands = void 0;
|
|
28
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
29
|
-
const nls_1 = require("@theia/core/lib/common/nls");
|
|
30
|
-
const common_1 = require("@theia/core/lib/common");
|
|
31
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
|
-
const editor_preview_widget_1 = require("./editor-preview-widget");
|
|
33
|
-
const current_widget_command_adapter_1 = require("@theia/core/lib/browser/shell/current-widget-command-adapter");
|
|
34
|
-
var EditorPreviewCommands;
|
|
35
|
-
(function (EditorPreviewCommands) {
|
|
36
|
-
EditorPreviewCommands.PIN_PREVIEW_COMMAND = common_1.Command.toDefaultLocalizedCommand({
|
|
37
|
-
id: 'workbench.action.keepEditor',
|
|
38
|
-
category: browser_1.CommonCommands.VIEW_CATEGORY,
|
|
39
|
-
label: 'Keep Editor',
|
|
40
|
-
});
|
|
41
|
-
})(EditorPreviewCommands = exports.EditorPreviewCommands || (exports.EditorPreviewCommands = {}));
|
|
42
|
-
let EditorPreviewContribution = class EditorPreviewContribution {
|
|
43
|
-
registerCommands(registry) {
|
|
44
|
-
registry.registerCommand(EditorPreviewCommands.PIN_PREVIEW_COMMAND, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
45
|
-
execute: async (title) => {
|
|
46
|
-
if ((title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget) {
|
|
47
|
-
title.owner.convertToNonPreview();
|
|
48
|
-
await this.shell.activateWidget(title.owner.id);
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
isEnabled: title => (title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget && title.owner.isPreview,
|
|
52
|
-
isVisible: title => (title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget,
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
registerKeybindings(registry) {
|
|
56
|
-
registry.registerKeybinding({
|
|
57
|
-
command: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
|
|
58
|
-
keybinding: 'ctrlcmd+k enter'
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
registerMenus(registry) {
|
|
62
|
-
registry.registerMenuAction(browser_1.SHELL_TABBAR_CONTEXT_PIN, {
|
|
63
|
-
commandId: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
|
|
64
|
-
label: nls_1.nls.localizeByDefault('Keep Open'),
|
|
65
|
-
order: '6',
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
getTargetWidget(event) {
|
|
69
|
-
return event ? this.shell.findTargetedWidget(event) : this.shell.activeWidget;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, inversify_1.inject)(browser_1.ApplicationShell),
|
|
74
|
-
__metadata("design:type", browser_1.ApplicationShell)
|
|
75
|
-
], EditorPreviewContribution.prototype, "shell", void 0);
|
|
76
|
-
EditorPreviewContribution = __decorate([
|
|
77
|
-
(0, inversify_1.injectable)()
|
|
78
|
-
], EditorPreviewContribution);
|
|
79
|
-
exports.EditorPreviewContribution = EditorPreviewContribution;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 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.EditorPreviewContribution = exports.EditorPreviewCommands = void 0;
|
|
28
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
29
|
+
const nls_1 = require("@theia/core/lib/common/nls");
|
|
30
|
+
const common_1 = require("@theia/core/lib/common");
|
|
31
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
|
+
const editor_preview_widget_1 = require("./editor-preview-widget");
|
|
33
|
+
const current_widget_command_adapter_1 = require("@theia/core/lib/browser/shell/current-widget-command-adapter");
|
|
34
|
+
var EditorPreviewCommands;
|
|
35
|
+
(function (EditorPreviewCommands) {
|
|
36
|
+
EditorPreviewCommands.PIN_PREVIEW_COMMAND = common_1.Command.toDefaultLocalizedCommand({
|
|
37
|
+
id: 'workbench.action.keepEditor',
|
|
38
|
+
category: browser_1.CommonCommands.VIEW_CATEGORY,
|
|
39
|
+
label: 'Keep Editor',
|
|
40
|
+
});
|
|
41
|
+
})(EditorPreviewCommands = exports.EditorPreviewCommands || (exports.EditorPreviewCommands = {}));
|
|
42
|
+
let EditorPreviewContribution = class EditorPreviewContribution {
|
|
43
|
+
registerCommands(registry) {
|
|
44
|
+
registry.registerCommand(EditorPreviewCommands.PIN_PREVIEW_COMMAND, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
|
|
45
|
+
execute: async (title) => {
|
|
46
|
+
if ((title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget) {
|
|
47
|
+
title.owner.convertToNonPreview();
|
|
48
|
+
await this.shell.activateWidget(title.owner.id);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
isEnabled: title => (title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget && title.owner.isPreview,
|
|
52
|
+
isVisible: title => (title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget,
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
registerKeybindings(registry) {
|
|
56
|
+
registry.registerKeybinding({
|
|
57
|
+
command: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
|
|
58
|
+
keybinding: 'ctrlcmd+k enter'
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
registerMenus(registry) {
|
|
62
|
+
registry.registerMenuAction(browser_1.SHELL_TABBAR_CONTEXT_PIN, {
|
|
63
|
+
commandId: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
|
|
64
|
+
label: nls_1.nls.localizeByDefault('Keep Open'),
|
|
65
|
+
order: '6',
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
getTargetWidget(event) {
|
|
69
|
+
return event ? this.shell.findTargetedWidget(event) : this.shell.activeWidget;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, inversify_1.inject)(browser_1.ApplicationShell),
|
|
74
|
+
__metadata("design:type", browser_1.ApplicationShell)
|
|
75
|
+
], EditorPreviewContribution.prototype, "shell", void 0);
|
|
76
|
+
EditorPreviewContribution = __decorate([
|
|
77
|
+
(0, inversify_1.injectable)()
|
|
78
|
+
], EditorPreviewContribution);
|
|
79
|
+
exports.EditorPreviewContribution = EditorPreviewContribution;
|
|
80
80
|
//# sourceMappingURL=editor-preview-contribution.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../../src/browser/style/index.css';
|
|
2
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
3
|
-
declare const _default: ContainerModule;
|
|
4
|
-
export default _default;
|
|
1
|
+
import '../../src/browser/style/index.css';
|
|
2
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
3
|
+
declare const _default: ContainerModule;
|
|
4
|
+
export default _default;
|
|
5
5
|
//# sourceMappingURL=editor-preview-frontend-module.d.ts.map
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018-2021 Google 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/index.css");
|
|
19
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const editor_preview_preferences_1 = require("./editor-preview-preferences");
|
|
22
|
-
const editor_preview_manager_1 = require("./editor-preview-manager");
|
|
23
|
-
const browser_2 = require("@theia/editor/lib/browser");
|
|
24
|
-
const editor_preview_widget_factory_1 = require("./editor-preview-widget-factory");
|
|
25
|
-
const editor_preview_contribution_1 = require("./editor-preview-contribution");
|
|
26
|
-
const common_1 = require("@theia/core/lib/common");
|
|
27
|
-
const navigator_open_editors_decorator_service_1 = require("@theia/navigator/lib/browser/open-editors-widget/navigator-open-editors-decorator-service");
|
|
28
|
-
const editor_preview_tree_decorator_1 = require("./editor-preview-tree-decorator");
|
|
29
|
-
exports.default = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
30
|
-
bind(editor_preview_widget_factory_1.EditorPreviewWidgetFactory).toSelf().inSingletonScope();
|
|
31
|
-
bind(browser_1.WidgetFactory).toService(editor_preview_widget_factory_1.EditorPreviewWidgetFactory);
|
|
32
|
-
bind(editor_preview_manager_1.EditorPreviewManager).toSelf().inSingletonScope();
|
|
33
|
-
rebind(browser_2.EditorManager).toService(editor_preview_manager_1.EditorPreviewManager);
|
|
34
|
-
bind(editor_preview_contribution_1.EditorPreviewContribution).toSelf().inSingletonScope();
|
|
35
|
-
bind(common_1.CommandContribution).toService(editor_preview_contribution_1.EditorPreviewContribution);
|
|
36
|
-
bind(browser_1.KeybindingContribution).toService(editor_preview_contribution_1.EditorPreviewContribution);
|
|
37
|
-
bind(common_1.MenuContribution).toService(editor_preview_contribution_1.EditorPreviewContribution);
|
|
38
|
-
bind(editor_preview_tree_decorator_1.EditorPreviewTreeDecorator).toSelf().inSingletonScope();
|
|
39
|
-
bind(navigator_open_editors_decorator_service_1.OpenEditorsTreeDecorator).toService(editor_preview_tree_decorator_1.EditorPreviewTreeDecorator);
|
|
40
|
-
bind(browser_1.FrontendApplicationContribution).toService(editor_preview_tree_decorator_1.EditorPreviewTreeDecorator);
|
|
41
|
-
(0, editor_preview_preferences_1.bindEditorPreviewPreferences)(bind);
|
|
42
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2018-2021 Google 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/index.css");
|
|
19
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const editor_preview_preferences_1 = require("./editor-preview-preferences");
|
|
22
|
+
const editor_preview_manager_1 = require("./editor-preview-manager");
|
|
23
|
+
const browser_2 = require("@theia/editor/lib/browser");
|
|
24
|
+
const editor_preview_widget_factory_1 = require("./editor-preview-widget-factory");
|
|
25
|
+
const editor_preview_contribution_1 = require("./editor-preview-contribution");
|
|
26
|
+
const common_1 = require("@theia/core/lib/common");
|
|
27
|
+
const navigator_open_editors_decorator_service_1 = require("@theia/navigator/lib/browser/open-editors-widget/navigator-open-editors-decorator-service");
|
|
28
|
+
const editor_preview_tree_decorator_1 = require("./editor-preview-tree-decorator");
|
|
29
|
+
exports.default = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
30
|
+
bind(editor_preview_widget_factory_1.EditorPreviewWidgetFactory).toSelf().inSingletonScope();
|
|
31
|
+
bind(browser_1.WidgetFactory).toService(editor_preview_widget_factory_1.EditorPreviewWidgetFactory);
|
|
32
|
+
bind(editor_preview_manager_1.EditorPreviewManager).toSelf().inSingletonScope();
|
|
33
|
+
rebind(browser_2.EditorManager).toService(editor_preview_manager_1.EditorPreviewManager);
|
|
34
|
+
bind(editor_preview_contribution_1.EditorPreviewContribution).toSelf().inSingletonScope();
|
|
35
|
+
bind(common_1.CommandContribution).toService(editor_preview_contribution_1.EditorPreviewContribution);
|
|
36
|
+
bind(browser_1.KeybindingContribution).toService(editor_preview_contribution_1.EditorPreviewContribution);
|
|
37
|
+
bind(common_1.MenuContribution).toService(editor_preview_contribution_1.EditorPreviewContribution);
|
|
38
|
+
bind(editor_preview_tree_decorator_1.EditorPreviewTreeDecorator).toSelf().inSingletonScope();
|
|
39
|
+
bind(navigator_open_editors_decorator_service_1.OpenEditorsTreeDecorator).toService(editor_preview_tree_decorator_1.EditorPreviewTreeDecorator);
|
|
40
|
+
bind(browser_1.FrontendApplicationContribution).toService(editor_preview_tree_decorator_1.EditorPreviewTreeDecorator);
|
|
41
|
+
(0, editor_preview_preferences_1.bindEditorPreviewPreferences)(bind);
|
|
42
|
+
});
|
|
43
43
|
//# sourceMappingURL=editor-preview-frontend-module.js.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { EditorManager, EditorOpenerOptions, EditorWidget } from '@theia/editor/lib/browser';
|
|
2
|
-
import { EditorPreviewPreferences } from './editor-preview-preferences';
|
|
3
|
-
import { MaybePromise } from '@theia/core/lib/common';
|
|
4
|
-
import URI from '@theia/core/lib/common/uri';
|
|
5
|
-
import { EditorPreviewOptions } from './editor-preview-widget-factory';
|
|
6
|
-
import { EditorPreviewWidget } from './editor-preview-widget';
|
|
7
|
-
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
|
8
|
-
export declare class EditorPreviewManager extends EditorManager {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
protected readonly preferences: EditorPreviewPreferences;
|
|
11
|
-
protected readonly stateService: FrontendApplicationStateService;
|
|
12
|
-
/**
|
|
13
|
-
* Until the layout has been restored, widget state is not reliable, so we ignore creation events.
|
|
14
|
-
*/
|
|
15
|
-
protected layoutIsSet: boolean;
|
|
16
|
-
protected init(): void;
|
|
17
|
-
protected doOpen(widget: EditorPreviewWidget, options?: EditorOpenerOptions): Promise<void>;
|
|
18
|
-
protected handleNewPreview(newPreviewWidget: EditorPreviewWidget): void;
|
|
19
|
-
protected tryGetPendingWidget(uri: URI, options?: EditorOpenerOptions): MaybePromise<EditorWidget> | undefined;
|
|
20
|
-
protected getWidget(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget | undefined>;
|
|
21
|
-
protected getOrCreateWidget(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
22
|
-
protected createWidgetOptions(uri: URI, options?: EditorOpenerOptions): EditorPreviewOptions;
|
|
23
|
-
protected convertEditorOnDoubleClick(event: Event): void;
|
|
24
|
-
}
|
|
1
|
+
import { EditorManager, EditorOpenerOptions, EditorWidget } from '@theia/editor/lib/browser';
|
|
2
|
+
import { EditorPreviewPreferences } from './editor-preview-preferences';
|
|
3
|
+
import { MaybePromise } from '@theia/core/lib/common';
|
|
4
|
+
import URI from '@theia/core/lib/common/uri';
|
|
5
|
+
import { EditorPreviewOptions } from './editor-preview-widget-factory';
|
|
6
|
+
import { EditorPreviewWidget } from './editor-preview-widget';
|
|
7
|
+
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
|
8
|
+
export declare class EditorPreviewManager extends EditorManager {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
protected readonly preferences: EditorPreviewPreferences;
|
|
11
|
+
protected readonly stateService: FrontendApplicationStateService;
|
|
12
|
+
/**
|
|
13
|
+
* Until the layout has been restored, widget state is not reliable, so we ignore creation events.
|
|
14
|
+
*/
|
|
15
|
+
protected layoutIsSet: boolean;
|
|
16
|
+
protected init(): void;
|
|
17
|
+
protected doOpen(widget: EditorPreviewWidget, options?: EditorOpenerOptions): Promise<void>;
|
|
18
|
+
protected handleNewPreview(newPreviewWidget: EditorPreviewWidget): void;
|
|
19
|
+
protected tryGetPendingWidget(uri: URI, options?: EditorOpenerOptions): MaybePromise<EditorWidget> | undefined;
|
|
20
|
+
protected getWidget(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget | undefined>;
|
|
21
|
+
protected getOrCreateWidget(uri: URI, options?: EditorOpenerOptions): Promise<EditorWidget>;
|
|
22
|
+
protected createWidgetOptions(uri: URI, options?: EditorOpenerOptions): EditorPreviewOptions;
|
|
23
|
+
protected convertEditorOnDoubleClick(event: Event): void;
|
|
24
|
+
}
|
|
25
25
|
//# sourceMappingURL=editor-preview-manager.d.ts.map
|