@codingame/monaco-vscode-views-service-override 2.0.3 → 2.1.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/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +11 -11
- package/tools/editor.js +14 -0
- package/views.js +12 -5
- package/vscode/src/vs/base/common/codicons.d.ts +5 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +2 -2
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +160 -4
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +14 -19
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +59 -21
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +77 -45
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +23 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +77 -45
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +131 -5
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +1 -3
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +8 -16
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +8 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +4 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +3 -4
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +17 -16
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +2 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +2 -1
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +18 -4
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +2 -2
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +15 -4
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +2 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +6 -2
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.css.js +0 -6
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.js +0 -290
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +0 -801
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +0 -142
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +0 -412
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +0 -1315
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +0 -186
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +0 -346
- package/vscode/src/vs/workbench/browser/parts/editor/editorTitleControl.js +0 -154
- package/vscode/src/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/singleeditortabscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +0 -1623
- package/vscode/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.js +0 -152
- package/vscode/src/vs/workbench/browser/parts/editor/noEditorTabsControl.js +0 -54
- package/vscode/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.js +0 -259
- package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +0 -109
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.js +0 -195
- package/vscode/src/vs/workbench/services/hover/browser/hoverWidget.js +0 -528
- package/vscode/src/vs/workbench/services/hover/browser/media/hover.css.js +0 -6
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
-
import { getWindow, addDisposableListener, prepend, append, $ as $$1, getDomNodeZoomLevel } from 'vscode/vscode/vs/base/browser/dom';
|
|
5
|
-
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
6
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
7
|
-
import { EDITOR_FONT_DEFAULTS } from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
8
|
-
import { HoverWidget as HoverWidget$1, getHoverAccessibleViewHint } from 'vscode/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
9
|
-
import { Widget } from 'vscode/vscode/vs/base/browser/ui/widget';
|
|
10
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
11
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
|
-
import { openLinkFromMarkdown, MarkdownRenderer } from 'vscode/vscode/vs/editor/contrib/markdownRenderer/browser/markdownRenderer';
|
|
13
|
-
import { isMarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
14
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
15
|
-
import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
|
|
16
|
-
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
17
|
-
import { status } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
|
|
18
|
-
|
|
19
|
-
const $ = $$1;
|
|
20
|
-
let HoverWidget = class HoverWidget extends Widget {
|
|
21
|
-
get _targetWindow() {
|
|
22
|
-
return getWindow(this._target.targetElements[0]);
|
|
23
|
-
}
|
|
24
|
-
get _targetDocumentElement() {
|
|
25
|
-
return getWindow(this._target.targetElements[0]).document.documentElement;
|
|
26
|
-
}
|
|
27
|
-
get isDisposed() { return this._isDisposed; }
|
|
28
|
-
get isMouseIn() { return this._lockMouseTracker.isMouseIn; }
|
|
29
|
-
get domNode() { return this._hover.containerDomNode; }
|
|
30
|
-
get onDispose() { return this._onDispose.event; }
|
|
31
|
-
get onRequestLayout() { return this._onRequestLayout.event; }
|
|
32
|
-
get anchor() { return this._hoverPosition === 2 ? 0 : 1 ; }
|
|
33
|
-
get x() { return this._x; }
|
|
34
|
-
get y() { return this._y; }
|
|
35
|
-
get isLocked() { return this._isLocked; }
|
|
36
|
-
set isLocked(value) {
|
|
37
|
-
if (this._isLocked === value) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
this._isLocked = value;
|
|
41
|
-
this._hoverContainer.classList.toggle('locked', this._isLocked);
|
|
42
|
-
}
|
|
43
|
-
constructor(options, _keybindingService, _configurationService, _openerService, _instantiationService, _accessibilityService) {
|
|
44
|
-
super();
|
|
45
|
-
this._keybindingService = _keybindingService;
|
|
46
|
-
this._configurationService = _configurationService;
|
|
47
|
-
this._openerService = _openerService;
|
|
48
|
-
this._instantiationService = _instantiationService;
|
|
49
|
-
this._accessibilityService = _accessibilityService;
|
|
50
|
-
this._messageListeners = ( new DisposableStore());
|
|
51
|
-
this._isDisposed = false;
|
|
52
|
-
this._forcePosition = false;
|
|
53
|
-
this._x = 0;
|
|
54
|
-
this._y = 0;
|
|
55
|
-
this._isLocked = false;
|
|
56
|
-
this._enableFocusTraps = false;
|
|
57
|
-
this._addedFocusTrap = false;
|
|
58
|
-
this._onDispose = this._register(( new Emitter()));
|
|
59
|
-
this._onRequestLayout = this._register(( new Emitter()));
|
|
60
|
-
this._linkHandler = options.linkHandler || (url => {
|
|
61
|
-
return openLinkFromMarkdown(this._openerService, url, isMarkdownString(options.content) ? options.content.isTrusted : undefined);
|
|
62
|
-
});
|
|
63
|
-
this._target = 'targetElements' in options.target ? options.target : ( new ElementHoverTarget(options.target));
|
|
64
|
-
this._hoverPointer = options.appearance?.showPointer ? $('div.workbench-hover-pointer') : undefined;
|
|
65
|
-
this._hover = this._register(( new HoverWidget$1()));
|
|
66
|
-
this._hover.containerDomNode.classList.add('workbench-hover', 'fadeIn');
|
|
67
|
-
if (options.appearance?.compact) {
|
|
68
|
-
this._hover.containerDomNode.classList.add('workbench-hover', 'compact');
|
|
69
|
-
}
|
|
70
|
-
if (options.appearance?.skipFadeInAnimation) {
|
|
71
|
-
this._hover.containerDomNode.classList.add('skip-fade-in');
|
|
72
|
-
}
|
|
73
|
-
if (options.additionalClasses) {
|
|
74
|
-
this._hover.containerDomNode.classList.add(...options.additionalClasses);
|
|
75
|
-
}
|
|
76
|
-
if (options.position?.forcePosition) {
|
|
77
|
-
this._forcePosition = true;
|
|
78
|
-
}
|
|
79
|
-
if (options.trapFocus) {
|
|
80
|
-
this._enableFocusTraps = true;
|
|
81
|
-
}
|
|
82
|
-
this._hoverPosition = options.position?.hoverPosition ?? 3 ;
|
|
83
|
-
this.onmousedown(this._hover.containerDomNode, e => e.stopPropagation());
|
|
84
|
-
this.onkeydown(this._hover.containerDomNode, e => {
|
|
85
|
-
if (e.equals(9 )) {
|
|
86
|
-
this.dispose();
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
this._register(addDisposableListener(this._targetWindow, 'blur', () => this.dispose()));
|
|
90
|
-
const rowElement = $('div.hover-row.markdown-hover');
|
|
91
|
-
const contentsElement = $('div.hover-contents');
|
|
92
|
-
if (typeof options.content === 'string') {
|
|
93
|
-
contentsElement.textContent = options.content;
|
|
94
|
-
contentsElement.style.whiteSpace = 'pre-wrap';
|
|
95
|
-
}
|
|
96
|
-
else if (options.content instanceof HTMLElement) {
|
|
97
|
-
contentsElement.appendChild(options.content);
|
|
98
|
-
contentsElement.classList.add('html-hover-contents');
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
const markdown = options.content;
|
|
102
|
-
const mdRenderer = this._instantiationService.createInstance(MarkdownRenderer, { codeBlockFontFamily: this._configurationService.getValue('editor').fontFamily || EDITOR_FONT_DEFAULTS.fontFamily });
|
|
103
|
-
const { element } = mdRenderer.render(markdown, {
|
|
104
|
-
actionHandler: {
|
|
105
|
-
callback: (content) => this._linkHandler(content),
|
|
106
|
-
disposables: this._messageListeners
|
|
107
|
-
},
|
|
108
|
-
asyncRenderCallback: () => {
|
|
109
|
-
contentsElement.classList.add('code-hover-contents');
|
|
110
|
-
this.layout();
|
|
111
|
-
this._onRequestLayout.fire();
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
contentsElement.appendChild(element);
|
|
115
|
-
}
|
|
116
|
-
rowElement.appendChild(contentsElement);
|
|
117
|
-
this._hover.contentsDomNode.appendChild(rowElement);
|
|
118
|
-
if (options.actions && options.actions.length > 0) {
|
|
119
|
-
const statusBarElement = $('div.hover-row.status-bar');
|
|
120
|
-
const actionsElement = $('div.actions');
|
|
121
|
-
options.actions.forEach(action => {
|
|
122
|
-
const keybinding = this._keybindingService.lookupKeybinding(action.commandId);
|
|
123
|
-
keybinding ? keybinding.getLabel() : null;
|
|
124
|
-
});
|
|
125
|
-
statusBarElement.appendChild(actionsElement);
|
|
126
|
-
this._hover.containerDomNode.appendChild(statusBarElement);
|
|
127
|
-
}
|
|
128
|
-
this._hoverContainer = $('div.workbench-hover-container');
|
|
129
|
-
if (this._hoverPointer) {
|
|
130
|
-
this._hoverContainer.appendChild(this._hoverPointer);
|
|
131
|
-
}
|
|
132
|
-
this._hoverContainer.appendChild(this._hover.containerDomNode);
|
|
133
|
-
let hideOnHover;
|
|
134
|
-
if (options.actions && options.actions.length > 0) {
|
|
135
|
-
hideOnHover = false;
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
if (options.persistence?.hideOnHover === undefined) {
|
|
139
|
-
hideOnHover = typeof options.content === 'string' ||
|
|
140
|
-
isMarkdownString(options.content) && !options.content.value.includes('](') && !options.content.value.includes('</a>');
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
hideOnHover = options.persistence.hideOnHover;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (hideOnHover && options.appearance?.showHoverHint) {
|
|
147
|
-
const statusBarElement = $('div.hover-row.status-bar');
|
|
148
|
-
const infoElement = $('div.info');
|
|
149
|
-
infoElement.textContent = ( localizeWithPath(
|
|
150
|
-
'vs/workbench/services/hover/browser/hoverWidget',
|
|
151
|
-
'hoverhint',
|
|
152
|
-
'Hold {0} key to mouse over',
|
|
153
|
-
isMacintosh ? 'Option' : 'Alt'
|
|
154
|
-
));
|
|
155
|
-
statusBarElement.appendChild(infoElement);
|
|
156
|
-
this._hover.containerDomNode.appendChild(statusBarElement);
|
|
157
|
-
}
|
|
158
|
-
const mouseTrackerTargets = [...this._target.targetElements];
|
|
159
|
-
if (!hideOnHover) {
|
|
160
|
-
mouseTrackerTargets.push(this._hoverContainer);
|
|
161
|
-
}
|
|
162
|
-
const mouseTracker = this._register(( new CompositeMouseTracker(mouseTrackerTargets)));
|
|
163
|
-
this._register(mouseTracker.onMouseOut(() => {
|
|
164
|
-
if (!this._isLocked) {
|
|
165
|
-
this.dispose();
|
|
166
|
-
}
|
|
167
|
-
}));
|
|
168
|
-
if (hideOnHover) {
|
|
169
|
-
const mouseTracker2Targets = [...this._target.targetElements, this._hoverContainer];
|
|
170
|
-
this._lockMouseTracker = this._register(( new CompositeMouseTracker(mouseTracker2Targets)));
|
|
171
|
-
this._register(this._lockMouseTracker.onMouseOut(() => {
|
|
172
|
-
if (!this._isLocked) {
|
|
173
|
-
this.dispose();
|
|
174
|
-
}
|
|
175
|
-
}));
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
this._lockMouseTracker = mouseTracker;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
addFocusTrap() {
|
|
182
|
-
if (!this._enableFocusTraps || this._addedFocusTrap) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
this._addedFocusTrap = true;
|
|
186
|
-
const firstContainerFocusElement = this._hover.containerDomNode;
|
|
187
|
-
const lastContainerFocusElement = this.findLastFocusableChild(this._hover.containerDomNode);
|
|
188
|
-
if (lastContainerFocusElement) {
|
|
189
|
-
const beforeContainerFocusElement = prepend(this._hoverContainer, $('div'));
|
|
190
|
-
const afterContainerFocusElement = append(this._hoverContainer, $('div'));
|
|
191
|
-
beforeContainerFocusElement.tabIndex = 0;
|
|
192
|
-
afterContainerFocusElement.tabIndex = 0;
|
|
193
|
-
this._register(addDisposableListener(afterContainerFocusElement, 'focus', (e) => {
|
|
194
|
-
firstContainerFocusElement.focus();
|
|
195
|
-
e.preventDefault();
|
|
196
|
-
}));
|
|
197
|
-
this._register(addDisposableListener(beforeContainerFocusElement, 'focus', (e) => {
|
|
198
|
-
lastContainerFocusElement.focus();
|
|
199
|
-
e.preventDefault();
|
|
200
|
-
}));
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
findLastFocusableChild(root) {
|
|
204
|
-
if (root.hasChildNodes()) {
|
|
205
|
-
for (let i = 0; i < root.childNodes.length; i++) {
|
|
206
|
-
const node = root.childNodes.item(root.childNodes.length - i - 1);
|
|
207
|
-
if (node.nodeType === node.ELEMENT_NODE) {
|
|
208
|
-
const parsedNode = node;
|
|
209
|
-
if (typeof parsedNode.tabIndex === 'number' && parsedNode.tabIndex >= 0) {
|
|
210
|
-
return parsedNode;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
const recursivelyFoundElement = this.findLastFocusableChild(node);
|
|
214
|
-
if (recursivelyFoundElement) {
|
|
215
|
-
return recursivelyFoundElement;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return undefined;
|
|
220
|
-
}
|
|
221
|
-
render(container) {
|
|
222
|
-
container.appendChild(this._hoverContainer);
|
|
223
|
-
const hoverFocused = this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement);
|
|
224
|
-
const accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(this._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel());
|
|
225
|
-
if (accessibleViewHint) {
|
|
226
|
-
status(accessibleViewHint);
|
|
227
|
-
}
|
|
228
|
-
this.layout();
|
|
229
|
-
this.addFocusTrap();
|
|
230
|
-
}
|
|
231
|
-
layout() {
|
|
232
|
-
this._hover.containerDomNode.classList.remove('right-aligned');
|
|
233
|
-
this._hover.contentsDomNode.style.maxHeight = '';
|
|
234
|
-
const getZoomAccountedBoundingClientRect = (e) => {
|
|
235
|
-
const zoom = getDomNodeZoomLevel(e);
|
|
236
|
-
const boundingRect = e.getBoundingClientRect();
|
|
237
|
-
return {
|
|
238
|
-
top: boundingRect.top * zoom,
|
|
239
|
-
bottom: boundingRect.bottom * zoom,
|
|
240
|
-
right: boundingRect.right * zoom,
|
|
241
|
-
left: boundingRect.left * zoom,
|
|
242
|
-
};
|
|
243
|
-
};
|
|
244
|
-
const targetBounds = ( this._target.targetElements.map(e => getZoomAccountedBoundingClientRect(e)));
|
|
245
|
-
const top = Math.min(...( targetBounds.map(e => e.top)));
|
|
246
|
-
const right = Math.max(...( targetBounds.map(e => e.right)));
|
|
247
|
-
const bottom = Math.max(...( targetBounds.map(e => e.bottom)));
|
|
248
|
-
const left = Math.min(...( targetBounds.map(e => e.left)));
|
|
249
|
-
const width = right - left;
|
|
250
|
-
const height = bottom - top;
|
|
251
|
-
const targetRect = {
|
|
252
|
-
top, right, bottom, left, width, height,
|
|
253
|
-
center: {
|
|
254
|
-
x: left + (width / 2),
|
|
255
|
-
y: top + (height / 2)
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
this.adjustHorizontalHoverPosition(targetRect);
|
|
259
|
-
this.adjustVerticalHoverPosition(targetRect);
|
|
260
|
-
this.adjustHoverMaxHeight(targetRect);
|
|
261
|
-
this._hoverContainer.style.padding = '';
|
|
262
|
-
this._hoverContainer.style.margin = '';
|
|
263
|
-
if (this._hoverPointer) {
|
|
264
|
-
switch (this._hoverPosition) {
|
|
265
|
-
case 1 :
|
|
266
|
-
targetRect.left += 3 ;
|
|
267
|
-
targetRect.right += 3 ;
|
|
268
|
-
this._hoverContainer.style.paddingLeft = `${3 }px`;
|
|
269
|
-
this._hoverContainer.style.marginLeft = `${-3 }px`;
|
|
270
|
-
break;
|
|
271
|
-
case 0 :
|
|
272
|
-
targetRect.left -= 3 ;
|
|
273
|
-
targetRect.right -= 3 ;
|
|
274
|
-
this._hoverContainer.style.paddingRight = `${3 }px`;
|
|
275
|
-
this._hoverContainer.style.marginRight = `${-3 }px`;
|
|
276
|
-
break;
|
|
277
|
-
case 2 :
|
|
278
|
-
targetRect.top += 3 ;
|
|
279
|
-
targetRect.bottom += 3 ;
|
|
280
|
-
this._hoverContainer.style.paddingTop = `${3 }px`;
|
|
281
|
-
this._hoverContainer.style.marginTop = `${-3 }px`;
|
|
282
|
-
break;
|
|
283
|
-
case 3 :
|
|
284
|
-
targetRect.top -= 3 ;
|
|
285
|
-
targetRect.bottom -= 3 ;
|
|
286
|
-
this._hoverContainer.style.paddingBottom = `${3 }px`;
|
|
287
|
-
this._hoverContainer.style.marginBottom = `${-3 }px`;
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
targetRect.center.x = targetRect.left + (width / 2);
|
|
291
|
-
targetRect.center.y = targetRect.top + (height / 2);
|
|
292
|
-
}
|
|
293
|
-
this.computeXCordinate(targetRect);
|
|
294
|
-
this.computeYCordinate(targetRect);
|
|
295
|
-
if (this._hoverPointer) {
|
|
296
|
-
this._hoverPointer.classList.remove('top');
|
|
297
|
-
this._hoverPointer.classList.remove('left');
|
|
298
|
-
this._hoverPointer.classList.remove('right');
|
|
299
|
-
this._hoverPointer.classList.remove('bottom');
|
|
300
|
-
this.setHoverPointerPosition(targetRect);
|
|
301
|
-
}
|
|
302
|
-
this._hover.onContentsChanged();
|
|
303
|
-
}
|
|
304
|
-
computeXCordinate(target) {
|
|
305
|
-
const hoverWidth = this._hover.containerDomNode.clientWidth + 2 ;
|
|
306
|
-
if (this._target.x !== undefined) {
|
|
307
|
-
this._x = this._target.x;
|
|
308
|
-
}
|
|
309
|
-
else if (this._hoverPosition === 1 ) {
|
|
310
|
-
this._x = target.right;
|
|
311
|
-
}
|
|
312
|
-
else if (this._hoverPosition === 0 ) {
|
|
313
|
-
this._x = target.left - hoverWidth;
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
if (this._hoverPointer) {
|
|
317
|
-
this._x = target.center.x - (this._hover.containerDomNode.clientWidth / 2);
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
this._x = target.left;
|
|
321
|
-
}
|
|
322
|
-
if (this._x + hoverWidth >= this._targetDocumentElement.clientWidth) {
|
|
323
|
-
this._hover.containerDomNode.classList.add('right-aligned');
|
|
324
|
-
this._x = Math.max(this._targetDocumentElement.clientWidth - hoverWidth - 2 , this._targetDocumentElement.clientLeft);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
if (this._x < this._targetDocumentElement.clientLeft) {
|
|
328
|
-
this._x = target.left + 2 ;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
computeYCordinate(target) {
|
|
332
|
-
if (this._target.y !== undefined) {
|
|
333
|
-
this._y = this._target.y;
|
|
334
|
-
}
|
|
335
|
-
else if (this._hoverPosition === 3 ) {
|
|
336
|
-
this._y = target.top;
|
|
337
|
-
}
|
|
338
|
-
else if (this._hoverPosition === 2 ) {
|
|
339
|
-
this._y = target.bottom - 2;
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
if (this._hoverPointer) {
|
|
343
|
-
this._y = target.center.y + (this._hover.containerDomNode.clientHeight / 2);
|
|
344
|
-
}
|
|
345
|
-
else {
|
|
346
|
-
this._y = target.bottom;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
if (this._y > this._targetWindow.innerHeight) {
|
|
350
|
-
this._y = target.bottom;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
adjustHorizontalHoverPosition(target) {
|
|
354
|
-
if (this._target.x !== undefined) {
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
if (this._forcePosition) {
|
|
358
|
-
const padding = (this._hoverPointer ? 3 : 0) + 2 ;
|
|
359
|
-
if (this._hoverPosition === 1 ) {
|
|
360
|
-
this._hover.containerDomNode.style.maxWidth = `${this._targetDocumentElement.clientWidth - target.right - padding}px`;
|
|
361
|
-
}
|
|
362
|
-
else if (this._hoverPosition === 0 ) {
|
|
363
|
-
this._hover.containerDomNode.style.maxWidth = `${target.left - padding}px`;
|
|
364
|
-
}
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
if (this._hoverPosition === 1 ) {
|
|
368
|
-
const roomOnRight = this._targetDocumentElement.clientWidth - target.right;
|
|
369
|
-
if (roomOnRight < this._hover.containerDomNode.clientWidth) {
|
|
370
|
-
const roomOnLeft = target.left;
|
|
371
|
-
if (roomOnLeft >= this._hover.containerDomNode.clientWidth) {
|
|
372
|
-
this._hoverPosition = 0 ;
|
|
373
|
-
}
|
|
374
|
-
else {
|
|
375
|
-
this._hoverPosition = 2 ;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
else if (this._hoverPosition === 0 ) {
|
|
380
|
-
const roomOnLeft = target.left;
|
|
381
|
-
if (roomOnLeft < this._hover.containerDomNode.clientWidth) {
|
|
382
|
-
const roomOnRight = this._targetDocumentElement.clientWidth - target.right;
|
|
383
|
-
if (roomOnRight >= this._hover.containerDomNode.clientWidth) {
|
|
384
|
-
this._hoverPosition = 1 ;
|
|
385
|
-
}
|
|
386
|
-
else {
|
|
387
|
-
this._hoverPosition = 2 ;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
if (target.left - this._hover.containerDomNode.clientWidth <= this._targetDocumentElement.clientLeft) {
|
|
391
|
-
this._hoverPosition = 1 ;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
adjustVerticalHoverPosition(target) {
|
|
396
|
-
if (this._target.y !== undefined || this._forcePosition) {
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
if (this._hoverPosition === 3 ) {
|
|
400
|
-
if (target.top - this._hover.containerDomNode.clientHeight < 0) {
|
|
401
|
-
this._hoverPosition = 2 ;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
else if (this._hoverPosition === 2 ) {
|
|
405
|
-
if (target.bottom + this._hover.containerDomNode.clientHeight > this._targetWindow.innerHeight) {
|
|
406
|
-
this._hoverPosition = 3 ;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
adjustHoverMaxHeight(target) {
|
|
411
|
-
let maxHeight = this._targetWindow.innerHeight / 2;
|
|
412
|
-
if (this._forcePosition) {
|
|
413
|
-
const padding = (this._hoverPointer ? 3 : 0) + 2 ;
|
|
414
|
-
if (this._hoverPosition === 3 ) {
|
|
415
|
-
maxHeight = Math.min(maxHeight, target.top - padding);
|
|
416
|
-
}
|
|
417
|
-
else if (this._hoverPosition === 2 ) {
|
|
418
|
-
maxHeight = Math.min(maxHeight, this._targetWindow.innerHeight - target.bottom - padding);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
this._hover.containerDomNode.style.maxHeight = `${maxHeight}px`;
|
|
422
|
-
if (this._hover.contentsDomNode.clientHeight < this._hover.contentsDomNode.scrollHeight) {
|
|
423
|
-
const extraRightPadding = `${this._hover.scrollbar.options.verticalScrollbarSize}px`;
|
|
424
|
-
if (this._hover.contentsDomNode.style.paddingRight !== extraRightPadding) {
|
|
425
|
-
this._hover.contentsDomNode.style.paddingRight = extraRightPadding;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
setHoverPointerPosition(target) {
|
|
430
|
-
if (!this._hoverPointer) {
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
switch (this._hoverPosition) {
|
|
434
|
-
case 0 :
|
|
435
|
-
case 1 : {
|
|
436
|
-
this._hoverPointer.classList.add(this._hoverPosition === 0 ? 'right' : 'left');
|
|
437
|
-
const hoverHeight = this._hover.containerDomNode.clientHeight;
|
|
438
|
-
if (hoverHeight > target.height) {
|
|
439
|
-
this._hoverPointer.style.top = `${target.center.y - (this._y - hoverHeight) - 3 }px`;
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
this._hoverPointer.style.top = `${Math.round((hoverHeight / 2)) - 3 }px`;
|
|
443
|
-
}
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
case 3 :
|
|
447
|
-
case 2 : {
|
|
448
|
-
this._hoverPointer.classList.add(this._hoverPosition === 3 ? 'bottom' : 'top');
|
|
449
|
-
const hoverWidth = this._hover.containerDomNode.clientWidth;
|
|
450
|
-
let pointerLeftPosition = Math.round((hoverWidth / 2)) - 3 ;
|
|
451
|
-
const pointerX = this._x + pointerLeftPosition;
|
|
452
|
-
if (pointerX < target.left || pointerX > target.right) {
|
|
453
|
-
pointerLeftPosition = target.center.x - this._x - 3 ;
|
|
454
|
-
}
|
|
455
|
-
this._hoverPointer.style.left = `${pointerLeftPosition}px`;
|
|
456
|
-
break;
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
focus() {
|
|
461
|
-
this._hover.containerDomNode.focus();
|
|
462
|
-
}
|
|
463
|
-
hide() {
|
|
464
|
-
this.dispose();
|
|
465
|
-
}
|
|
466
|
-
dispose() {
|
|
467
|
-
if (!this._isDisposed) {
|
|
468
|
-
this._onDispose.fire();
|
|
469
|
-
this._hoverContainer.remove();
|
|
470
|
-
this._messageListeners.dispose();
|
|
471
|
-
this._target.dispose();
|
|
472
|
-
super.dispose();
|
|
473
|
-
}
|
|
474
|
-
this._isDisposed = true;
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
HoverWidget = ( __decorate([
|
|
478
|
-
( __param(1, IKeybindingService)),
|
|
479
|
-
( __param(2, IConfigurationService)),
|
|
480
|
-
( __param(3, IOpenerService)),
|
|
481
|
-
( __param(4, IInstantiationService)),
|
|
482
|
-
( __param(5, IAccessibilityService))
|
|
483
|
-
], HoverWidget));
|
|
484
|
-
class CompositeMouseTracker extends Widget {
|
|
485
|
-
get onMouseOut() { return this._onMouseOut.event; }
|
|
486
|
-
get isMouseIn() { return this._isMouseIn; }
|
|
487
|
-
constructor(_elements) {
|
|
488
|
-
super();
|
|
489
|
-
this._elements = _elements;
|
|
490
|
-
this._isMouseIn = true;
|
|
491
|
-
this._onMouseOut = this._register(( new Emitter()));
|
|
492
|
-
this._elements.forEach(n => this.onmouseover(n, () => this._onTargetMouseOver(n)));
|
|
493
|
-
this._elements.forEach(n => this.onmouseleave(n, () => this._onTargetMouseLeave(n)));
|
|
494
|
-
}
|
|
495
|
-
_onTargetMouseOver(target) {
|
|
496
|
-
this._isMouseIn = true;
|
|
497
|
-
this._clearEvaluateMouseStateTimeout(target);
|
|
498
|
-
}
|
|
499
|
-
_onTargetMouseLeave(target) {
|
|
500
|
-
this._isMouseIn = false;
|
|
501
|
-
this._evaluateMouseState(target);
|
|
502
|
-
}
|
|
503
|
-
_evaluateMouseState(target) {
|
|
504
|
-
this._clearEvaluateMouseStateTimeout(target);
|
|
505
|
-
this._mouseTimeout = getWindow(target).setTimeout(() => this._fireIfMouseOutside(), 0);
|
|
506
|
-
}
|
|
507
|
-
_clearEvaluateMouseStateTimeout(target) {
|
|
508
|
-
if (this._mouseTimeout) {
|
|
509
|
-
getWindow(target).clearTimeout(this._mouseTimeout);
|
|
510
|
-
this._mouseTimeout = undefined;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
_fireIfMouseOutside() {
|
|
514
|
-
if (!this._isMouseIn) {
|
|
515
|
-
this._onMouseOut.fire();
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
class ElementHoverTarget {
|
|
520
|
-
constructor(_element) {
|
|
521
|
-
this._element = _element;
|
|
522
|
-
this.targetElements = [this._element];
|
|
523
|
-
}
|
|
524
|
-
dispose() {
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
export { HoverWidget };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
-
|
|
3
|
-
var css = ".monaco-workbench .workbench-hover{background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;box-shadow:0 2px 8px var(--vscode-widget-shadow);color:var(--vscode-editorHoverWidget-foreground);font-size:13px;line-height:19px;max-width:700px;overflow:hidden;position:relative;z-index:40}.monaco-workbench .workbench-hover hr{border-bottom:none}.monaco-workbench .workbench-hover:not(.skip-fade-in){animation:fadein .1s linear}.monaco-workbench .workbench-hover.compact{font-size:12px}.monaco-workbench .workbench-hover.compact .hover-contents{padding:2px 8px}.monaco-workbench .workbench-hover-container.locked .workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .workbench-hover-container.locked .workbench-hover:focus,.monaco-workbench .workbench-hover-lock:focus{outline:1px solid var(--vscode-focusBorder)}.monaco-workbench .workbench-hover-container.locked .workbench-hover-lock:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-workbench .workbench-hover-pointer{pointer-events:none;position:absolute;z-index:41}.monaco-workbench .workbench-hover-pointer:after{background-color:var(--vscode-editorHoverWidget-background);border-bottom:1px solid var(--vscode-editorHoverWidget-border);border-right:1px solid var(--vscode-editorHoverWidget-border);content:\"\";height:5px;position:absolute;width:5px}.monaco-workbench .locked .workbench-hover-pointer:after{border-bottom-width:2px;border-right-width:2px;height:4px;width:4px}.monaco-workbench .workbench-hover-pointer.left{left:-3px}.monaco-workbench .workbench-hover-pointer.right{right:3px}.monaco-workbench .workbench-hover-pointer.top{top:-3px}.monaco-workbench .workbench-hover-pointer.bottom{bottom:3px}.monaco-workbench .workbench-hover-pointer.left:after{transform:rotate(135deg)}.monaco-workbench .workbench-hover-pointer.right:after{transform:rotate(315deg)}.monaco-workbench .workbench-hover-pointer.top:after{transform:rotate(225deg)}.monaco-workbench .workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-workbench .workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-workbench .workbench-hover a:focus{outline:1px solid;outline-color:var(--vscode-focusBorder);outline-offset:-1px;text-decoration:underline}.monaco-workbench .workbench-hover a:active,.monaco-workbench .workbench-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-workbench .workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-workbench .workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-workbench .workbench-hover.right-aligned{left:1px}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-left:16px;margin-right:0}";
|
|
4
|
-
n(css,{});
|
|
5
|
-
|
|
6
|
-
export { css, css as default };
|