@theia/editor-preview 1.67.0-next.3 → 1.67.0-next.56

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 (38) hide show
  1. package/README.md +1 -1
  2. package/package.json +5 -5
  3. package/lib/browser/editor-preview-contribution.d.ts +0 -13
  4. package/lib/browser/editor-preview-contribution.d.ts.map +0 -1
  5. package/lib/browser/editor-preview-contribution.js +0 -72
  6. package/lib/browser/editor-preview-contribution.js.map +0 -1
  7. package/lib/browser/editor-preview-frontend-module.d.ts +0 -5
  8. package/lib/browser/editor-preview-frontend-module.d.ts.map +0 -1
  9. package/lib/browser/editor-preview-frontend-module.js +0 -43
  10. package/lib/browser/editor-preview-frontend-module.js.map +0 -1
  11. package/lib/browser/editor-preview-manager.d.ts +0 -25
  12. package/lib/browser/editor-preview-manager.d.ts.map +0 -1
  13. package/lib/browser/editor-preview-manager.js +0 -136
  14. package/lib/browser/editor-preview-manager.js.map +0 -1
  15. package/lib/browser/editor-preview-tree-decorator.d.ts +0 -22
  16. package/lib/browser/editor-preview-tree-decorator.d.ts.map +0 -1
  17. package/lib/browser/editor-preview-tree-decorator.js +0 -98
  18. package/lib/browser/editor-preview-tree-decorator.js.map +0 -1
  19. package/lib/browser/editor-preview-widget-factory.d.ts +0 -14
  20. package/lib/browser/editor-preview-widget-factory.d.ts.map +0 -1
  21. package/lib/browser/editor-preview-widget-factory.js +0 -48
  22. package/lib/browser/editor-preview-widget-factory.js.map +0 -1
  23. package/lib/browser/editor-preview-widget.d.ts +0 -22
  24. package/lib/browser/editor-preview-widget.d.ts.map +0 -1
  25. package/lib/browser/editor-preview-widget.js +0 -85
  26. package/lib/browser/editor-preview-widget.js.map +0 -1
  27. package/lib/common/editor-preview-preferences.d.ts +0 -12
  28. package/lib/common/editor-preview-preferences.d.ts.map +0 -1
  29. package/lib/common/editor-preview-preferences.js +0 -47
  30. package/lib/common/editor-preview-preferences.js.map +0 -1
  31. package/lib/node/editor-preview-backend-module.d.ts +0 -4
  32. package/lib/node/editor-preview-backend-module.d.ts.map +0 -1
  33. package/lib/node/editor-preview-backend-module.js +0 -23
  34. package/lib/node/editor-preview-backend-module.js.map +0 -1
  35. package/lib/package.spec.d.ts +0 -1
  36. package/lib/package.spec.d.ts.map +0 -1
  37. package/lib/package.spec.js +0 -26
  38. package/lib/package.spec.js.map +0 -1
package/README.md CHANGED
@@ -43,7 +43,7 @@ must be set to "singleClick" to enable opening files in preview mode.
43
43
 
44
44
  ## Additional Information
45
45
 
