@theia/editor-preview 1.18.0-next.178 → 1.18.0-next.183
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-preview-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,gBAAgB,EAAkB,sBAAsB,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"editor-preview-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,gBAAgB,EAAkB,sBAAsB,EAAE,kBAAkB,EAA4B,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEzJ,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAK5H,yBAAiB,qBAAqB,CAAC;IAC5B,MAAM,mBAAmB,SAI9B,CAAC;CACN;AAED,qBACa,yBAA0B,YAAW,mBAAmB,EAAE,gBAAgB,EAAE,sBAAsB;IACjF,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IAErE,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAajD,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAOvD,aAAa,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAQhD,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS;CAG/D"}
|
|
@@ -30,6 +30,7 @@ const nls_1 = require("@theia/core/lib/common/nls");
|
|
|
30
30
|
const common_1 = require("@theia/core/lib/common");
|
|
31
31
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
32
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");
|
|
33
34
|
var EditorPreviewCommands;
|
|
34
35
|
(function (EditorPreviewCommands) {
|
|
35
36
|
EditorPreviewCommands.PIN_PREVIEW_COMMAND = common_1.Command.toDefaultLocalizedCommand({
|
|
@@ -40,23 +41,16 @@ var EditorPreviewCommands;
|
|
|
40
41
|
})(EditorPreviewCommands = exports.EditorPreviewCommands || (exports.EditorPreviewCommands = {}));
|
|
41
42
|
let EditorPreviewContribution = class EditorPreviewContribution {
|
|
42
43
|
registerCommands(registry) {
|
|
43
|
-
registry.registerCommand(EditorPreviewCommands.PIN_PREVIEW_COMMAND, {
|
|
44
|
-
execute: async (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
await this.shell.activateWidget(widget.id);
|
|
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
49
|
}
|
|
50
50
|
},
|
|
51
|
-
isEnabled: (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
isVisible: (event) => {
|
|
56
|
-
const widget = this.getTargetWidget(event);
|
|
57
|
-
return widget instanceof editor_preview_widget_1.EditorPreviewWidget;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
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
|
+
}));
|
|
60
54
|
}
|
|
61
55
|
registerKeybindings(registry) {
|
|
62
56
|
registry.registerKeybinding({
|
|
@@ -65,7 +59,7 @@ let EditorPreviewContribution = class EditorPreviewContribution {
|
|
|
65
59
|
});
|
|
66
60
|
}
|
|
67
61
|
registerMenus(registry) {
|
|
68
|
-
registry.registerMenuAction(browser_1.
|
|
62
|
+
registry.registerMenuAction(browser_1.SHELL_TABBAR_CONTEXT_PIN, {
|
|
69
63
|
commandId: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
|
|
70
64
|
label: nls_1.nls.localizeByDefault('Keep Open'),
|
|
71
65
|
order: '6',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-preview-contribution.js","sourceRoot":"","sources":["../../src/browser/editor-preview-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,
|
|
1
|
+
{"version":3,"file":"editor-preview-contribution.js","sourceRoot":"","sources":["../../src/browser/editor-preview-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,qDAAyJ;AACzJ,oDAAiD;AACjD,mDAA4H;AAC5H,4DAAkE;AAClE,mEAA8D;AAC9D,iHAA2G;AAE3G,IAAiB,qBAAqB,CAMrC;AAND,WAAiB,qBAAqB;IACrB,yCAAmB,GAAG,gBAAO,CAAC,yBAAyB,CAAC;QACjE,EAAE,EAAE,6BAA6B;QACjC,QAAQ,EAAE,wBAAc,CAAC,aAAa;QACtC,KAAK,EAAE,aAAa;KACvB,CAAC,CAAC;AACP,CAAC,EANgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAMrC;AAGD,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;IAGlC,gBAAgB,CAAC,QAAyB;QACtC,QAAQ,CAAC,eAAe,CAAC,qBAAqB,CAAC,mBAAmB,EAAE,IAAI,4DAA2B,CAAC,IAAI,CAAC,KAAK,EAAE;YAC5G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5D,yBAAyB;IADrC,sBAAU,EAAE;GACA,yBAAyB,CAkCrC;AAlCY,8DAAyB"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/editor-preview",
|
|
3
|
-
"version": "1.18.0-next.
|
|
3
|
+
"version": "1.18.0-next.183+17cadbd8034",
|
|
4
4
|
"description": "Theia - Editor Preview Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.18.0-next.
|
|
7
|
-
"@theia/editor": "1.18.0-next.
|
|
8
|
-
"@theia/navigator": "1.18.0-next.
|
|
6
|
+
"@theia/core": "1.18.0-next.183+17cadbd8034",
|
|
7
|
+
"@theia/editor": "1.18.0-next.183+17cadbd8034",
|
|
8
|
+
"@theia/navigator": "1.18.0-next.183+17cadbd8034"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"nyc": {
|
|
46
46
|
"extends": "../../configs/nyc.json"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "17cadbd80346795c80afa2d9917ae5bb19dde495"
|
|
49
49
|
}
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { ApplicationShell, CommonCommands, KeybindingContribution, KeybindingRegistry,
|
|
17
|
+
import { ApplicationShell, CommonCommands, KeybindingContribution, KeybindingRegistry, SHELL_TABBAR_CONTEXT_PIN, Widget } from '@theia/core/lib/browser';
|
|
18
18
|
import { nls } from '@theia/core/lib/common/nls';
|
|
19
19
|
import { Command, CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core/lib/common';
|
|
20
20
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
21
21
|
import { EditorPreviewWidget } from './editor-preview-widget';
|
|
22
|
+
import { CurrentWidgetCommandAdapter } from '@theia/core/lib/browser/shell/current-widget-command-adapter';
|
|
22
23
|
|
|
23
24
|
export namespace EditorPreviewCommands {
|
|
24
25
|
export const PIN_PREVIEW_COMMAND = Command.toDefaultLocalizedCommand({
|
|
@@ -33,23 +34,16 @@ export class EditorPreviewContribution implements CommandContribution, MenuContr
|
|
|
33
34
|
@inject(ApplicationShell) protected readonly shell: ApplicationShell;
|
|
34
35
|
|
|
35
36
|
registerCommands(registry: CommandRegistry): void {
|
|
36
|
-
registry.registerCommand(EditorPreviewCommands.PIN_PREVIEW_COMMAND, {
|
|
37
|
-
execute: async
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
await this.shell.activateWidget(widget.id);
|
|
37
|
+
registry.registerCommand(EditorPreviewCommands.PIN_PREVIEW_COMMAND, new CurrentWidgetCommandAdapter(this.shell, {
|
|
38
|
+
execute: async title => {
|
|
39
|
+
if (title?.owner instanceof EditorPreviewWidget) {
|
|
40
|
+
title.owner.convertToNonPreview();
|
|
41
|
+
await this.shell.activateWidget(title.owner.id);
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
isEnabled:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
isVisible: (event?: Event) => {
|
|
49
|
-
const widget = this.getTargetWidget(event);
|
|
50
|
-
return widget instanceof EditorPreviewWidget;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
44
|
+
isEnabled: title => title?.owner instanceof EditorPreviewWidget && title.owner.isPreview,
|
|
45
|
+
isVisible: title => title?.owner instanceof EditorPreviewWidget,
|
|
46
|
+
}));
|
|
53
47
|
}
|
|
54
48
|
|
|
55
49
|
registerKeybindings(registry: KeybindingRegistry): void {
|
|
@@ -60,7 +54,7 @@ export class EditorPreviewContribution implements CommandContribution, MenuContr
|
|
|
60
54
|
}
|
|
61
55
|
|
|
62
56
|
registerMenus(registry: MenuModelRegistry): void {
|
|
63
|
-
registry.registerMenuAction(
|
|
57
|
+
registry.registerMenuAction(SHELL_TABBAR_CONTEXT_PIN, {
|
|
64
58
|
commandId: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
|
|
65
59
|
label: nls.localizeByDefault('Keep Open'),
|
|
66
60
|
order: '6',
|