@theia/core 1.18.0-next.de7b81be → 1.20.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/LICENSE +642 -0
- package/README.md +3 -2
- package/lib/browser/about-dialog.d.ts.map +1 -1
- package/lib/browser/about-dialog.js +1 -1
- package/lib/browser/about-dialog.js.map +1 -1
- package/lib/browser/authentication-service.d.ts.map +1 -1
- package/lib/browser/authentication-service.js +1 -1
- package/lib/browser/authentication-service.js.map +1 -1
- package/lib/browser/color-registry.d.ts +3 -69
- package/lib/browser/color-registry.d.ts.map +1 -1
- package/lib/browser/color-registry.js +13 -27
- package/lib/browser/color-registry.js.map +1 -1
- package/lib/browser/common-frontend-contribution.d.ts +7 -0
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +138 -121
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/core-preferences.d.ts +2 -0
- package/lib/browser/core-preferences.d.ts.map +1 -1
- package/lib/browser/core-preferences.js +33 -18
- package/lib/browser/core-preferences.js.map +1 -1
- package/lib/browser/dialogs.d.ts +6 -0
- package/lib/browser/dialogs.d.ts.map +1 -1
- package/lib/browser/dialogs.js +10 -3
- package/lib/browser/dialogs.js.map +1 -1
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +3 -0
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/frontend-application.d.ts +6 -0
- package/lib/browser/frontend-application.d.ts.map +1 -1
- package/lib/browser/frontend-application.js +13 -0
- package/lib/browser/frontend-application.js.map +1 -1
- package/lib/browser/index.d.ts +1 -0
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +1 -0
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/keybinding.spec.js +5 -0
- package/lib/browser/keybinding.spec.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js +16 -11
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js +6 -4
- package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js.map +1 -1
- package/lib/browser/keyboard/keys.d.ts +2 -251
- package/lib/browser/keyboard/keys.d.ts.map +1 -1
- package/lib/browser/keyboard/keys.js +12 -614
- package/lib/browser/keyboard/keys.js.map +1 -1
- package/lib/browser/menu/browser-context-menu-renderer.d.ts +1 -1
- package/lib/browser/menu/browser-context-menu-renderer.d.ts.map +1 -1
- package/lib/browser/menu/browser-menu-plugin.d.ts +3 -0
- package/lib/browser/menu/browser-menu-plugin.d.ts.map +1 -1
- package/lib/browser/menu/browser-menu-plugin.js +24 -4
- package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.d.ts +3 -3
- package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.js +14 -4
- package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
- package/lib/browser/{nls.d.ts → nls-loader.d.ts} +1 -6
- package/lib/browser/nls-loader.d.ts.map +1 -0
- package/lib/browser/nls-loader.js +29 -0
- package/lib/browser/nls-loader.js.map +1 -0
- package/lib/browser/progress-status-bar-item.d.ts +1 -2
- package/lib/browser/progress-status-bar-item.d.ts.map +1 -1
- package/lib/browser/progress-status-bar-item.js.map +1 -1
- package/lib/browser/quick-input/quick-command-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-command-frontend-contribution.js +2 -1
- package/lib/browser/quick-input/quick-command-frontend-contribution.js.map +1 -1
- package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-command-service.js +2 -2
- package/lib/browser/quick-input/quick-command-service.js.map +1 -1
- package/lib/browser/quick-input/quick-input-service.d.ts +1 -201
- package/lib/browser/quick-input/quick-input-service.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-input-service.js +11 -93
- package/lib/browser/quick-input/quick-input-service.js.map +1 -1
- package/lib/browser/quick-input/quick-view-service.d.ts +1 -2
- package/lib/browser/quick-input/quick-view-service.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-view-service.js.map +1 -1
- package/lib/browser/shell/application-shell.d.ts +3 -1
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +1 -2
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.js +5 -3
- package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
- package/lib/browser/shell/tab-bar-decorator.d.ts +1 -1
- package/lib/browser/shell/tab-bar-decorator.d.ts.map +1 -1
- package/lib/browser/shell/tab-bar-decorator.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar.d.ts.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar.js +2 -1
- package/lib/browser/shell/tab-bar-toolbar.js.map +1 -1
- package/lib/browser/shell/tab-bars.d.ts +14 -1
- package/lib/browser/shell/tab-bars.d.ts.map +1 -1
- package/lib/browser/shell/tab-bars.js +99 -7
- package/lib/browser/shell/tab-bars.js.map +1 -1
- package/lib/browser/status-bar/status-bar.d.ts +3 -1
- package/lib/browser/status-bar/status-bar.d.ts.map +1 -1
- package/lib/browser/status-bar/status-bar.js +16 -2
- package/lib/browser/status-bar/status-bar.js.map +1 -1
- package/lib/browser/storage-service.spec.js +1 -1
- package/lib/browser/storage-service.spec.js.map +1 -1
- package/lib/browser/theming.d.ts +5 -14
- package/lib/browser/theming.d.ts.map +1 -1
- package/lib/browser/theming.js +14 -0
- package/lib/browser/theming.js.map +1 -1
- package/lib/browser/tooltip-service.d.ts +52 -0
- package/lib/browser/tooltip-service.d.ts.map +1 -0
- package/lib/browser/tooltip-service.js +89 -0
- package/lib/browser/tooltip-service.js.map +1 -0
- package/lib/browser/tree/tree-model.d.ts.map +1 -1
- package/lib/browser/tree/tree-widget.js +1 -1
- package/lib/browser/view-container.d.ts +55 -14
- package/lib/browser/view-container.d.ts.map +1 -1
- package/lib/browser/view-container.js +284 -66
- package/lib/browser/view-container.js.map +1 -1
- package/lib/browser/window/default-window-service.js +2 -2
- package/lib/browser/window/default-window-service.js.map +1 -1
- package/lib/browser/window/window-service.d.ts +1 -7
- package/lib/browser/window/window-service.d.ts.map +1 -1
- package/lib/browser/window/window-service.js +1 -5
- package/lib/browser/window/window-service.js.map +1 -1
- package/lib/browser/window-contribution.d.ts.map +1 -1
- package/lib/browser/window-contribution.js +2 -2
- package/lib/browser/window-contribution.js.map +1 -1
- package/lib/common/cancellation.d.ts +3 -0
- package/lib/common/cancellation.d.ts.map +1 -1
- package/lib/common/cancellation.js +8 -1
- package/lib/common/cancellation.js.map +1 -1
- package/lib/common/color.d.ts +84 -0
- package/lib/common/color.d.ts.map +1 -0
- package/lib/common/color.js +44 -0
- package/lib/common/color.js.map +1 -0
- package/lib/common/command.d.ts +1 -0
- package/lib/common/command.d.ts.map +1 -1
- package/lib/common/command.js +5 -1
- package/lib/common/command.js.map +1 -1
- package/lib/common/i18n/localization.d.ts +14 -0
- package/lib/common/i18n/localization.d.ts.map +1 -1
- package/lib/common/i18n/localization.js +54 -1
- package/lib/common/i18n/localization.js.map +1 -1
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/keys.d.ts +269 -0
- package/lib/common/keys.d.ts.map +1 -0
- package/lib/common/keys.js +634 -0
- package/lib/common/keys.js.map +1 -0
- package/lib/common/messaging/abstract-connection-provider.d.ts +1 -1
- package/lib/common/messaging/abstract-connection-provider.d.ts.map +1 -1
- package/lib/common/messaging/abstract-connection-provider.js +3 -1
- package/lib/common/messaging/abstract-connection-provider.js.map +1 -1
- package/lib/common/messaging/proxy-factory.js +1 -1
- package/lib/common/messaging/proxy-factory.js.map +1 -1
- package/lib/common/nls.d.ts +28 -0
- package/lib/common/nls.d.ts.map +1 -0
- package/lib/common/nls.js +91 -0
- package/lib/common/nls.js.map +1 -0
- package/lib/common/path.d.ts +6 -0
- package/lib/common/path.d.ts.map +1 -1
- package/lib/common/path.js +16 -4
- package/lib/common/path.js.map +1 -1
- package/lib/common/path.spec.js +12 -0
- package/lib/common/path.spec.js.map +1 -1
- package/lib/common/promise-util.d.ts +2 -2
- package/lib/common/promise-util.d.ts.map +1 -1
- package/lib/common/promise-util.js.map +1 -1
- package/lib/common/quick-pick-service.d.ts +219 -1
- package/lib/common/quick-pick-service.d.ts.map +1 -1
- package/lib/common/quick-pick-service.js +108 -1
- package/lib/common/quick-pick-service.js.map +1 -1
- package/lib/common/theme.d.ts +30 -0
- package/lib/common/theme.d.ts.map +1 -0
- package/lib/common/theme.js +18 -0
- package/lib/common/theme.js.map +1 -0
- package/lib/common/window.d.ts +29 -0
- package/lib/common/window.d.ts.map +1 -0
- package/lib/common/window.js +23 -0
- package/lib/common/window.js.map +1 -0
- package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts +9 -5
- package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-context-menu-renderer.js +40 -15
- package/lib/electron-browser/menu/electron-context-menu-renderer.js.map +1 -1
- package/lib/electron-browser/menu/electron-main-menu-factory.d.ts +5 -8
- package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-main-menu-factory.js +10 -17
- package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts +15 -7
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.js +112 -42
- package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
- package/lib/electron-browser/window/electron-window-preferences.d.ts +1 -0
- package/lib/electron-browser/window/electron-window-preferences.d.ts.map +1 -1
- package/lib/electron-browser/window/electron-window-preferences.js +12 -1
- package/lib/electron-browser/window/electron-window-preferences.js.map +1 -1
- package/lib/electron-browser/window/electron-window-service.d.ts +1 -1
- package/lib/electron-browser/window/electron-window-service.d.ts.map +1 -1
- package/lib/electron-common/electron-main-window-service.d.ts +1 -1
- package/lib/electron-common/electron-main-window-service.d.ts.map +1 -1
- package/lib/electron-common/messaging/electron-messages.d.ts +20 -0
- package/lib/electron-common/messaging/electron-messages.d.ts.map +1 -0
- package/lib/electron-common/messaging/electron-messages.js +23 -0
- package/lib/electron-common/messaging/electron-messages.js.map +1 -0
- package/lib/electron-main/electron-main-application.d.ts +6 -0
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +80 -23
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/lib/electron-main/electron-main-window-service-impl.d.ts +1 -1
- package/lib/electron-main/electron-main-window-service-impl.d.ts.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.d.ts +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.d.ts.map +1 -1
- package/lib/electron-main/messaging/electron-messaging-contribution.js +1 -2
- package/lib/electron-main/messaging/electron-messaging-contribution.js.map +1 -1
- package/package.json +13 -9
- package/shared/@theia/application-package/lib/api.d.ts +1 -0
- package/shared/@theia/application-package/lib/api.js +1 -0
- package/src/browser/about-dialog.tsx +2 -2
- package/src/browser/authentication-service.ts +1 -2
- package/src/browser/color-registry.ts +3 -85
- package/src/browser/common-frontend-contribution.ts +116 -99
- package/src/browser/core-preferences.ts +37 -18
- package/src/browser/dialogs.ts +10 -3
- package/src/browser/frontend-application-module.ts +4 -0
- package/src/browser/frontend-application.ts +13 -0
- package/src/browser/index.ts +1 -0
- package/src/browser/keybinding.spec.ts +8 -1
- package/src/browser/keyboard/browser-keyboard-frontend-contribution.ts +16 -11
- package/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts +10 -4
- package/src/browser/keyboard/keys.ts +2 -675
- package/src/browser/menu/browser-context-menu-renderer.ts +1 -1
- package/src/browser/menu/browser-menu-plugin.ts +25 -5
- package/src/browser/messaging/ws-connection-provider.ts +13 -4
- package/src/browser/nls-loader.ts +26 -0
- package/src/browser/progress-status-bar-item.ts +1 -2
- package/src/browser/quick-input/quick-command-frontend-contribution.ts +2 -2
- package/src/browser/quick-input/quick-command-service.ts +2 -2
- package/src/browser/quick-input/quick-input-service.ts +1 -278
- package/src/browser/quick-input/quick-view-service.ts +1 -2
- package/src/browser/shell/application-shell.ts +4 -3
- package/src/browser/shell/shell-layout-restorer.ts +4 -3
- package/src/browser/shell/tab-bar-decorator.ts +1 -1
- package/src/browser/shell/tab-bar-toolbar.tsx +3 -1
- package/src/browser/shell/tab-bars.ts +103 -8
- package/src/browser/status-bar/status-bar.tsx +16 -1
- package/src/browser/storage-service.spec.ts +1 -1
- package/src/browser/style/alert-messages.css +1 -0
- package/src/browser/style/index.css +5 -0
- package/src/browser/style/menus.css +10 -1
- package/src/browser/style/sidepanel.css +9 -3
- package/src/browser/style/tabs.css +30 -0
- package/src/browser/style/tooltip.css +28 -0
- package/src/browser/style/view-container.css +9 -9
- package/src/browser/theming.ts +6 -17
- package/src/browser/tooltip-service.tsx +98 -0
- package/src/browser/tree/tree-model.ts +1 -1
- package/src/browser/tree/tree-widget.tsx +1 -1
- package/src/browser/view-container.ts +312 -80
- package/src/browser/window/default-window-service.ts +2 -2
- package/src/browser/window/window-service.ts +1 -9
- package/src/browser/window-contribution.ts +2 -2
- package/src/common/cancellation.ts +7 -0
- package/src/common/color.ts +100 -0
- package/src/common/command.ts +11 -1
- package/src/common/i18n/localization.ts +54 -0
- package/src/common/i18n/nls.metadata.json +20421 -0
- package/src/common/index.ts +1 -0
- package/src/common/keys.ts +693 -0
- package/src/common/messaging/abstract-connection-provider.ts +3 -1
- package/src/common/messaging/proxy-factory.ts +1 -1
- package/src/common/nls.ts +104 -0
- package/src/common/path.spec.ts +15 -0
- package/src/common/path.ts +16 -4
- package/src/common/promise-util.ts +3 -3
- package/src/common/quick-pick-service.ts +299 -3
- package/src/common/theme.ts +32 -0
- package/src/common/window.ts +30 -0
- package/src/electron-browser/menu/electron-context-menu-renderer.ts +38 -16
- package/src/electron-browser/menu/electron-main-menu-factory.ts +10 -15
- package/src/electron-browser/menu/electron-menu-contribution.ts +129 -39
- package/src/electron-browser/menu/electron-menu-style.css +84 -0
- package/src/electron-browser/window/electron-window-preferences.ts +13 -1
- package/src/electron-browser/window/electron-window-service.ts +1 -1
- package/src/electron-common/electron-main-window-service.ts +1 -1
- package/src/electron-common/messaging/electron-messages.ts +20 -0
- package/src/electron-main/electron-main-application.ts +86 -20
- package/src/electron-main/electron-main-window-service-impl.ts +1 -1
- package/src/electron-main/messaging/electron-messaging-contribution.ts +1 -2
- package/lib/browser/nls.d.ts.map +0 -1
- package/lib/browser/nls.js +0 -64
- package/lib/browser/nls.js.map +0 -1
- package/src/browser/nls.ts +0 -65
|
@@ -30,6 +30,7 @@ import { TabBarDecoratorService } from './tab-bar-decorator';
|
|
|
30
30
|
import { IconThemeService } from '../icon-theme-service';
|
|
31
31
|
import { BreadcrumbsRenderer, BreadcrumbsRendererFactory } from '../breadcrumbs/breadcrumbs-renderer';
|
|
32
32
|
import { NavigatableWidget } from '../navigatable-types';
|
|
33
|
+
import { IDragEvent } from '@phosphor/dragdrop';
|
|
33
34
|
|
|
34
35
|
/** The class name added to hidden content nodes, which are required to render vertical side bars. */
|
|
35
36
|
const HIDDEN_CONTENT_CLASS = 'theia-TabBar-hidden-content';
|
|
@@ -229,11 +230,11 @@ export class TabBarRenderer extends TabBar.Renderer {
|
|
|
229
230
|
}
|
|
230
231
|
|
|
231
232
|
renderBadge(data: SideBarRenderData, isInSidePanel?: boolean): VirtualElement {
|
|
232
|
-
const
|
|
233
|
-
if (!
|
|
233
|
+
const totalBadge = this.getDecorationData(data.title, 'badge').reduce((sum, badge) => sum! + badge!, 0);
|
|
234
|
+
if (!totalBadge) {
|
|
234
235
|
return h.div({});
|
|
235
236
|
}
|
|
236
|
-
const limitedBadge =
|
|
237
|
+
const limitedBadge = totalBadge >= 100 ? '99+' : totalBadge;
|
|
237
238
|
return isInSidePanel
|
|
238
239
|
? h.div({ className: 'theia-badge-decorator-sidebar' }, `${limitedBadge}`)
|
|
239
240
|
: h.div({ className: 'theia-badge-decorator-horizontal' }, `${limitedBadge}`);
|
|
@@ -279,7 +280,6 @@ export class TabBarRenderer extends TabBar.Renderer {
|
|
|
279
280
|
*/
|
|
280
281
|
protected getDecorationData<K extends keyof WidgetDecoration.Data>(title: Title<Widget>, key: K): WidgetDecoration.Data[K][] {
|
|
281
282
|
return this.getDecorations(title).filter(data => data[key] !== undefined).map(data => data[key]);
|
|
282
|
-
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
/**
|
|
@@ -383,8 +383,8 @@ export class TabBarRenderer extends TabBar.Renderer {
|
|
|
383
383
|
* @param {SideBarRenderData} data Data used to render the tab icon.
|
|
384
384
|
* @param {boolean} isInSidePanel An optional check which determines if the tab is in the side-panel.
|
|
385
385
|
*/
|
|
386
|
-
renderIcon(data: SideBarRenderData,
|
|
387
|
-
if (!
|
|
386
|
+
renderIcon(data: SideBarRenderData, isInSidePanel?: boolean): VirtualElement {
|
|
387
|
+
if (!isInSidePanel && this.iconThemeService && this.iconThemeService.current === 'none') {
|
|
388
388
|
return h.div();
|
|
389
389
|
}
|
|
390
390
|
let top: string | undefined;
|
|
@@ -401,13 +401,13 @@ export class TabBarRenderer extends TabBar.Renderer {
|
|
|
401
401
|
if (decorationData.length > 0) {
|
|
402
402
|
const baseIcon: VirtualElement = h.div({ className: baseClassName, style }, data.title.iconLabel);
|
|
403
403
|
const wrapperClassName: string = WidgetDecoration.Styles.ICON_WRAPPER_CLASS;
|
|
404
|
-
const decoratorSizeClassName: string =
|
|
404
|
+
const decoratorSizeClassName: string = isInSidePanel ? WidgetDecoration.Styles.DECORATOR_SIDEBAR_SIZE_CLASS : WidgetDecoration.Styles.DECORATOR_SIZE_CLASS;
|
|
405
405
|
|
|
406
406
|
decorationData
|
|
407
407
|
.filter(notEmpty)
|
|
408
408
|
.map(overlay => [overlay.position, overlay] as [WidgetDecoration.IconOverlayPosition, WidgetDecoration.IconOverlay | WidgetDecoration.IconClassOverlay])
|
|
409
409
|
.forEach(([position, overlay]) => {
|
|
410
|
-
const iconAdditionalClasses: string[] = [decoratorSizeClassName, WidgetDecoration.IconOverlayPosition.getStyle(position,
|
|
410
|
+
const iconAdditionalClasses: string[] = [decoratorSizeClassName, WidgetDecoration.IconOverlayPosition.getStyle(position, isInSidePanel)];
|
|
411
411
|
const overlayIconStyle = (color?: string) => {
|
|
412
412
|
if (color === undefined) {
|
|
413
413
|
return {};
|
|
@@ -772,6 +772,18 @@ export class SideTabBar extends ScrollableTabBar {
|
|
|
772
772
|
protected onAfterAttach(msg: Message): void {
|
|
773
773
|
super.onAfterAttach(msg);
|
|
774
774
|
this.renderTabBar();
|
|
775
|
+
this.node.addEventListener('p-dragenter', this);
|
|
776
|
+
this.node.addEventListener('p-dragover', this);
|
|
777
|
+
this.node.addEventListener('p-dragleave', this);
|
|
778
|
+
document.addEventListener('p-drop', this);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
protected onAfterDetach(msg: Message): void {
|
|
782
|
+
super.onAfterDetach(msg);
|
|
783
|
+
this.node.removeEventListener('p-dragenter', this);
|
|
784
|
+
this.node.removeEventListener('p-dragover', this);
|
|
785
|
+
this.node.removeEventListener('p-dragleave', this);
|
|
786
|
+
document.removeEventListener('p-drop', this);
|
|
775
787
|
}
|
|
776
788
|
|
|
777
789
|
protected onUpdateRequest(msg: Message): void {
|
|
@@ -869,6 +881,15 @@ export class SideTabBar extends ScrollableTabBar {
|
|
|
869
881
|
this.onMouseMove(event as MouseEvent);
|
|
870
882
|
super.handleEvent(event);
|
|
871
883
|
break;
|
|
884
|
+
case 'p-dragenter':
|
|
885
|
+
this.onDragEnter(event as IDragEvent);
|
|
886
|
+
break;
|
|
887
|
+
case 'p-dragover':
|
|
888
|
+
this.onDragOver(event as IDragEvent);
|
|
889
|
+
break;
|
|
890
|
+
case 'p-dragleave': case 'p-drop':
|
|
891
|
+
this.cancelViewContainerDND();
|
|
892
|
+
break;
|
|
872
893
|
default:
|
|
873
894
|
super.handleEvent(event);
|
|
874
895
|
}
|
|
@@ -934,4 +955,78 @@ export class SideTabBar extends ScrollableTabBar {
|
|
|
934
955
|
}
|
|
935
956
|
}
|
|
936
957
|
|
|
958
|
+
toCancelViewContainerDND = new DisposableCollection();
|
|
959
|
+
protected cancelViewContainerDND = () => {
|
|
960
|
+
this.toCancelViewContainerDND.dispose();
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* Handles `viewContainerPart` drag enter.
|
|
965
|
+
*/
|
|
966
|
+
protected onDragEnter = (event: IDragEvent) => {
|
|
967
|
+
this.cancelViewContainerDND();
|
|
968
|
+
if (event.mimeData.getData('application/vnd.phosphor.view-container-factory')) {
|
|
969
|
+
event.preventDefault();
|
|
970
|
+
event.stopPropagation();
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Handle `viewContainerPart` drag over,
|
|
976
|
+
* Defines the appropriate `drpAction` and opens the tab on which the mouse stands on for more than 800 ms.
|
|
977
|
+
*/
|
|
978
|
+
protected onDragOver = (event: IDragEvent) => {
|
|
979
|
+
const factory = event.mimeData.getData('application/vnd.phosphor.view-container-factory');
|
|
980
|
+
const widget = factory && factory();
|
|
981
|
+
if (!widget) {
|
|
982
|
+
event.dropAction = 'none';
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
event.preventDefault();
|
|
986
|
+
event.stopPropagation();
|
|
987
|
+
if (!this.toCancelViewContainerDND.disposed) {
|
|
988
|
+
event.dropAction = event.proposedAction;
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
const { target, clientX, clientY } = event;
|
|
993
|
+
if (target instanceof HTMLElement) {
|
|
994
|
+
if (widget.options.disableDraggingToOtherContainers || widget.viewContainer.disableDNDBetweenContainers) {
|
|
995
|
+
event.dropAction = 'none';
|
|
996
|
+
target.classList.add('theia-cursor-no-drop');
|
|
997
|
+
this.toCancelViewContainerDND.push(Disposable.create(() => {
|
|
998
|
+
target.classList.remove('theia-cursor-no-drop');
|
|
999
|
+
}));
|
|
1000
|
+
} else {
|
|
1001
|
+
event.dropAction = event.proposedAction;
|
|
1002
|
+
}
|
|
1003
|
+
const { top, bottom, left, right, height } = target.getBoundingClientRect();
|
|
1004
|
+
const mouseOnTop = (clientY - top) < (height / 2);
|
|
1005
|
+
const dropTargetClass = `drop-target-${mouseOnTop ? 'top' : 'bottom'}`;
|
|
1006
|
+
const tabs = this.contentNode.children;
|
|
1007
|
+
const targetTab = ArrayExt.findFirstValue(tabs, t => ElementExt.hitTest(t, clientX, clientY));
|
|
1008
|
+
if (!targetTab) {
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
targetTab.classList.add(dropTargetClass);
|
|
1012
|
+
this.toCancelViewContainerDND.push(Disposable.create(() => {
|
|
1013
|
+
if (targetTab) {
|
|
1014
|
+
targetTab.classList.remove(dropTargetClass);
|
|
1015
|
+
}
|
|
1016
|
+
}));
|
|
1017
|
+
const openTabTimer = setTimeout(() => {
|
|
1018
|
+
const title = this.titles.find(t => (this.renderer as TabBarRenderer).createTabId(t) === targetTab.id);
|
|
1019
|
+
if (title) {
|
|
1020
|
+
const mouseStillOnTab = clientX >= left && clientX <= right && clientY >= top && clientY <= bottom;
|
|
1021
|
+
if (mouseStillOnTab) {
|
|
1022
|
+
this.currentTitle = title;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}, 800);
|
|
1026
|
+
this.toCancelViewContainerDND.push(Disposable.create(() => {
|
|
1027
|
+
clearTimeout(openTabTimer);
|
|
1028
|
+
}));
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
|
|
937
1032
|
}
|
|
@@ -21,6 +21,7 @@ import { CommandService } from '../../common';
|
|
|
21
21
|
import { ReactWidget } from '../widgets/react-widget';
|
|
22
22
|
import { FrontendApplicationStateService } from '../frontend-application-state';
|
|
23
23
|
import { LabelParser, LabelIcon } from '../label-parser';
|
|
24
|
+
import { PreferenceService } from '../preferences';
|
|
24
25
|
|
|
25
26
|
export interface StatusBarEntry {
|
|
26
27
|
/**
|
|
@@ -78,12 +79,26 @@ export class StatusBarImpl extends ReactWidget implements StatusBar {
|
|
|
78
79
|
constructor(
|
|
79
80
|
@inject(CommandService) protected readonly commands: CommandService,
|
|
80
81
|
@inject(LabelParser) protected readonly entryService: LabelParser,
|
|
81
|
-
@inject(FrontendApplicationStateService) protected readonly applicationStateService: FrontendApplicationStateService
|
|
82
|
+
@inject(FrontendApplicationStateService) protected readonly applicationStateService: FrontendApplicationStateService,
|
|
83
|
+
@inject(PreferenceService) protected readonly preferences: PreferenceService,
|
|
82
84
|
) {
|
|
83
85
|
super();
|
|
84
86
|
delete this.scrollOptions;
|
|
85
87
|
this.id = 'theia-statusBar';
|
|
86
88
|
this.addClass('noselect');
|
|
89
|
+
// Hide the status bar until the `workbench.statusBar.visible` preference returns with a `true` value.
|
|
90
|
+
this.hide();
|
|
91
|
+
this.preferences.ready.then(() => {
|
|
92
|
+
const preferenceValue = this.preferences.get<boolean>('workbench.statusBar.visible', true);
|
|
93
|
+
this.setHidden(!preferenceValue);
|
|
94
|
+
});
|
|
95
|
+
this.toDispose.push(
|
|
96
|
+
this.preferences.onPreferenceChanged(preference => {
|
|
97
|
+
if (preference.preferenceName === 'workbench.statusBar.visible') {
|
|
98
|
+
this.setHidden(!preference.newValue);
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
);
|
|
87
102
|
}
|
|
88
103
|
|
|
89
104
|
protected get ready(): Promise<void> {
|
|
@@ -34,7 +34,7 @@ before(() => {
|
|
|
34
34
|
MockLogger since it does what we need but this is there as a demo of
|
|
35
35
|
sinon for other uses-cases. We can remove this once this technique is
|
|
36
36
|
more generally used. */
|
|
37
|
-
sinon.stub(logger, 'warn').callsFake(() => { });
|
|
37
|
+
sinon.stub(logger, 'warn').callsFake(async () => { });
|
|
38
38
|
return logger;
|
|
39
39
|
});
|
|
40
40
|
testContainer.bind(StorageService).to(LocalStorageService).inSingletonScope();
|
|
@@ -235,6 +235,10 @@ button.secondary[disabled], .theia-button.secondary[disabled] {
|
|
|
235
235
|
z-index: 999;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
.theia-cursor-no-drop, .theia-cursor-no-drop:active {
|
|
239
|
+
cursor: no-drop;
|
|
240
|
+
}
|
|
241
|
+
|
|
238
242
|
/*-----------------------------------------------------------------------------
|
|
239
243
|
| Import children style files
|
|
240
244
|
|----------------------------------------------------------------------------*/
|
|
@@ -259,3 +263,4 @@ button.secondary[disabled], .theia-button.secondary[disabled] {
|
|
|
259
263
|
@import './quick-title-bar.css';
|
|
260
264
|
@import './progress-bar.css';
|
|
261
265
|
@import './breadcrumbs.css';
|
|
266
|
+
@import './tooltip.css';
|
|
@@ -160,13 +160,14 @@
|
|
|
160
160
|
|
|
161
161
|
.p-Menu-itemSubmenuIcon {
|
|
162
162
|
width: var(--theia-icon-size);
|
|
163
|
-
padding: 0px
|
|
163
|
+
padding: 0px 10px 0px 0px;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
|
|
167
167
|
.p-Menu-item[data-type='separator'] > div {
|
|
168
168
|
padding: 0;
|
|
169
169
|
height: 9px;
|
|
170
|
+
opacity: 0.36;
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
|
|
@@ -178,6 +179,14 @@
|
|
|
178
179
|
border-top: var(--theia-border-width) solid var(--theia-menu-separatorBackground);
|
|
179
180
|
}
|
|
180
181
|
|
|
182
|
+
.p-Menu-item[data-type='separator'] > div.p-Menu-itemIcon::after {
|
|
183
|
+
margin-left: 12px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.p-Menu-item[data-type='separator'] > div.p-Menu-itemSubmenuIcon::after {
|
|
187
|
+
margin-right: 12px;
|
|
188
|
+
}
|
|
189
|
+
|
|
181
190
|
.p-Menu-itemIcon::before,
|
|
182
191
|
.p-Menu-itemSubmenuIcon::before {
|
|
183
192
|
font: normal normal normal 16px/1 codicon;
|
|
@@ -128,6 +128,11 @@
|
|
|
128
128
|
-webkit-mask-position: 50% 50%;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
/* inactive legacy/plugin icons */
|
|
132
|
+
.p-TabBar.theia-app-sides .p-TabBar-tabIcon:not(.codicon) {
|
|
133
|
+
background: var(--theia-activityBar-inactiveForeground);
|
|
134
|
+
}
|
|
135
|
+
|
|
131
136
|
/* inactive file icons */
|
|
132
137
|
.p-TabBar.theia-app-sides .file-icon.p-TabBar-tabIcon {
|
|
133
138
|
background: inherit !important;
|
|
@@ -144,8 +149,9 @@
|
|
|
144
149
|
color: var(--theia-activityBar-foreground);
|
|
145
150
|
}
|
|
146
151
|
|
|
147
|
-
|
|
148
|
-
.p-TabBar.theia-app-sides .p-
|
|
152
|
+
/* active legacy/plugin icons */
|
|
153
|
+
.p-TabBar.theia-app-sides .p-TabBar-tabIcon:not(.codicon):hover,
|
|
154
|
+
.p-TabBar.theia-app-sides .p-mod-current .p-TabBar-tabIcon:not(.codicon) {
|
|
149
155
|
background-color: var(--theia-activityBar-foreground);
|
|
150
156
|
}
|
|
151
157
|
|
|
@@ -219,7 +225,7 @@
|
|
|
219
225
|
}
|
|
220
226
|
|
|
221
227
|
.theia-sidebar-menu > i.codicon-menu {
|
|
222
|
-
font-size:
|
|
228
|
+
font-size: 16px;
|
|
223
229
|
}
|
|
224
230
|
|
|
225
231
|
/*-----------------------------------------------------------------------------
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
--theia-tabbar-toolbar-z-index: 1001;
|
|
11
11
|
--theia-toolbar-active-transform-scale: 1.272019649;
|
|
12
12
|
--theia-horizontal-toolbar-height: calc(var(--theia-private-horizontal-tab-height) + var(--theia-private-horizontal-tab-scrollbar-rail-height) / 2);
|
|
13
|
+
--theia-dragover-tab-border-width: 2px;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/*-----------------------------------------------------------------------------
|
|
@@ -39,6 +40,19 @@
|
|
|
39
40
|
align-items: center;
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
.p-TabBar[data-orientation='vertical'] .p-TabBar-tab {
|
|
44
|
+
border-top: var(--theia-dragover-tab-border-width) solid transparent !important;
|
|
45
|
+
border-bottom: var(--theia-dragover-tab-border-width) solid transparent !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.p-TabBar[data-orientation='vertical'] .p-TabBar-tab.drop-target-top {
|
|
49
|
+
border-top-color: var(--theia-activityBar-activeBorder) !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.p-TabBar[data-orientation='vertical'] .p-TabBar-tab.drop-target-bottom {
|
|
53
|
+
border-bottom-color: var(--theia-activityBar-activeBorder) !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
42
56
|
.p-TabBar[data-orientation='horizontal'] .p-TabBar-tab .theia-tab-icon-label,
|
|
43
57
|
.p-TabBar-tab.p-mod-drag-image .theia-tab-icon-label {
|
|
44
58
|
display: flex;
|
|
@@ -185,11 +199,13 @@ body.theia-editor-highlightModifiedTabs
|
|
|
185
199
|
background-repeat: no-repeat;
|
|
186
200
|
}
|
|
187
201
|
|
|
202
|
+
/* common icons */
|
|
188
203
|
.p-TabBar.theia-app-centers .p-TabBar-tabIcon,
|
|
189
204
|
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon {
|
|
190
205
|
min-height: 14px;
|
|
191
206
|
background-size: 13px;
|
|
192
207
|
background-position-y: 3px;
|
|
208
|
+
background: var(--theia-icon-foreground);
|
|
193
209
|
-webkit-mask-repeat: no-repeat;
|
|
194
210
|
-webkit-mask-size: auto 13px;
|
|
195
211
|
mask-repeat: no-repeat;
|
|
@@ -197,6 +213,20 @@ body.theia-editor-highlightModifiedTabs
|
|
|
197
213
|
padding-right: 8px;
|
|
198
214
|
}
|
|
199
215
|
|
|
216
|
+
/* codicons */
|
|
217
|
+
.p-TabBar.theia-app-centers .p-TabBar-tabIcon.codicon,
|
|
218
|
+
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon.codicon {
|
|
219
|
+
background: none;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* file icons */
|
|
223
|
+
.p-TabBar[data-orientation='horizontal'] .p-TabBar-tabIcon.file-icon,
|
|
224
|
+
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon.file-icon {
|
|
225
|
+
background: none;
|
|
226
|
+
padding-bottom: 0px;
|
|
227
|
+
min-height: 20px;
|
|
228
|
+
}
|
|
229
|
+
|
|
200
230
|
.p-TabBar[data-orientation='horizontal'] .p-TabBar-tabIcon.fa,
|
|
201
231
|
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon.fa {
|
|
202
232
|
background: none;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 Arm 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 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
.theia-tooltip {
|
|
18
|
+
color: var(--theia-list-hoverForeground) !important;
|
|
19
|
+
background: var(--theia-list-hoverBackground) !important;
|
|
20
|
+
border: 1px solid !important;
|
|
21
|
+
border-color: var(--theia-list-hoverForeground) !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Hide tooltip arrow */
|
|
25
|
+
.theia-tooltip::before,
|
|
26
|
+
.theia-tooltip::after {
|
|
27
|
+
border: none !important;
|
|
28
|
+
}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
height: 100%;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
.theia-view-container
|
|
53
|
+
.theia-view-container-part-header {
|
|
54
54
|
cursor: pointer;
|
|
55
55
|
display: flex;
|
|
56
56
|
align-items: center;
|
|
@@ -61,26 +61,26 @@
|
|
|
61
61
|
font-weight: 700;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
.theia-view-container
|
|
64
|
+
.theia-view-container-part-header .theia-ExpansionToggle {
|
|
65
65
|
padding-left: 4px;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.theia-view-container > .p-SplitPanel[data-orientation='horizontal'] .part > .header .theia-ExpansionToggle::before {
|
|
68
|
+
.theia-view-container > .p-SplitPanel[data-orientation='horizontal'] .part > .theia-header .theia-ExpansionToggle::before {
|
|
69
69
|
display: none;
|
|
70
70
|
padding-left: 0px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.theia-view-container > .p-SplitPanel[data-orientation='horizontal'] .part > .header .theia-ExpansionToggle {
|
|
73
|
+
.theia-view-container > .p-SplitPanel[data-orientation='horizontal'] .part > .theia-header .theia-ExpansionToggle {
|
|
74
74
|
padding-left: 0px;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
.theia-view-container
|
|
77
|
+
.theia-view-container-part-header .label {
|
|
78
78
|
flex: 0;
|
|
79
79
|
white-space: nowrap;
|
|
80
80
|
text-overflow: ellipsis;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
.theia-view-container
|
|
83
|
+
.theia-view-container-part-header .description {
|
|
84
84
|
flex: 1;
|
|
85
85
|
overflow: hidden;
|
|
86
86
|
white-space: nowrap;
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.theia-view-container .part.drop-target {
|
|
110
|
-
background: var(--theia-
|
|
110
|
+
background: var(--theia-list-dropBackground);
|
|
111
111
|
border: var(--theia-border-width) dashed var(--theia-contrastActiveBorder);
|
|
112
112
|
transition-property: top, left, right, bottom;
|
|
113
113
|
transition-duration: 150ms;
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
.theia-view-container-part-title.menu-open,
|
|
146
|
-
.p-Widget.part:not(.collapsed):hover .header .theia-view-container-part-title,
|
|
147
|
-
.p-Widget.part:not(.collapsed):focus-within .header .theia-view-container-part-title {
|
|
146
|
+
.p-Widget.part:not(.collapsed):hover .theia-view-container-part-header .theia-view-container-part-title,
|
|
147
|
+
.p-Widget.part:not(.collapsed):focus-within .theia-view-container-part-header .theia-view-container-part-title {
|
|
148
148
|
display: flex;
|
|
149
149
|
}
|
package/src/browser/theming.ts
CHANGED
|
@@ -18,25 +18,14 @@ import { Emitter, Event } from '../common/event';
|
|
|
18
18
|
import { Disposable } from '../common/disposable';
|
|
19
19
|
import { FrontendApplicationConfigProvider } from './frontend-application-config-provider';
|
|
20
20
|
import { ApplicationProps } from '@theia/application-package/lib/application-props';
|
|
21
|
+
import { Theme, ThemeChangeEvent } from '../common/theme';
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export interface Theme {
|
|
27
|
-
readonly id: string;
|
|
28
|
-
readonly type: ThemeType;
|
|
29
|
-
readonly label: string;
|
|
30
|
-
readonly description?: string;
|
|
31
|
-
readonly editorTheme?: string;
|
|
32
|
-
activate(): void;
|
|
33
|
-
deactivate(): void;
|
|
34
|
-
}
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated since 1.20.0. Import from `@theia/core/lib/common/theme` instead.
|
|
25
|
+
*/
|
|
26
|
+
export * from '../common/theme';
|
|
35
27
|
|
|
36
|
-
export
|
|
37
|
-
readonly newTheme: Theme;
|
|
38
|
-
readonly oldTheme?: Theme;
|
|
39
|
-
}
|
|
28
|
+
export const ThemeServiceSymbol = Symbol('ThemeService');
|
|
40
29
|
|
|
41
30
|
export class ThemeService {
|
|
42
31
|
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 Arm 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 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import { injectable, inject, optional, postConstruct } from 'inversify';
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import ReactTooltip from 'react-tooltip';
|
|
20
|
+
import { ReactRenderer, RendererHost } from './widgets/react-renderer';
|
|
21
|
+
import { CorePreferences } from './core-preferences';
|
|
22
|
+
import { DisposableCollection } from '../common/disposable';
|
|
23
|
+
import { v4 } from 'uuid';
|
|
24
|
+
|
|
25
|
+
export const TooltipService = Symbol('TooltipService');
|
|
26
|
+
|
|
27
|
+
export interface TooltipService {
|
|
28
|
+
tooltipId: string;
|
|
29
|
+
attachTo(host: HTMLElement): void;
|
|
30
|
+
update(fullRender?: boolean): void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Attributes to be added to an HTML element to enable
|
|
35
|
+
* rich HTML tooltip rendering
|
|
36
|
+
*/
|
|
37
|
+
export interface TooltipAttributes {
|
|
38
|
+
/**
|
|
39
|
+
* HTML to render in the tooltip.
|
|
40
|
+
*/
|
|
41
|
+
'data-tip': string;
|
|
42
|
+
/**
|
|
43
|
+
* The ID of the tooltip renderer. Should be TOOLTIP_ID.
|
|
44
|
+
*/
|
|
45
|
+
'data-for': string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const DELAY_PREFERENCE = 'workbench.hover.delay';
|
|
49
|
+
|
|
50
|
+
@injectable()
|
|
51
|
+
export class TooltipServiceImpl extends ReactRenderer implements TooltipService {
|
|
52
|
+
|
|
53
|
+
@inject(CorePreferences)
|
|
54
|
+
protected readonly corePreferences: CorePreferences;
|
|
55
|
+
|
|
56
|
+
public readonly tooltipId: string;
|
|
57
|
+
protected rendered = false;
|
|
58
|
+
protected toDispose: DisposableCollection = new DisposableCollection();
|
|
59
|
+
|
|
60
|
+
constructor(
|
|
61
|
+
@inject(RendererHost) @optional() host?: RendererHost
|
|
62
|
+
) {
|
|
63
|
+
super(host);
|
|
64
|
+
this.tooltipId = v4();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@postConstruct()
|
|
68
|
+
protected init(): void {
|
|
69
|
+
this.toDispose.push(this.corePreferences.onPreferenceChanged(preference => {
|
|
70
|
+
if (preference.preferenceName === DELAY_PREFERENCE) {
|
|
71
|
+
this.update(true);
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public attachTo(host: HTMLElement): void {
|
|
77
|
+
host.appendChild(this.host);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public update(fullRender = false): void {
|
|
81
|
+
if (fullRender || !this.rendered) {
|
|
82
|
+
this.render();
|
|
83
|
+
this.rendered = true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
ReactTooltip.rebuild();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
protected doRender(): React.ReactNode {
|
|
90
|
+
const hoverDelay = this.corePreferences.get(DELAY_PREFERENCE);
|
|
91
|
+
return <ReactTooltip id={this.tooltipId} className='theia-tooltip' html={true} delayShow={hoverDelay} />;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public dispose(): void {
|
|
95
|
+
this.toDispose.dispose();
|
|
96
|
+
super.dispose();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -19,7 +19,7 @@ import { Event, Emitter, WaitUntilEvent } from '../../common/event';
|
|
|
19
19
|
import { DisposableCollection } from '../../common/disposable';
|
|
20
20
|
import { CancellationToken } from '../../common/cancellation';
|
|
21
21
|
import { ILogger } from '../../common/logger';
|
|
22
|
-
import { SelectionProvider
|
|
22
|
+
import { SelectionProvider } from '../../common/selection-service';
|
|
23
23
|
import { Tree, TreeNode, CompositeTreeNode } from './tree';
|
|
24
24
|
import { TreeSelectionService, SelectableTreeNode, TreeSelection } from './tree-selection';
|
|
25
25
|
import { TreeExpansionService, ExpandableTreeNode } from './tree-expansion';
|