46
- - [API documentation for `@theia/editor-preview`](https://eclipse-theia.github.io/theia/docs/next/modules/editor_preview.html)
46
+ - [API documentation for `@theia/editor-preview`](https://eclipse-theia.github.io/theia/docs/next/modules/_theia_editor-preview.html)
47
47
  - [Theia - GitHub](https://github.com/eclipse-theia/theia)
48
48
  - [Theia - Website](https://theia-ide.org/)
49
49
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@theia/editor-preview",
3
- "version": "1.67.0-next.3+7946ca874",
3
+ "version": "1.67.0-next.56+d8f18cc386c",
4
4
  "description": "Theia - Editor Preview Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.67.0-next.3+7946ca874",
7
- "@theia/editor": "1.67.0-next.3+7946ca874",
8
- "@theia/navigator": "1.67.0-next.3+7946ca874",
6
+ "@theia/core": "1.67.0-next.56+d8f18cc386c",
7
+ "@theia/editor": "1.67.0-next.56+d8f18cc386c",
8
+ "@theia/navigator": "1.67.0-next.56+d8f18cc386c",
9
9
  "tslib": "^2.6.2"
10
10
  },
11
11
  "publishConfig": {
@@ -47,5 +47,5 @@
47
47
  "nyc": {
48
48
  "extends": "../../configs/nyc.json"
49
49
  },
50
- "gitHead": "7946ca874b04e6249d883e9a586f193194df1365"
50
+ "gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
51
51
  }
@@ -1,13 +0,0 @@
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
- //# sourceMappingURL=editor-preview-contribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-contribution.ts"],"names":[],"mappings":"AAgBA,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"}
@@ -1,72 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.EditorPreviewContribution = exports.EditorPreviewCommands = void 0;
19
- const tslib_1 = require("tslib");
20
- const browser_1 = require("@theia/core/lib/browser");
21
- const nls_1 = require("@theia/core/lib/common/nls");
22
- const common_1 = require("@theia/core/lib/common");
23
- const inversify_1 = require("@theia/core/shared/inversify");
24
- const editor_preview_widget_1 = require("./editor-preview-widget");
25
- const current_widget_command_adapter_1 = require("@theia/core/lib/browser/shell/current-widget-command-adapter");
26
- var EditorPreviewCommands;
27
- (function (EditorPreviewCommands) {
28
- EditorPreviewCommands.PIN_PREVIEW_COMMAND = common_1.Command.toDefaultLocalizedCommand({
29
- id: 'workbench.action.keepEditor',
30
- category: browser_1.CommonCommands.VIEW_CATEGORY,
31
- label: 'Keep Editor',
32
- });
33
- })(EditorPreviewCommands || (exports.EditorPreviewCommands = EditorPreviewCommands = {}));
34
- let EditorPreviewContribution = class EditorPreviewContribution {
35
- registerCommands(registry) {
36
- registry.registerCommand(EditorPreviewCommands.PIN_PREVIEW_COMMAND, new current_widget_command_adapter_1.CurrentWidgetCommandAdapter(this.shell, {
37
- execute: async (title) => {
38
- if ((title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget) {
39
- title.owner.convertToNonPreview();
40
- await this.shell.activateWidget(title.owner.id);
41
- }
42
- },
43
- isEnabled: title => (title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget && title.owner.isPreview,
44
- isVisible: title => (title === null || title === void 0 ? void 0 : title.owner) instanceof editor_preview_widget_1.EditorPreviewWidget,
45
- }));
46
- }
47
- registerKeybindings(registry) {
48
- registry.registerKeybinding({
49
- command: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
50
- keybinding: 'ctrlcmd+k enter'
51
- });
52
- }
53
- registerMenus(registry) {
54
- registry.registerMenuAction(browser_1.SHELL_TABBAR_CONTEXT_PIN, {
55
- commandId: EditorPreviewCommands.PIN_PREVIEW_COMMAND.id,
56
- label: nls_1.nls.localizeByDefault('Keep Open'),
57
- order: '6',
58
- });
59
- }
60
- getTargetWidget(event) {
61
- return event ? this.shell.findTargetedWidget(event) : this.shell.activeWidget;
62
- }
63
- };
64
- exports.EditorPreviewContribution = EditorPreviewContribution;
65
- tslib_1.__decorate([
66
- (0, inversify_1.inject)(browser_1.ApplicationShell),
67
- tslib_1.__metadata("design:type", browser_1.ApplicationShell)
68
- ], EditorPreviewContribution.prototype, "shell", void 0);
69
- exports.EditorPreviewContribution = EditorPreviewContribution = tslib_1.__decorate([
70
- (0, inversify_1.injectable)()
71
- ], EditorPreviewContribution);
72
- //# sourceMappingURL=editor-preview-contribution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-contribution.js","sourceRoot":"","sources":["../../src/browser/editor-preview-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,qDAAyJ;AACzJ,oDAAiD;AACjD,mDAA4H;AAC5H,4DAAkE;AAClE,mEAA8D;AAC9D,iHAA2G;AAE3G,IAAiB,qBAAqB,CAMrC;AAND,WAAiB,qBAAqB;IACrB,yCAAmB,GAAG,gBAAO,CAAC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vD,KAAK,EAAE,SAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC;YACzC,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;AAlCY,8DAAyB;AACW;IAA5C,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCAA2B,0BAAgB;wDAAC;oCAD5D,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAkCrC"}
@@ -1,5 +0,0 @@
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
- //# sourceMappingURL=editor-preview-frontend-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,mCAAmC,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAU/D,wBAiBG"}
@@ -1,43 +0,0 @@
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("../common/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
- //# sourceMappingURL=editor-preview-frontend-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-frontend-module.js","sourceRoot":"","sources":["../../src/browser/editor-preview-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,6CAA2C;AAC3C,qDAAiH;AACjH,4DAA+D;AAC/D,qFAAoF;AACpF,qEAAgE;AAChE,uDAA0D;AAC1D,mFAA6E;AAC7E,+EAA0E;AAC1E,mDAA+E;AAC/E,wJAAqI;AACrI,mFAA6E;AAE7E,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAEjE,IAAI,CAAC,0DAA0B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC7D,IAAI,CAAC,uBAAa,CAAC,CAAC,SAAS,CAAC,0DAA0B,CAAC,CAAC;IAE1D,IAAI,CAAC,6CAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACvD,MAAM,CAAC,uBAAa,CAAC,CAAC,SAAS,CAAC,6CAAoB,CAAC,CAAC;IAEtD,IAAI,CAAC,uDAAyB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5D,IAAI,CAAC,4BAAmB,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IAC/D,IAAI,CAAC,gCAAsB,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IAClE,IAAI,CAAC,yBAAgB,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IAE5D,IAAI,CAAC,0DAA0B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC7D,IAAI,CAAC,mEAAwB,CAAC,CAAC,SAAS,CAAC,0DAA0B,CAAC,CAAC;IACrE,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,0DAA0B,CAAC,CAAC;IAC5E,IAAA,yDAA4B,EAAC,IAAI,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC"}
@@ -1,25 +0,0 @@
1
- import { EditorManager, EditorOpenerOptions, EditorWidget } from '@theia/editor/lib/browser';
2
- import { EditorPreviewPreferences } from '../common/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, uri: URI, 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
- //# sourceMappingURL=editor-preview-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-manager.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-manager.ts"],"names":[],"mappings":"AAgBA,OAAO,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,SAAS,CAAC,0BAA0B,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;CAM3D"}
@@ -1,136 +0,0 @@
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
- exports.EditorPreviewManager = void 0;
19
- const tslib_1 = require("tslib");
20
- const browser_1 = require("@theia/editor/lib/browser");
21
- const inversify_1 = require("@theia/core/shared/inversify");
22
- const editor_preview_preferences_1 = require("../common/editor-preview-preferences");
23
- const editor_preview_widget_factory_1 = require("./editor-preview-widget-factory");
24
- const editor_preview_widget_1 = require("./editor-preview-widget");
25
- const frontend_application_state_1 = require("@theia/core/lib/browser/frontend-application-state");
26
- let EditorPreviewManager = class EditorPreviewManager extends browser_1.EditorManager {
27
- constructor() {
28
- super(...arguments);
29
- this.id = editor_preview_widget_factory_1.EditorPreviewWidgetFactory.ID;
30
- /**
31
- * Until the layout has been restored, widget state is not reliable, so we ignore creation events.
32
- */
33
- this.layoutIsSet = false;
34
- }
35
- init() {
36
- super.init();
37
- // All editors are created, but not all are opened. This sets up the logic to swap previews when the editor is attached.
38
- this.onCreated((widget) => {
39
- if (this.layoutIsSet && widget.isPreview) {
40
- const oneTimeDisposable = widget.onDidChangeVisibility(() => {
41
- this.handleNewPreview(widget);
42
- oneTimeDisposable.dispose();
43
- });
44
- }
45
- });
46
- this.preferences.onPreferenceChanged(change => {
47
- if (change.preferenceName === 'editor.enablePreview' && !change.newValue) {
48
- this.all.forEach((editor) => {
49
- if (editor.isPreview) {
50
- editor.convertToNonPreview();
51
- }
52
- });
53
- }
54
- ;
55
- });
56
- this.stateService.reachedState('initialized_layout').then(() => {
57
- const editors = this.all;
58
- const currentPreview = editors.find(editor => editor.isPreview);
59
- if (currentPreview) {
60
- this.handleNewPreview(currentPreview);
61
- }
62
- this.layoutIsSet = true;
63
- });
64
- document.addEventListener('dblclick', this.convertEditorOnDoubleClick.bind(this));
65
- }
66
- async doOpen(widget, uri, options) {
67
- const { preview, widgetOptions = { area: 'main' }, mode = 'activate' } = options !== null && options !== void 0 ? options : {};
68
- if (!widget.isAttached) {
69
- await this.shell.addWidget(widget, widgetOptions);
70
- }
71
- else if (!preview && widget.isPreview) {
72
- widget.convertToNonPreview();
73
- }
74
- if (mode === 'activate') {
75
- await this.shell.activateWidget(widget.id);
76
- }
77
- else if (mode === 'reveal') {
78
- await this.shell.revealWidget(widget.id);
79
- }
80
- await this.revealSelection(widget, uri, options);
81
- }
82
- handleNewPreview(newPreviewWidget) {
83
- if (newPreviewWidget.isPreview) {
84
- const tabbar = this.shell.getTabBarFor(newPreviewWidget);
85
- if (tabbar) {
86
- for (const title of tabbar.titles) {
87
- if (title.owner !== newPreviewWidget && title.owner instanceof editor_preview_widget_1.EditorPreviewWidget && title.owner.isPreview) {
88
- title.owner.dispose();
89
- }
90
- }
91
- }
92
- }
93
- }
94
- tryGetPendingWidget(uri, options) {
95
- var _a;
96
- return (_a = super.tryGetPendingWidget(uri, { ...options, preview: true })) !== null && _a !== void 0 ? _a : super.tryGetPendingWidget(uri, { ...options, preview: false });
97
- }
98
- async getWidget(uri, options) {
99
- var _a;
100
- return (_a = (await super.getWidget(uri, { ...options, preview: true }))) !== null && _a !== void 0 ? _a : super.getWidget(uri, { ...options, preview: false });
101
- }
102
- async getOrCreateWidget(uri, options) {
103
- var _a;
104
- return (_a = this.tryGetPendingWidget(uri, options)) !== null && _a !== void 0 ? _a : super.getOrCreateWidget(uri, options);
105
- }
106
- createWidgetOptions(uri, options) {
107
- const navigatableOptions = super.createWidgetOptions(uri, options);
108
- navigatableOptions.preview = !!((options === null || options === void 0 ? void 0 : options.preview) && this.preferences['editor.enablePreview']);
109
- return navigatableOptions;
110
- }
111
- convertEditorOnDoubleClick(event) {
112
- const widget = this.shell.findTargetedWidget(event);
113
- if (widget instanceof editor_preview_widget_1.EditorPreviewWidget && widget.isPreview) {
114
- widget.convertToNonPreview();
115
- }
116
- }
117
- };
118
- exports.EditorPreviewManager = EditorPreviewManager;
119
- tslib_1.__decorate([
120
- (0, inversify_1.inject)(editor_preview_preferences_1.EditorPreviewPreferences),
121
- tslib_1.__metadata("design:type", Object)
122
- ], EditorPreviewManager.prototype, "preferences", void 0);
123
- tslib_1.__decorate([
124
- (0, inversify_1.inject)(frontend_application_state_1.FrontendApplicationStateService),
125
- tslib_1.__metadata("design:type", frontend_application_state_1.FrontendApplicationStateService)
126
- ], EditorPreviewManager.prototype, "stateService", void 0);
127
- tslib_1.__decorate([
128
- (0, inversify_1.postConstruct)(),
129
- tslib_1.__metadata("design:type", Function),
130
- tslib_1.__metadata("design:paramtypes", []),
131
- tslib_1.__metadata("design:returntype", void 0)
132
- ], EditorPreviewManager.prototype, "init", null);
133
- exports.EditorPreviewManager = EditorPreviewManager = tslib_1.__decorate([
134
- (0, inversify_1.injectable)()
135
- ], EditorPreviewManager);
136
- //# sourceMappingURL=editor-preview-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-manager.js","sourceRoot":"","sources":["../../src/browser/editor-preview-manager.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,u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B;QAC1E,MAAM,kBAAkB,GAAG,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAyB,CAAC;QAC3F,kBAAkB,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,KAAI,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAC9F,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAES,0BAA0B,CAAC,KAAY;QAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,MAAM,YAAY,2CAAmB,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YAC5D,MAAM,CAAC,mBAAmB,EAAE,CAAC;QACjC,CAAC;IACL,CAAC;CACJ,CAAA;AApGY,oDAAoB;AAGwB;IAApD,IAAA,kBAAM,EAAC,qDAAwB,CAAC;;yDAA0D;AAC/B;IAA3D,IAAA,kBAAM,EAAC,4DAA+B,CAAC;sCAAkC,4DAA+B;0DAAC;AAQvF;IADlB,IAAA,yBAAa,GAAE;;;;gDAiCf;+BA5CQ,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAoGhC"}
@@ -1,22 +0,0 @@
1
- import { TreeDecorator, TreeDecoration } from '@theia/core/lib/browser/tree/tree-decorator';
2
- import { Emitter } from '@theia/core/lib/common/event';
3
- import { Tree } from '@theia/core/lib/browser/tree/tree';
4
- import { ApplicationShell, FrontendApplication, FrontendApplicationContribution, NavigatableWidget, Widget } from '@theia/core/lib/browser';
5
- import { Disposable } from '@theia/core/lib/common';
6
- export declare class EditorPreviewTreeDecorator implements TreeDecorator, FrontendApplicationContribution {
7
- protected readonly shell: ApplicationShell;
8
- readonly id = "theia-open-editors-file-decorator";
9
- protected decorationsMap: Map<string, TreeDecoration.Data>;
10
- protected readonly decorationsChangedEmitter: Emitter<any>;
11
- readonly onDidChangeDecorations: import("@theia/core/lib/common").Event<any>;
12
- protected readonly toDisposeOnDirtyChanged: Map<string, Disposable>;
13
- protected readonly toDisposeOnPreviewPinned: Map<string, Disposable>;
14
- onDidInitializeLayout(app: FrontendApplication): void;
15
- protected registerEditorListeners(widget: Widget): void;
16
- protected unregisterEditorListeners(widget: Widget): void;
17
- protected get editorWidgets(): NavigatableWidget[];
18
- protected fireDidChangeDecorations(event: (tree: Tree) => Map<string, TreeDecoration.Data>): void;
19
- decorations(tree: Tree): Map<string, TreeDecoration.Data>;
20
- protected collectDecorators(tree: Tree): Map<string, TreeDecoration.Data>;
21
- }
22
- //# sourceMappingURL=editor-preview-tree-decorator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-tree-decorator.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-tree-decorator.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACzD,OAAO,EACH,gBAAgB,EAEhB,mBAAmB,EACnB,+BAA+B,EAC/B,iBAAiB,EAEjB,MAAM,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,qBACa,0BAA2B,YAAW,aAAa,EAAE,+BAA+B;IAEnE,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IAErE,QAAQ,CAAC,EAAE,uCAAuC;IAClD,SAAS,CAAC,cAAc,mCAA0C;IAElE,SAAS,CAAC,QAAQ,CAAC,yBAAyB,eAAiB;IAC7D,QAAQ,CAAC,sBAAsB,8CAAwC;IACvE,SAAS,CAAC,QAAQ,CAAC,uBAAuB,0BAAiC;IAC3E,SAAS,CAAC,QAAQ,CAAC,wBAAwB,0BAAiC;IAE5E,qBAAqB,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI;IAMrD,SAAS,CAAC,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAgBvD,SAAS,CAAC,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAOzD,SAAS,KAAK,aAAa,IAAI,iBAAiB,EAAE,CAEjD;IAED,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAIjG,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC;IAKzD,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC;CAiB5E"}
@@ -1,98 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.EditorPreviewTreeDecorator = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const event_1 = require("@theia/core/lib/common/event");
22
- const browser_1 = require("@theia/core/lib/browser");
23
- const navigator_open_editors_tree_model_1 = require("@theia/navigator/lib/browser/open-editors-widget/navigator-open-editors-tree-model");
24
- const editor_preview_widget_1 = require("./editor-preview-widget");
25
- let EditorPreviewTreeDecorator = class EditorPreviewTreeDecorator {
26
- constructor() {
27
- this.id = 'theia-open-editors-file-decorator';
28
- this.decorationsMap = new Map();
29
- this.decorationsChangedEmitter = new event_1.Emitter();
30
- this.onDidChangeDecorations = this.decorationsChangedEmitter.event;
31
- this.toDisposeOnDirtyChanged = new Map();
32
- this.toDisposeOnPreviewPinned = new Map();
33
- }
34
- onDidInitializeLayout(app) {
35
- this.shell.onDidAddWidget(widget => this.registerEditorListeners(widget));
36
- this.shell.onDidRemoveWidget(widget => this.unregisterEditorListeners(widget));
37
- this.editorWidgets.forEach(widget => this.registerEditorListeners(widget));
38
- }
39
- registerEditorListeners(widget) {
40
- const saveable = browser_1.Saveable.get(widget);
41
- if (saveable) {
42
- this.toDisposeOnDirtyChanged.set(widget.id, saveable.onDirtyChanged(() => {
43
- this.fireDidChangeDecorations((tree) => this.collectDecorators(tree));
44
- }));
45
- }
46
- if (widget instanceof editor_preview_widget_1.EditorPreviewWidget) {
47
- this.toDisposeOnPreviewPinned.set(widget.id, widget.onDidChangePreviewState(() => {
48
- var _a;
49
- this.fireDidChangeDecorations((tree) => this.collectDecorators(tree));
50
- (_a = this.toDisposeOnPreviewPinned.get(widget.id)) === null || _a === void 0 ? void 0 : _a.dispose();
51
- this.toDisposeOnDirtyChanged.delete(widget.id);
52
- }));
53
- }
54
- }
55
- unregisterEditorListeners(widget) {
56
- var _a, _b;
57
- (_a = this.toDisposeOnDirtyChanged.get(widget.id)) === null || _a === void 0 ? void 0 : _a.dispose();
58
- this.toDisposeOnDirtyChanged.delete(widget.id);
59
- (_b = this.toDisposeOnPreviewPinned.get(widget.id)) === null || _b === void 0 ? void 0 : _b.dispose();
60
- this.toDisposeOnPreviewPinned.delete(widget.id);
61
- }
62
- get editorWidgets() {
63
- return this.shell.widgets.filter((widget) => browser_1.NavigatableWidget.is(widget));
64
- }
65
- fireDidChangeDecorations(event) {
66
- this.decorationsChangedEmitter.fire(event);
67
- }
68
- decorations(tree) {
69
- return this.collectDecorators(tree);
70
- }
71
- // Add workspace root as caption suffix and italicize if PreviewWidget
72
- collectDecorators(tree) {
73
- const result = new Map();
74
- if (tree.root === undefined) {
75
- return result;
76
- }
77
- for (const node of new browser_1.DepthFirstTreeIterator(tree.root)) {
78
- if (navigator_open_editors_tree_model_1.OpenEditorNode.is(node)) {
79
- const { widget } = node;
80
- const isPreviewWidget = widget instanceof editor_preview_widget_1.EditorPreviewWidget && widget.isPreview;
81
- const decorations = {
82
- fontData: { style: isPreviewWidget ? 'italic' : undefined }
83
- };
84
- result.set(node.id, decorations);
85
- }
86
- }
87
- return result;
88
- }
89
- };
90
- exports.EditorPreviewTreeDecorator = EditorPreviewTreeDecorator;
91
- tslib_1.__decorate([
92
- (0, inversify_1.inject)(browser_1.ApplicationShell),
93
- tslib_1.__metadata("design:type", browser_1.ApplicationShell)
94
- ], EditorPreviewTreeDecorator.prototype, "shell", void 0);
95
- exports.EditorPreviewTreeDecorator = EditorPreviewTreeDecorator = tslib_1.__decorate([
96
- (0, inversify_1.injectable)()
97
- ], EditorPreviewTreeDecorator);
98
- //# sourceMappingURL=editor-preview-tree-decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-tree-decorator.js","sourceRoot":"","sources":["../../src/browser/editor-preview-tree-decorator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAElE,wDAAuD;AAEvD,qDAQiC;AAEjC,0IAAoH;AACpH,mEAA8D;AAGvD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAAhC;QAIM,OAAE,GAAG,mCAAmC,CAAC;QACxC,mBAAc,GA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KAAK,MAAM,IAAI,IAAI,IAAI,gCAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACvD,IAAI,kDAAc,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;gBACxB,MAAM,eAAe,GAAG,MAAM,YAAY,2CAAmB,IAAI,MAAM,CAAC,SAAS,CAAC;gBAClF,MAAM,WAAW,GAAwB;oBACrC,QAAQ,EAAE,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE;iBAC9D,CAAC;gBACF,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;YACrC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AAvEY,gEAA0B;AAEU;IAA5C,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCAA2B,0BAAgB;yDAAC;qCAF5D,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CAuEtC"}
@@ -1,14 +0,0 @@
1
- import URI from '@theia/core/lib/common/uri';
2
- import { EditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory';
3
- import { EditorPreviewWidget } from './editor-preview-widget';
4
- import { NavigatableWidgetOptions } from '@theia/core/lib/browser';
5
- export interface EditorPreviewOptions extends NavigatableWidgetOptions {
6
- preview?: boolean;
7
- }
8
- export declare class EditorPreviewWidgetFactory extends EditorWidgetFactory {
9
- static ID: string;
10
- readonly id: string;
11
- createWidget(options: EditorPreviewOptions): Promise<EditorPreviewWidget>;
12
- protected constructEditor(uri: URI): Promise<EditorPreviewWidget>;
13
- }
14
- //# sourceMappingURL=editor-preview-widget-factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-widget-factory.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-widget-factory.ts"],"names":[],"mappings":"AAgBA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAEtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,qBACa,0BAA2B,SAAQ,mBAAmB;IAC/D,OAAgB,EAAE,EAAE,MAAM,CAA2B;IACrD,SAAkB,EAAE,SAAiC;IAEtC,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;cAS/D,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAInF"}
@@ -1,48 +0,0 @@
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
- var EditorPreviewWidgetFactory_1;
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.EditorPreviewWidgetFactory = void 0;
20
- const tslib_1 = require("tslib");
21
- const uri_1 = require("@theia/core/lib/common/uri");
22
- const editor_widget_factory_1 = require("@theia/editor/lib/browser/editor-widget-factory");
23
- const inversify_1 = require("@theia/core/shared/inversify");
24
- const editor_preview_widget_1 = require("./editor-preview-widget");
25
- let EditorPreviewWidgetFactory = EditorPreviewWidgetFactory_1 = class EditorPreviewWidgetFactory extends editor_widget_factory_1.EditorWidgetFactory {
26
- constructor() {
27
- super(...arguments);
28
- this.id = EditorPreviewWidgetFactory_1.ID;
29
- }
30
- async createWidget(options) {
31
- const uri = new uri_1.default(options.uri);
32
- const editor = await this.createEditor(uri, options);
33
- if (options.preview) {
34
- editor.initializePreview();
35
- }
36
- return editor;
37
- }
38
- async constructEditor(uri) {
39
- const textEditor = await this.editorProvider(uri);
40
- return new editor_preview_widget_1.EditorPreviewWidget(textEditor, this.selectionService);
41
- }
42
- };
43
- exports.EditorPreviewWidgetFactory = EditorPreviewWidgetFactory;
44
- EditorPreviewWidgetFactory.ID = 'editor-preview-widget';
45
- exports.EditorPreviewWidgetFactory = EditorPreviewWidgetFactory = EditorPreviewWidgetFactory_1 = tslib_1.__decorate([
46
- (0, inversify_1.injectable)()
47
- ], EditorPreviewWidgetFactory);
48
- //# sourceMappingURL=editor-preview-widget-factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-widget-factory.js","sourceRoot":"","sources":["../../src/browser/editor-preview-widget-factory.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;AAEhF,oDAA6C;AAC7C,2FAAsF;AACtF,4DAA0D;AAC1D,mEAA8D;AAQvD,IAAM,0BAA0B,kCAAhC,MAAM,0BAA2B,SAAQ,2CAAmB;IAA5D;;QAEe,OAAE,GAAG,4BAA0B,CAAC,EAAE,CAAC;IAezD,CAAC;IAbY,KAAK,CAAC,YAAY,CAAC,OAA6B;QACrD,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAwB,CAAC;QAC5E,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEkB,KAAK,CAAC,eAAe,CAAC,GAAQ;QAC7C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAClD,OAAO,IAAI,2CAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACtE,CAAC;;AAhBQ,gEAA0B;AACnB,6BAAE,GAAW,uBAAuB,AAAlC,CAAmC;qCAD5C,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CAiBtC"}
@@ -1,22 +0,0 @@
1
- import { TabBar, Widget } from '@theia/core/lib/browser';
2
- import { EditorWidget, TextEditor } from '@theia/editor/lib/browser';
3
- import { Emitter, SelectionService } from '@theia/core/lib/common';
4
- export declare class EditorPreviewWidget extends EditorWidget {
5
- protected _isPreview: boolean;
6
- protected readonly onDidChangePreviewStateEmitter: Emitter<void>;
7
- readonly onDidChangePreviewState: import("@theia/core/lib/common").Event<void>;
8
- get isPreview(): boolean;
9
- constructor(editor: TextEditor, selectionService: SelectionService);
10
- initializePreview(): void;
11
- convertToNonPreview(): void;
12
- protected handleTabBarChange(oldTabBar?: TabBar<Widget> | undefined, newTabBar?: TabBar<Widget> | undefined): void;
13
- storeState(): {
14
- isPreview: boolean;
15
- editorState: object;
16
- } | undefined;
17
- restoreState(oldState: {
18
- isPreview: boolean;
19
- editorState: object;
20
- }): void;
21
- }
22
- //# sourceMappingURL=editor-preview-widget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-widget.d.ts","sourceRoot":"","sources":["../../src/browser/editor-preview-widget.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAgB,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAoC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,wBAAwB,CAAC;AAGtH,qBAAa,mBAAoB,SAAQ,YAAY;IACjD,SAAS,CAAC,UAAU,UAAS;IAE7B,SAAS,CAAC,QAAQ,CAAC,8BAA8B,gBAAuB;IACxE,QAAQ,CAAC,uBAAuB,+CAA6C;IAE7E,IAAI,SAAS,IAAI,OAAO,CAEvB;gBAGG,MAAM,EAAE,UAAU,EAClB,gBAAgB,EAAE,gBAAgB;IAMtC,iBAAiB,IAAI,IAAI;IAoBzB,mBAAmB,IAAI,IAAI;cAUR,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI;IAOlH,UAAU,IAAI;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAOrE,YAAY,CAAC,QAAQ,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAMrF"}
@@ -1,85 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.EditorPreviewWidget = void 0;
19
- const browser_1 = require("@theia/core/lib/browser");
20
- const browser_2 = require("@theia/editor/lib/browser");
21
- const common_1 = require("@theia/core/lib/common");
22
- const PREVIEW_TITLE_CLASS = 'theia-editor-preview-title-unpinned';
23
- class EditorPreviewWidget extends browser_2.EditorWidget {
24
- get isPreview() {
25
- return this._isPreview;
26
- }
27
- constructor(editor, selectionService) {
28
- super(editor, selectionService);
29
- this._isPreview = false;
30
- this.onDidChangePreviewStateEmitter = new common_1.Emitter();
31
- this.onDidChangePreviewState = this.onDidChangePreviewStateEmitter.event;
32
- this.toDispose.push(this.onDidChangePreviewStateEmitter);
33
- }
34
- initializePreview() {
35
- const oneTimeListeners = new common_1.DisposableCollection();
36
- this._isPreview = true;
37
- this.title.className += ` ${PREVIEW_TITLE_CLASS}`;
38
- const oneTimeDirtyChangeListener = this.saveable.onDirtyChanged(() => {
39
- this.convertToNonPreview();
40
- oneTimeListeners.dispose();
41
- });
42
- oneTimeListeners.push(oneTimeDirtyChangeListener);
43
- const oneTimeTitleChangeHandler = () => {
44
- if (this.title.className.includes(browser_1.PINNED_CLASS)) {
45
- this.convertToNonPreview();
46
- oneTimeListeners.dispose();
47
- }
48
- };
49
- this.title.changed.connect(oneTimeTitleChangeHandler);
50
- oneTimeListeners.push(common_1.Disposable.create(() => this.title.changed.disconnect(oneTimeTitleChangeHandler)));
51
- this.toDispose.push(oneTimeListeners);
52
- }
53
- convertToNonPreview() {
54
- if (this._isPreview) {
55
- this._isPreview = false;
56
- this.currentTabbar = undefined;
57
- this.title.className = this.title.className.replace(PREVIEW_TITLE_CLASS, '');
58
- this.onDidChangePreviewStateEmitter.fire();
59
- this.onDidChangePreviewStateEmitter.dispose();
60
- }
61
- }
62
- handleTabBarChange(oldTabBar, newTabBar) {
63
- super.handleTabBarChange(oldTabBar, newTabBar);
64
- if (this._isPreview) {
65
- if (oldTabBar && newTabBar) {
66
- this.convertToNonPreview();
67
- }
68
- }
69
- }
70
- storeState() {
71
- var _a;
72
- if (((_a = this.getResourceUri()) === null || _a === void 0 ? void 0 : _a.scheme) !== common_1.UNTITLED_SCHEME) {
73
- const { _isPreview: isPreview } = this;
74
- return { isPreview, editorState: this.editor.storeViewState() };
75
- }
76
- }
77
- restoreState(oldState) {
78
- if (!oldState.isPreview) {
79
- this.convertToNonPreview();
80
- }
81
- this.editor.restoreViewState(oldState.editorState);
82
- }
83
- }
84
- exports.EditorPreviewWidget = EditorPreviewWidget;
85
- //# sourceMappingURL=editor-preview-widget.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-widget.js","sourceRoot":"","sources":["../../src/browser/editor-preview-widget.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,qDAAuE;AACvE,uDAAqE;AACrE,mDAAsH;AAEtH,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AAClE,MAAa,mBAAoB,SAAQ,sBAAY;IAMjD,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,YACI,MAAkB,EAClB,gBAAkC;QAElC,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAb1B,eAAU,GAAG,KAAK,CAAC;QAEV,mCAA8B,GAAG,IAAI,gBAAO,EAAQ,CAAC;QAC/D,4BAAuB,GAAG,IAAI,CAAC,8BAA8B,CAAC,KAAK,CAAC;QAWzE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC7D,CAAC;IAED,iBAAiB;QACb,MAAM,gBAAgB,GA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3C,IAAI,CAAC,8BAA8B,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACL,CAAC;IAEkB,kBAAkB,CAAC,SAAsC,EAAE,SAAsC;QAChH,KAAK,CAAC,kBAAkB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;gBAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAAC,CAAC;QAC/D,CAAC;IACL,CAAC;IAEQ,UAAU;;QACf,IAAI,CAAA,MAAA,IAAI,CAAC,cAAc,EAAE,0CAAE,MAAM,MAAK,wBAAe,EAAE,CAAC;YACpD,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;YACvC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;QACpE,CAAC;IACL,CAAC;IAEQ,YAAY,CAAC,QAAqD;QACvE,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACvD,CAAC;CACJ;AApED,kDAoEC"}
@@ -1,12 +0,0 @@
1
- import { interfaces } from '@theia/core/shared/inversify';
2
- import { PreferenceProxy, PreferenceSchema, PreferenceService } from '@theia/core/lib/common';
3
- export declare const EditorPreviewConfigSchema: PreferenceSchema;
4
- export interface EditorPreviewConfiguration {
5
- 'editor.enablePreview': boolean;
6
- }
7
- export declare const EditorPreviewPreferenceContribution: unique symbol;
8
- export declare const EditorPreviewPreferences: unique symbol;
9
- export type EditorPreviewPreferences = PreferenceProxy<EditorPreviewConfiguration>;
10
- export declare function createEditorPreviewPreferences(preferences: PreferenceService, schema?: PreferenceSchema): EditorPreviewPreferences;
11
- export declare function bindEditorPreviewPreferences(bind: interfaces.Bind): void;
12
- //# sourceMappingURL=editor-preview-preferences.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-preferences.d.ts","sourceRoot":"","sources":["../../src/common/editor-preview-preferences.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAiD,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG7I,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,MAAM,MAAM,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,47 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 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
- exports.bindEditorPreviewPreferences = exports.createEditorPreviewPreferences = exports.EditorPreviewPreferences = exports.EditorPreviewPreferenceContribution = exports.EditorPreviewConfigSchema = void 0;
19
- const common_1 = require("@theia/core/lib/common");
20
- const nls_1 = require("@theia/core/lib/common/nls");
21
- exports.EditorPreviewConfigSchema = {
22
- properties: {
23
- 'editor.enablePreview': {
24
- type: 'boolean',
25
- // eslint-disable-next-line max-len
26
- description: nls_1.nls.localizeByDefault("Controls whether preview mode is used when editors open. There is a maximum of one preview mode editor per editor group. This editor displays its filename in italics on its tab or title label and in the Open Editors view. Its contents will be replaced by the next editor opened in preview mode. Making a change in a preview mode editor will persist it, as will a double-click on its label, or the 'Keep Open' option in its label context menu. Opening a file from Explorer with a double-click persists its editor immediately."),
27
- default: true
28
- },
29
- }
30
- };
31
- exports.EditorPreviewPreferenceContribution = Symbol('EditorPreviewPreferenceContribution');
32
- exports.EditorPreviewPreferences = Symbol('EditorPreviewPreferences');
33
- function createEditorPreviewPreferences(preferences, schema = exports.EditorPreviewConfigSchema) {
34
- return (0, common_1.createPreferenceProxy)(preferences, schema);
35
- }
36
- exports.createEditorPreviewPreferences = createEditorPreviewPreferences;
37
- function bindEditorPreviewPreferences(bind) {
38
- bind(exports.EditorPreviewPreferences).toDynamicValue(ctx => {
39
- const preferences = ctx.container.get(common_1.PreferenceService);
40
- const contribution = ctx.container.get(exports.EditorPreviewPreferenceContribution);
41
- return createEditorPreviewPreferences(preferences, contribution.schema);
42
- }).inSingletonScope();
43
- bind(exports.EditorPreviewPreferenceContribution).toConstantValue({ schema: exports.EditorPreviewConfigSchema });
44
- bind(common_1.PreferenceContribution).toService(exports.EditorPreviewPreferenceContribution);
45
- }
46
- exports.bindEditorPreviewPreferences = bindEditorPreviewPreferences;
47
- //# sourceMappingURL=editor-preview-preferences.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-preferences.js","sourceRoot":"","sources":["../../src/common/editor-preview-preferences.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,wCAAwC;AACxC,EAAE;AACF,2EAA2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ARD,oEAQC"}
@@ -1,4 +0,0 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
4
- //# sourceMappingURL=editor-preview-backend-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/editor-preview-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAG/D,wBAEG"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 STMicroelectronics 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
- const inversify_1 = require("@theia/core/shared/inversify");
19
- const editor_preview_preferences_1 = require("../common/editor-preview-preferences");
20
- exports.default = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
21
- (0, editor_preview_preferences_1.bindEditorPreviewPreferences)(bind);
22
- });
23
- //# sourceMappingURL=editor-preview-backend-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-preview-backend-module.js","sourceRoot":"","sources":["../../src/node/editor-preview-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,4DAA+D;AAC/D,qFAAoF;AAEpF,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACjE,IAAA,yDAA4B,EAAC,IAAI,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=package.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 Google and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
- /* note: this bogus test file is required so that
17
- we are able to run mocha unit tests on this
18
- package, without having any actual unit tests in it.
19
- This way a coverage report will be generated,
20
- showing 0% coverage, instead of no report.
21
- This file can be removed once we have real unit
22
- tests in place. */
23
- describe('editor package', () => {
24
- it('support code coverage statistics', () => true);
25
- });
26
- //# sourceMappingURL=package.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,wCAAwC;AACxC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;;;qBAMqB;AAErB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAE5B,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}