@theia/editor-preview 1.19.0 → 1.21.0-next.13

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,EAA6B,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE1J,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI5H,yBAAiB,qBAAqB,CAAC;IAC5B,MAAM,mBAAmB,SAI6C,CAAC;CACjF;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;IAoBjD,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"}
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,33 +30,27 @@ 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
- EditorPreviewCommands.PIN_PREVIEW_COMMAND = common_1.Command.toLocalizedCommand({
36
+ EditorPreviewCommands.PIN_PREVIEW_COMMAND = common_1.Command.toDefaultLocalizedCommand({
36
37
  id: 'workbench.action.keepEditor',
37
38
  category: browser_1.CommonCommands.VIEW_CATEGORY,
38
39
  label: 'Keep Editor',
39
- }, 'vscode/editor.contribution/keepEditor', browser_1.CommonCommands.VIEW_CATEGORY_KEY);
40
+ });
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 (event) => {
45
- const widget = this.getTargetWidget(event);
46
- if (widget instanceof editor_preview_widget_1.EditorPreviewWidget) {
47
- widget.convertToNonPreview();
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: (event) => {
52
- const widget = this.getTargetWidget(event);
53
- return widget instanceof editor_preview_widget_1.EditorPreviewWidget && widget.isPreview;
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,9 +59,9 @@ let EditorPreviewContribution = class EditorPreviewContribution {
65
59
  });
66
60
  }
67
61
  registerMenus(registry) {
68
- registry.registerMenuAction(browser_1.SHELL_TABBAR_CONTEXT_MENU, {
62
+ registry.registerMenuAction(browser_1.SHELL_TABBAR_CONTEXT_PIN, {
69
63
  commandId: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
70
- label: nls_1.nls.localize('vscode/editor.contribution/keepOpen', 'Keep Open'),
64
+ label: nls_1.nls.localizeByDefault('Keep Open'),
71
65
  order: '6',
72
66
  });
73
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"editor-preview-contribution.js","sourceRoot":"","sources":["../../src/browser/editor-preview-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,qDAA0J;AAC1J,oDAAiD;AACjD,mDAA4H;AAC5H,4DAAkE;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CAAC,EAAE;YACrD,UAAU,EAAE,iBAAiB;SAChC,CAAC,CAAC;IACP,CAAC;IAED,aAAa,CAAC,QAA2B;QACrC,QAAQ,CAAC,kBAAkB,CAAC,mCAAyB,EAAE;YACnD,SAAS,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,EAAE;YACvD,KAAK,EAAE,SAAG,CAAC,QAAQ,CAAC,qCAAqC,EAAE,WAAW,CAAC;YACvE,KAAK,EAAE,GAAG;SACb,CAAC,CAAC;IACP,CAAC;IAES,eAAe,CAAC,KAAa;QACnC,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;IAClF,CAAC;CACJ,CAAA;AAxC6B;IAAzB,kBAAM,CAAC,0BAAgB,CAAC;8BAA2B,0BAAgB;wDAAC;AAD5D,yBAAyB;IADrC,sBAAU,EAAE;GACA,yBAAyB,CAyCrC;AAzCY,8DAAyB"}
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,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,CAAA;AAjC6B;IAAzB,kBAAM,CAAC,0BAAgB,CAAC;8BAA2B,0BAAgB;wDAAC;AAD5D,yBAAyB;IADrC,sBAAU,EAAE;GACA,yBAAyB,CAkCrC;AAlCY,8DAAyB"}
@@ -1 +1 @@
1
- {"version":3,"file":"editor-preview-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAyB,eAAe,EAAE,iBAAiB,EAA0B,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG9I,eAAO,MAAM,yBAAyB,EAAE,gBASvC,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACvC,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,eAAO,MAAM,mCAAmC,eAAgD,CAAC;AACjG,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAC3E,oBAAY,wBAAwB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC;AAEnF,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,iBAAiB,EAAE,MAAM,GAAE,gBAA4C,GAAG,wBAAwB,CAE7J;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAQxE"}
1
+ {"version":3,"file":"editor-preview-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAyB,eAAe,EAAE,iBAAiB,EAA0B,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG9I,eAAO,MAAM,yBAAyB,EAAE,gBAUvC,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACvC,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,eAAO,MAAM,mCAAmC,eAAgD,CAAC;AACjG,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAC3E,oBAAY,wBAAwB,GAAG,eAAe,CAAC,0BAA0B,CAAC,CAAC;AAEnF,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,iBAAiB,EAAE,MAAM,GAAE,gBAA4C,GAAG,wBAAwB,CAE7J;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAQxE"}
@@ -23,7 +23,8 @@ exports.EditorPreviewConfigSchema = {
23
23
  properties: {
24
24
  'editor.enablePreview': {
25
25
  type: 'boolean',
26
- description: nls_1.nls.localize('vscode/workbench.contribution/enablePreview', 'Controls whether editors are opened as previews when selected or single-clicked.'),
26
+ // eslint-disable-next-line max-len
27
+ description: nls_1.nls.localizeByDefault('Controls whether opened editors show as preview. Preview editors do not keep open and are reused until explicitly set to be kept open (e.g. via double click or editing) and show up with an italic font style.'),
27
28
  default: true
28
29
  },
29
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"editor-preview-preferences.js","sourceRoot":"","sources":["../../src/browser/editor-preview-preferences.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,qDAA8I;AAC9I,oDAAiD;AAEpC,QAAA,yBAAyB,GAAqB;IACvD,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE;QACR,sBAAsB,EAAE;YACpB,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,SAAG,CAAC,QAAQ,CAAC,6CAA6C,EAAE,kFAAkF,CAAC;YAC5J,OAAO,EAAE,IAAI;SAChB;KACJ;CACJ,CAAC;AAMW,QAAA,mCAAmC,GAAG,MAAM,CAAC,qCAAqC,CAAC,CAAC;AACpF,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAG3E,SAAgB,8BAA8B,CAAC,WAA8B,EAAE,SAA2B,iCAAyB;IAC/H,OAAO,+BAAqB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAFD,wEAEC;AAED,SAAgB,4BAA4B,CAAC,IAAqB;IAC9D,IAAI,CAAC,gCAAwB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QAChD,MAAM,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAoB,2BAAiB,CAAC,CAAC;QAC5E,MAAM,YAAY,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAyB,2CAAmC,CAAC,CAAC;QACpG,OAAO,8BAA8B,CAAC,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACtB,IAAI,CAAC,2CAAmC,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,iCAAyB,EAAE,CAAC,CAAC;IACjG,IAAI,CAAC,gCAAsB,CAAC,CAAC,SAAS,CAAC,2CAAmC,CAAC,CAAC;AAChF,CAAC;AARD,oEAQC"}
1
+ {"version":3,"file":"editor-preview-preferences.js","sourceRoot":"","sources":["../../src/browser/editor-preview-preferences.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,qDAA8I;AAC9I,oDAAiD;AAEpC,QAAA,yBAAyB,GAAqB;IACvD,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE;QACR,sBAAsB,EAAE;YACpB,IAAI,EAAE,SAAS;YACf,mCAAmC;YACnC,WAAW,EAAE,SAAG,CAAC,iBAAiB,CAAC,iNAAiN,CAAC;YACrP,OAAO,EAAE,IAAI;SAChB;KACJ;CACJ,CAAC;AAMW,QAAA,mCAAmC,GAAG,MAAM,CAAC,qCAAqC,CAAC,CAAC;AACpF,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAG3E,SAAgB,8BAA8B,CAAC,WAA8B,EAAE,SAA2B,iCAAyB;IAC/H,OAAO,+BAAqB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAFD,wEAEC;AAED,SAAgB,4BAA4B,CAAC,IAAqB;IAC9D,IAAI,CAAC,gCAAwB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QAChD,MAAM,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAoB,2BAAiB,CAAC,CAAC;QAC5E,MAAM,YAAY,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAyB,2CAAmC,CAAC,CAAC;QACpG,OAAO,8BAA8B,CAAC,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACtB,IAAI,CAAC,2CAAmC,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,iCAAyB,EAAE,CAAC,CAAC;IACjG,IAAI,CAAC,gCAAsB,CAAC,CAAC,SAAS,CAAC,2CAAmC,CAAC,CAAC;AAChF,CAAC;AARD,oEAQC"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@theia/editor-preview",
3
- "version": "1.19.0",
3
+ "version": "1.21.0-next.13+afcf799cca0",
4
4
  "description": "Theia - Editor Preview Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.19.0",
7
- "@theia/editor": "1.19.0",
8
- "@theia/navigator": "1.19.0"
6
+ "@theia/core": "1.21.0-next.13+afcf799cca0",
7
+ "@theia/editor": "1.21.0-next.13+afcf799cca0",
8
+ "@theia/navigator": "1.21.0-next.13+afcf799cca0"
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public"
@@ -40,10 +40,10 @@
40
40
  "watch": "theiaext watch"
41
41
  },
42
42
  "devDependencies": {
43
- "@theia/ext-scripts": "1.19.0"
43
+ "@theia/ext-scripts": "1.20.0"
44
44
  },
45
45
  "nyc": {
46
46
  "extends": "../../configs/nyc.json"
47
47
  },
48
- "gitHead": "cebb5417bb40e320178e3a4e66070af514f0525f"
48
+ "gitHead": "afcf799cca07f3cabb4c8da984b774ab361f494c"
49
49
  }
@@ -14,18 +14,19 @@
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, SHELL_TABBAR_CONTEXT_MENU, Widget } from '@theia/core/lib/browser';
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
- export const PIN_PREVIEW_COMMAND = Command.toLocalizedCommand({
25
+ export const PIN_PREVIEW_COMMAND = Command.toDefaultLocalizedCommand({
25
26
  id: 'workbench.action.keepEditor',
26
27
  category: CommonCommands.VIEW_CATEGORY,
27
28
  label: 'Keep Editor',
28
- }, 'vscode/editor.contribution/keepEditor', CommonCommands.VIEW_CATEGORY_KEY);
29
+ });
29
30
  }
30
31
 
31
32
  @injectable()
@@ -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 (event?: Event) => {
38
- const widget = this.getTargetWidget(event);
39
- if (widget instanceof EditorPreviewWidget) {
40
- widget.convertToNonPreview();
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: (event?: Event) => {
45
- const widget = this.getTargetWidget(event);
46
- return widget instanceof EditorPreviewWidget && widget.isPreview;
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,9 +54,9 @@ export class EditorPreviewContribution implements CommandContribution, MenuContr
60
54
  }
61
55
 
62
56
  registerMenus(registry: MenuModelRegistry): void {
63
- registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, {
57
+ registry.registerMenuAction(SHELL_TABBAR_CONTEXT_PIN, {
64
58
  commandId: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
65
- label: nls.localize('vscode/editor.contribution/keepOpen', 'Keep Open'),
59
+ label: nls.localizeByDefault('Keep Open'),
66
60
  order: '6',
67
61
  });
68
62
  }
@@ -23,7 +23,8 @@ export const EditorPreviewConfigSchema: PreferenceSchema = {
23
23
  properties: {
24
24
  'editor.enablePreview': {
25
25
  type: 'boolean',
26
- description: nls.localize('vscode/workbench.contribution/enablePreview', 'Controls whether editors are opened as previews when selected or single-clicked.'),
26
+ // eslint-disable-next-line max-len
27
+ description: nls.localizeByDefault('Controls whether opened editors show as preview. Preview editors do not keep open and are reused until explicitly set to be kept open (e.g. via double click or editing) and show up with an italic font style.'),
27
28
  default: true
28
29
  },
29
30
  }