@theia/core 1.55.0 → 1.56.0
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 +9 -9
- package/i18n/nls.cs.json +0 -1
- package/i18n/nls.de.json +0 -1
- package/i18n/nls.es.json +0 -1
- package/i18n/nls.fr.json +0 -1
- package/i18n/nls.hu.json +0 -1
- package/i18n/nls.it.json +0 -1
- package/i18n/nls.ja.json +0 -1
- package/i18n/nls.json +0 -1
- package/i18n/nls.ko.json +0 -1
- package/i18n/nls.pl.json +0 -1
- package/i18n/nls.pt-br.json +0 -1
- package/i18n/nls.ru.json +0 -1
- package/i18n/nls.tr.json +0 -1
- package/i18n/nls.zh-cn.json +0 -1
- package/i18n/nls.zh-tw.json +0 -1
- package/lib/browser/catalog.json +108 -19
- package/lib/browser/common-frontend-contribution.js +1 -1
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/dialogs.d.ts +2 -1
- package/lib/browser/dialogs.d.ts.map +1 -1
- package/lib/browser/dialogs.js +20 -2
- package/lib/browser/dialogs.js.map +1 -1
- package/lib/browser/shell/view-contribution.d.ts.map +1 -1
- package/lib/browser/shell/view-contribution.js +1 -0
- package/lib/browser/shell/view-contribution.js.map +1 -1
- package/lib/browser/tree/tree-decorator.d.ts.map +1 -1
- package/lib/browser/tree/tree-decorator.js +1 -0
- package/lib/browser/tree/tree-decorator.js.map +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.d.ts +17 -11
- package/lib/browser/tree/tree-view-welcome-widget.d.ts.map +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.js +65 -34
- package/lib/browser/tree/tree-view-welcome-widget.js.map +1 -1
- package/lib/browser/widgets/select-component.js +1 -1
- package/lib/browser/widgets/select-component.js.map +1 -1
- package/lib/browser/widgets/widget.d.ts +1 -1
- package/lib/browser/widgets/widget.d.ts.map +1 -1
- package/lib/browser/widgets/widget.js +21 -6
- package/lib/browser/widgets/widget.js.map +1 -1
- package/lib/common/performance/stopwatch.d.ts.map +1 -1
- package/lib/common/performance/stopwatch.js +1 -0
- package/lib/common/performance/stopwatch.js.map +1 -1
- package/lib/common/theme.d.ts +1 -1
- package/lib/common/theme.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.js +10 -2
- package/lib/electron-browser/menu/electron-context-menu-renderer.js.map +1 -1
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +4 -1
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/package.json +8 -8
- package/src/browser/common-frontend-contribution.ts +1 -1
- package/src/browser/dialogs.ts +21 -5
- package/src/browser/shell/view-contribution.ts +2 -2
- package/src/browser/tree/tree-decorator.ts +2 -2
- package/src/browser/tree/tree-view-welcome-widget.tsx +82 -46
- package/src/browser/widgets/select-component.tsx +1 -1
- package/src/browser/widgets/widget.ts +21 -6
- package/src/common/performance/stopwatch.ts +2 -2
- package/src/common/theme.ts +1 -1
- package/src/electron-browser/menu/electron-context-menu-renderer.ts +10 -2
- package/src/electron-main/electron-main-application.ts +2 -1
|
@@ -24,6 +24,7 @@ import { KeyCode, KeysOrKeyCodes } from '../keyboard/keys';
|
|
|
24
24
|
|
|
25
25
|
import PerfectScrollbar from 'perfect-scrollbar';
|
|
26
26
|
import { PreviewableWidget } from '../widgets/previewable-widget';
|
|
27
|
+
import { Slot } from '@phosphor/signaling';
|
|
27
28
|
|
|
28
29
|
decorate(injectable(), Widget);
|
|
29
30
|
decorate(unmanaged(), Widget, 0);
|
|
@@ -116,7 +117,7 @@ export class BaseWidget extends Widget implements PreviewableWidget {
|
|
|
116
117
|
protected scrollBar?: PerfectScrollbar;
|
|
117
118
|
protected scrollOptions?: PerfectScrollbar.Options;
|
|
118
119
|
|
|
119
|
-
constructor(options?: Widget.IOptions) {
|
|
120
|
+
constructor(@unmanaged() options?: Widget.IOptions) {
|
|
120
121
|
super(options);
|
|
121
122
|
}
|
|
122
123
|
|
|
@@ -364,23 +365,37 @@ function waitForVisible(widget: Widget, visible: boolean, attached?: boolean): P
|
|
|
364
365
|
});
|
|
365
366
|
}
|
|
366
367
|
|
|
368
|
+
const pinnedTitles = new Map<Title<Widget>, [boolean, Slot<Widget, void>]>();
|
|
369
|
+
|
|
367
370
|
export function isPinned(title: Title<Widget>): boolean {
|
|
368
371
|
const pinnedState = !title.closable && title.className.includes(PINNED_CLASS);
|
|
369
372
|
return pinnedState;
|
|
370
373
|
}
|
|
371
374
|
|
|
372
|
-
export function unpin(title: Title<Widget>): void {
|
|
373
|
-
title.closable = true;
|
|
374
|
-
title.className = title.className.replace(PINNED_CLASS, '').trim();
|
|
375
|
-
}
|
|
376
|
-
|
|
377
375
|
export function pin(title: Title<Widget>): void {
|
|
376
|
+
const l = () => {
|
|
377
|
+
pinnedTitles.delete(title);
|
|
378
|
+
};
|
|
379
|
+
pinnedTitles.set(title, [title.closable, l]);
|
|
380
|
+
title.owner.disposed.connect(l);
|
|
378
381
|
title.closable = false;
|
|
379
382
|
if (!title.className.includes(PINNED_CLASS)) {
|
|
380
383
|
title.className += ` ${PINNED_CLASS}`;
|
|
381
384
|
}
|
|
382
385
|
}
|
|
383
386
|
|
|
387
|
+
export function unpin(title: Title<Widget>): void {
|
|
388
|
+
const entry = pinnedTitles.get(title);
|
|
389
|
+
if (entry) {
|
|
390
|
+
title.owner.disposed.disconnect(entry[1]);
|
|
391
|
+
title.closable = entry[0];
|
|
392
|
+
pinnedTitles.delete(title);
|
|
393
|
+
} else {
|
|
394
|
+
title.closable = true;
|
|
395
|
+
}
|
|
396
|
+
title.className = title.className.replace(PINNED_CLASS, '').trim();
|
|
397
|
+
}
|
|
398
|
+
|
|
384
399
|
export function isLocked(title: Title<Widget>): boolean {
|
|
385
400
|
return title.className.includes(LOCKED_CLASS);
|
|
386
401
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
18
|
|
|
19
|
-
import { inject, injectable } from 'inversify';
|
|
19
|
+
import { inject, injectable, unmanaged } from 'inversify';
|
|
20
20
|
import { ILogger, LogLevel } from '../logger';
|
|
21
21
|
import { MaybePromise } from '../types';
|
|
22
22
|
import { Measurement, MeasurementOptions, MeasurementResult } from './measurement';
|
|
@@ -58,7 +58,7 @@ export abstract class Stopwatch {
|
|
|
58
58
|
return this.onDidAddMeasurementResultEmitter.event;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
constructor(protected readonly defaultLogOptions: LogOptions) {
|
|
61
|
+
constructor(@unmanaged() protected readonly defaultLogOptions: LogOptions) {
|
|
62
62
|
if (!defaultLogOptions.defaultLogLevel) {
|
|
63
63
|
defaultLogOptions.defaultLogLevel = DEFAULT_LOG_LEVEL;
|
|
64
64
|
}
|
package/src/common/theme.ts
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import { ElectronMainMenuFactory } from './electron-main-menu-factory';
|
|
24
24
|
import { ContextMenuContext } from '../../browser/menu/context-menu-context';
|
|
25
25
|
import { MenuPath, MenuContribution, MenuModelRegistry } from '../../common';
|
|
26
|
-
import { BrowserContextMenuRenderer } from '../../browser/menu/browser-context-menu-renderer';
|
|
26
|
+
import { BrowserContextMenuAccess, BrowserContextMenuRenderer } from '../../browser/menu/browser-context-menu-renderer';
|
|
27
27
|
|
|
28
28
|
export class ElectronContextMenuAccess extends ContextMenuAccess {
|
|
29
29
|
constructor(readonly menuHandle: Promise<number>) {
|
|
@@ -115,7 +115,15 @@ export class ElectronContextMenuRenderer extends BrowserContextMenuRenderer {
|
|
|
115
115
|
this.context.resetAltPressed();
|
|
116
116
|
return new ElectronContextMenuAccess(menuHandle);
|
|
117
117
|
} else {
|
|
118
|
-
|
|
118
|
+
const menuAccess = super.doRender(options);
|
|
119
|
+
const node = (menuAccess as BrowserContextMenuAccess).menu.node;
|
|
120
|
+
const topPanelHeight = document.getElementById('theia-top-panel')?.clientHeight ?? 0;
|
|
121
|
+
// ensure the context menu is not displayed outside of the main area
|
|
122
|
+
if (node.style.top && parseInt(node.style.top.substring(0, node.style.top.length - 2)) < topPanelHeight) {
|
|
123
|
+
node.style.top = `${topPanelHeight}px`;
|
|
124
|
+
node.style.maxHeight = `calc(${node.style.maxHeight} - ${topPanelHeight}px)`;
|
|
125
|
+
}
|
|
126
|
+
return menuAccess;
|
|
119
127
|
}
|
|
120
128
|
}
|
|
121
129
|
|
|
@@ -272,6 +272,7 @@ export class ElectronMainApplication {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
setBackgroundColor(webContents: WebContents, backgroundColor: string): void {
|
|
275
|
+
BrowserWindow.fromWebContents(webContents)?.setBackgroundColor(backgroundColor);
|
|
275
276
|
this.customBackgroundColor = backgroundColor;
|
|
276
277
|
this.saveState(webContents);
|
|
277
278
|
}
|
|
@@ -628,7 +629,7 @@ export class ElectronMainApplication {
|
|
|
628
629
|
y: bounds.y,
|
|
629
630
|
frame: this.useNativeWindowFrame,
|
|
630
631
|
screenLayout: this.getCurrentScreenLayout(),
|
|
631
|
-
backgroundColor: this.customBackgroundColor
|
|
632
|
+
backgroundColor: this.customBackgroundColor ?? electronWindow.getBackgroundColor()
|
|
632
633
|
};
|
|
633
634
|
this.electronStore.set('windowstate', options);
|
|
634
635
|
} catch (e) {
|