@codingame/monaco-vscode-api 18.1.1 → 18.1.3
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/package.json +8 -8
- package/services.js +3 -3
- package/vscode/src/vs/base/browser/dom.d.ts +2 -1
- package/vscode/src/vs/base/browser/dom.js +14 -8
- package/vscode/src/vs/base/browser/ui/dnd/dnd.js +2 -2
- package/vscode/src/vs/base/browser/ui/findinput/findInput.js +2 -2
- package/vscode/src/vs/base/browser/ui/findinput/replaceInput.js +2 -2
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +1 -1
- package/vscode/src/vs/base/browser/ui/sash/sash.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.js +2 -2
- package/vscode/src/vs/editor/browser/controller/mouseTarget.js +2 -2
- package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.js +2 -2
- package/vscode/src/vs/editor/browser/view/viewPart.js +2 -1
- package/vscode/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidget.js +2 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionList.js +1 -1
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/workbench/browser/contextkeys.js +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-base-service-override": "18.1.
|
|
19
|
-
"@codingame/monaco-vscode-environment-service-override": "18.1.
|
|
20
|
-
"@codingame/monaco-vscode-extensions-service-override": "18.1.
|
|
21
|
-
"@codingame/monaco-vscode-files-service-override": "18.1.
|
|
22
|
-
"@codingame/monaco-vscode-host-service-override": "18.1.
|
|
23
|
-
"@codingame/monaco-vscode-layout-service-override": "18.1.
|
|
24
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "18.1.
|
|
18
|
+
"@codingame/monaco-vscode-base-service-override": "18.1.3",
|
|
19
|
+
"@codingame/monaco-vscode-environment-service-override": "18.1.3",
|
|
20
|
+
"@codingame/monaco-vscode-extensions-service-override": "18.1.3",
|
|
21
|
+
"@codingame/monaco-vscode-files-service-override": "18.1.3",
|
|
22
|
+
"@codingame/monaco-vscode-host-service-override": "18.1.3",
|
|
23
|
+
"@codingame/monaco-vscode-layout-service-override": "18.1.3",
|
|
24
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "18.1.3",
|
|
25
25
|
"@vscode/iconv-lite-umd": "0.7.0",
|
|
26
26
|
"dompurify": "3.2.6",
|
|
27
27
|
"jschardet": "3.1.4",
|
package/services.js
CHANGED
|
@@ -182,10 +182,10 @@ export { IKeybindingService } from './vscode/src/vs/platform/keybinding/common/k
|
|
|
182
182
|
export { ISecretStorageService } from './vscode/src/vs/platform/secrets/common/secrets.service.js';
|
|
183
183
|
export { ConfigurationTarget } from './vscode/src/vs/platform/configuration/common/configuration.js';
|
|
184
184
|
|
|
185
|
-
if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.101.1-
|
|
186
|
-
throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.101.1-
|
|
185
|
+
if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.101.1-563de4bc-0aa2-4099-89b9-1549d6dc9e6c") {
|
|
186
|
+
throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.101.1-563de4bc-0aa2-4099-89b9-1549d6dc9e6c"}, ${window.monacoVscodeApiBuildId} is already loaded`);
|
|
187
187
|
}
|
|
188
|
-
window.monacoVscodeApiBuildId = "1.101.1-
|
|
188
|
+
window.monacoVscodeApiBuildId = "1.101.1-563de4bc-0aa2-4099-89b9-1549d6dc9e6c";
|
|
189
189
|
async function initialize(overrides, container = document.body, configuration = {}, env) {
|
|
190
190
|
checkServicesNotInitialized();
|
|
191
191
|
injectCss(container);
|
|
@@ -101,7 +101,8 @@ export declare function hasParentWithClass(node: HTMLElement, clazz: string, sto
|
|
|
101
101
|
export declare function isShadowRoot(node: Node): node is ShadowRoot;
|
|
102
102
|
export declare function isInShadowDOM(domNode: Node): boolean;
|
|
103
103
|
export declare function getShadowRoot(domNode: Node): ShadowRoot | null;
|
|
104
|
-
export declare function getActiveElement(): Element | null;
|
|
104
|
+
export declare function getActiveElement(_document?: Document): Element | null;
|
|
105
|
+
export declare function getRootContainer(element: Element): Node;
|
|
105
106
|
export declare function isActiveElement(element: Element): boolean;
|
|
106
107
|
export declare function isAncestorOfActiveElement(ancestor: Element): boolean;
|
|
107
108
|
export declare function isActiveDocument(element: Element): boolean;
|
|
@@ -407,8 +407,7 @@ function getTopLeftOffset(element) {
|
|
|
407
407
|
let top = element.offsetTop;
|
|
408
408
|
let left = element.offsetLeft;
|
|
409
409
|
while ((element = element.parentNode) !== null
|
|
410
|
-
&& element !== element.
|
|
411
|
-
&& element !== element.ownerDocument.documentElement) {
|
|
410
|
+
&& element !== element.getRootNode()) {
|
|
412
411
|
top -= element.scrollTop;
|
|
413
412
|
const c = isShadowRoot(element) ? null : getComputedStyle(element);
|
|
414
413
|
if (c) {
|
|
@@ -474,7 +473,7 @@ function getDomNodeZoomLevel(domNode) {
|
|
|
474
473
|
zoom *= elementZoomLevel;
|
|
475
474
|
}
|
|
476
475
|
testElement = testElement.parentElement;
|
|
477
|
-
} while (testElement !== null && testElement !== testElement.
|
|
476
|
+
} while (testElement !== null && testElement !== testElement.getRootNode());
|
|
478
477
|
return zoom;
|
|
479
478
|
}
|
|
480
479
|
function getTotalWidth(element) {
|
|
@@ -524,7 +523,7 @@ function setParentFlowTo(fromChildElement, toParentElement) {
|
|
|
524
523
|
function getParentFlowToElement(node) {
|
|
525
524
|
const flowToParentId = node.dataset[parentFlowToDataKey];
|
|
526
525
|
if (typeof flowToParentId === 'string') {
|
|
527
|
-
return node.
|
|
526
|
+
return node.getRootNode().getElementById(flowToParentId);
|
|
528
527
|
}
|
|
529
528
|
return null;
|
|
530
529
|
}
|
|
@@ -584,13 +583,20 @@ function getShadowRoot(domNode) {
|
|
|
584
583
|
}
|
|
585
584
|
return isShadowRoot(domNode) ? domNode : null;
|
|
586
585
|
}
|
|
587
|
-
function getActiveElement() {
|
|
588
|
-
let result =
|
|
586
|
+
function getActiveElement(_document = getActiveDocument()) {
|
|
587
|
+
let result = _document.activeElement;
|
|
589
588
|
while (result?.shadowRoot) {
|
|
590
589
|
result = result.shadowRoot.activeElement;
|
|
591
590
|
}
|
|
592
591
|
return result;
|
|
593
592
|
}
|
|
593
|
+
function getRootContainer(element) {
|
|
594
|
+
let container = element.getRootNode();
|
|
595
|
+
if (container instanceof Document) {
|
|
596
|
+
container = container.body;
|
|
597
|
+
}
|
|
598
|
+
return container;
|
|
599
|
+
}
|
|
594
600
|
function isActiveElement(element) {
|
|
595
601
|
return getActiveElement() === element;
|
|
596
602
|
}
|
|
@@ -770,7 +776,7 @@ class FocusTracker extends Disposable {
|
|
|
770
776
|
static hasFocusWithin(element) {
|
|
771
777
|
if (isHTMLElement(element)) {
|
|
772
778
|
const shadowRoot = getShadowRoot(element);
|
|
773
|
-
const activeElement = (shadowRoot ? shadowRoot.activeElement : element.
|
|
779
|
+
const activeElement = (shadowRoot ? shadowRoot.activeElement : element.getRootNode().activeElement);
|
|
774
780
|
return isAncestor(activeElement, element);
|
|
775
781
|
}
|
|
776
782
|
else {
|
|
@@ -1526,4 +1532,4 @@ class SafeTriangle {
|
|
|
1526
1532
|
}
|
|
1527
1533
|
}
|
|
1528
1534
|
|
|
1529
|
-
export { $, DetectedFullscreenMode, Dimension, DragAndDropObserver, EventHelper, EventType, ModifierKeyEmitter, Namespace, SafeTriangle, WindowIdleValue, WindowIntervalTimer, addDisposableGenericMouseDownListener, addDisposableGenericMouseMoveListener, addDisposableGenericMouseUpListener, addDisposableListener, addDisposableThrottledListener, addStandardDisposableGenericMouseDownListener, addStandardDisposableGenericMouseUpListener, addStandardDisposableListener, after, animate, append, basicMarkupHtmlTags, clearNode, computeScreenAwareSize, copyAttributes, createLinkElement, createMetaElement, detectFullscreen, disposableWindowInterval, finalHandler, findParentWithClass, getActiveDocument, getActiveElement, getActiveWindow, getClientArea, getComputedStyle, getContentHeight, getContentWidth, getDocument, getDomNodePagePosition, getDomNodeZoomLevel, getLargestChildWidth, getShadowRoot, getTopLeftOffset, getTotalHeight, getTotalScrollWidth, getTotalWidth, getWindow, getWindowById, getWindowId, getWindows, getWindowsCount, h, hasParentWithClass, hide, hookDomPurifyHrefAndSrcSanitizer, isActiveDocument, isActiveElement, isAncestor, isAncestorOfActiveElement, isAncestorUsingFlowTo, isDragEvent, isEditableElement, isElementInBottomRightQuarter, isEventLike, isHTMLAnchorElement, isHTMLButtonElement, isHTMLDivElement, isHTMLElement, isHTMLInputElement, isHTMLTextAreaElement, isInShadowDOM, isKeyboardEvent, isMouseEvent, isPointerEvent, isSVGElement, isShadowRoot, measure, modify, multibyteAwareBtoa, onDidRegisterWindow, onDidUnregisterWindow, onWillUnregisterWindow, position, prepend, registerWindow, reset, restoreParentsScrollTop, runAtThisOrScheduleAtNextAnimationFrame, runWhenWindowIdle, safeInnerHtml, saveParentsScrollTop, scheduleAtNextAnimationFrame, setParentFlowTo, setVisibility, sharedMutationObserver, show, size, svgElem, trackAttributes, trackFocus, triggerDownload, triggerUpload, windowOpenNoOpener, windowOpenPopup, windowOpenWithSuccess };
|
|
1535
|
+
export { $, DetectedFullscreenMode, Dimension, DragAndDropObserver, EventHelper, EventType, ModifierKeyEmitter, Namespace, SafeTriangle, WindowIdleValue, WindowIntervalTimer, addDisposableGenericMouseDownListener, addDisposableGenericMouseMoveListener, addDisposableGenericMouseUpListener, addDisposableListener, addDisposableThrottledListener, addStandardDisposableGenericMouseDownListener, addStandardDisposableGenericMouseUpListener, addStandardDisposableListener, after, animate, append, basicMarkupHtmlTags, clearNode, computeScreenAwareSize, copyAttributes, createLinkElement, createMetaElement, detectFullscreen, disposableWindowInterval, finalHandler, findParentWithClass, getActiveDocument, getActiveElement, getActiveWindow, getClientArea, getComputedStyle, getContentHeight, getContentWidth, getDocument, getDomNodePagePosition, getDomNodeZoomLevel, getLargestChildWidth, getRootContainer, getShadowRoot, getTopLeftOffset, getTotalHeight, getTotalScrollWidth, getTotalWidth, getWindow, getWindowById, getWindowId, getWindows, getWindowsCount, h, hasParentWithClass, hide, hookDomPurifyHrefAndSrcSanitizer, isActiveDocument, isActiveElement, isAncestor, isAncestorOfActiveElement, isAncestorUsingFlowTo, isDragEvent, isEditableElement, isElementInBottomRightQuarter, isEventLike, isHTMLAnchorElement, isHTMLButtonElement, isHTMLDivElement, isHTMLElement, isHTMLInputElement, isHTMLTextAreaElement, isInShadowDOM, isKeyboardEvent, isMouseEvent, isPointerEvent, isSVGElement, isShadowRoot, measure, modify, multibyteAwareBtoa, onDidRegisterWindow, onDidUnregisterWindow, onWillUnregisterWindow, position, prepend, registerWindow, reset, restoreParentsScrollTop, runAtThisOrScheduleAtNextAnimationFrame, runWhenWindowIdle, safeInnerHtml, saveParentsScrollTop, scheduleAtNextAnimationFrame, setParentFlowTo, setVisibility, sharedMutationObserver, show, size, svgElem, trackAttributes, trackFocus, triggerDownload, triggerUpload, windowOpenNoOpener, windowOpenPopup, windowOpenWithSuccess };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
-
import {
|
|
3
|
+
import { $, getRootContainer } from '../../dom.js';
|
|
4
4
|
import * as dnd from './dnd.css';
|
|
5
5
|
|
|
6
6
|
registerCss(dnd);
|
|
@@ -15,7 +15,7 @@ function applyDragImage(event, container, label, extraClasses = []) {
|
|
|
15
15
|
while (e && !e.classList.contains('monaco-workbench')) {
|
|
16
16
|
e = e.parentElement;
|
|
17
17
|
}
|
|
18
|
-
return e || container
|
|
18
|
+
return e || getRootContainer(container);
|
|
19
19
|
};
|
|
20
20
|
const dragContainer = getDragImageContainer(container);
|
|
21
21
|
dragContainer.appendChild(dragImage);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
-
import { EventHelper, addDisposableListener } from '../../dom.js';
|
|
3
|
+
import { getActiveElement, EventHelper, addDisposableListener } from '../../dom.js';
|
|
4
4
|
import { RegexToggle, WholeWordsToggle, CaseSensitiveToggle } from './findInputToggles.js';
|
|
5
5
|
import { HistoryInputBox } from '../inputbox/inputBox.js';
|
|
6
6
|
import { Widget } from '../widget.js';
|
|
@@ -111,7 +111,7 @@ class FindInput extends Widget {
|
|
|
111
111
|
const indexes = [this.caseSensitive.domNode, this.wholeWords.domNode, this.regex.domNode];
|
|
112
112
|
this.onkeydown(this.domNode, (event) => {
|
|
113
113
|
if (event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Escape)) {
|
|
114
|
-
const index = indexes.indexOf(this.domNode.ownerDocument
|
|
114
|
+
const index = indexes.indexOf(getActiveElement(this.domNode.ownerDocument));
|
|
115
115
|
if (index >= 0) {
|
|
116
116
|
let newIndex = -1;
|
|
117
117
|
if (event.equals(KeyCode.RightArrow)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
-
import { EventHelper } from '../../dom.js';
|
|
3
|
+
import { getActiveElement, EventHelper } from '../../dom.js';
|
|
4
4
|
import { Toggle } from '../toggle/toggle.js';
|
|
5
5
|
import { HistoryInputBox } from '../inputbox/inputBox.js';
|
|
6
6
|
import { Widget } from '../widget.js';
|
|
@@ -95,7 +95,7 @@ class ReplaceInput extends Widget {
|
|
|
95
95
|
const indexes = [this.preserveCase.domNode];
|
|
96
96
|
this.onkeydown(this.domNode, (event) => {
|
|
97
97
|
if (event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Escape)) {
|
|
98
|
-
const index = indexes.indexOf(this.domNode.ownerDocument
|
|
98
|
+
const index = indexes.indexOf(getActiveElement(this.domNode.ownerDocument));
|
|
99
99
|
if (index >= 0) {
|
|
100
100
|
let newIndex = -1;
|
|
101
101
|
if (event.equals(KeyCode.RightArrow)) {
|
|
@@ -83,7 +83,7 @@ class InputBox extends Widget {
|
|
|
83
83
|
this._register(this.scrollableElement.onScroll(e => this.input.scrollTop = e.scrollTop));
|
|
84
84
|
const onSelectionChange = this._register(( new DomEmitter(container.ownerDocument, 'selectionchange')));
|
|
85
85
|
const onAnchoredSelectionChange = Event.filter(onSelectionChange.event, () => {
|
|
86
|
-
const selection = container.
|
|
86
|
+
const selection = container.getRootNode().getSelection();
|
|
87
87
|
return selection?.anchorNode === wrapper;
|
|
88
88
|
});
|
|
89
89
|
this._register(onAnchoredSelectionChange(this.updateScrollDimensions, this));
|
|
@@ -262,7 +262,7 @@ class Sash extends Disposable {
|
|
|
262
262
|
if (!this.state) {
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
|
-
const iframes = this.el.
|
|
265
|
+
const iframes = this.el.getRootNode().querySelectorAll('iframe');
|
|
266
266
|
for (const iframe of iframes) {
|
|
267
267
|
iframe.classList.add(PointerEventsDisabledCssClass);
|
|
268
268
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
-
import { append, $, scheduleAtNextAnimationFrame, getWindow, addDisposableListener } from '../../dom.js';
|
|
3
|
+
import { append, $, scheduleAtNextAnimationFrame, getWindow, addDisposableListener, getRootContainer } from '../../dom.js';
|
|
4
4
|
import { DomEmitter } from '../../event.js';
|
|
5
5
|
import { Orientation, Sash, SashState } from '../sash/sash.js';
|
|
6
6
|
import { SmoothScrollableElement } from '../scrollbar/scrollableElement.js';
|
|
@@ -394,7 +394,7 @@ class SplitView extends Disposable {
|
|
|
394
394
|
item.enabled = false;
|
|
395
395
|
}
|
|
396
396
|
const index = this.sashItems.findIndex(item => item.sash === sash);
|
|
397
|
-
const disposable = combinedDisposable(addDisposableListener(this.el
|
|
397
|
+
const disposable = combinedDisposable(addDisposableListener(getRootContainer(this.el), 'keydown', e => resetSashDragState(this.sashDragState.current, e.altKey)), addDisposableListener(getRootContainer(this.el), 'keyup', () => resetSashDragState(this.sashDragState.current, false)));
|
|
398
398
|
const resetSashDragState = (start, alt) => {
|
|
399
399
|
const sizes = ( this.viewItems.map(i => i.size));
|
|
400
400
|
let minDelta = Number.NEGATIVE_INFINITY;
|
|
@@ -7,7 +7,7 @@ import { EditorOption } from '../../common/config/editorOptions.js';
|
|
|
7
7
|
import { Position } from '../../common/core/position.js';
|
|
8
8
|
import { Range } from '../../common/core/range.js';
|
|
9
9
|
import { CursorColumns } from '../../common/core/cursorColumns.js';
|
|
10
|
-
import { getWindow, getShadowRoot } from '../../../base/browser/dom.js';
|
|
10
|
+
import { getRootContainer, getWindow, getShadowRoot } from '../../../base/browser/dom.js';
|
|
11
11
|
import { AtomicTabMoveOperations, Direction } from '../../common/cursor/cursorAtomicMoveOperations.js';
|
|
12
12
|
import { PositionAffinity } from '../../common/model.js';
|
|
13
13
|
import { Lazy } from '../../../base/common/lazy.js';
|
|
@@ -269,7 +269,7 @@ class HitTestContext {
|
|
|
269
269
|
return HitTestContext._findAttribute(element, attr, this._viewHelper.viewDomNode);
|
|
270
270
|
}
|
|
271
271
|
static _findAttribute(element, attr, stopAt) {
|
|
272
|
-
while (element && element !== element
|
|
272
|
+
while (element && element !== getRootContainer(element)) {
|
|
273
273
|
if (element.hasAttribute && element.hasAttribute(attr)) {
|
|
274
274
|
return element.getAttribute(attr);
|
|
275
275
|
}
|
|
@@ -4,7 +4,7 @@ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.e
|
|
|
4
4
|
import * as hover from './hover.css';
|
|
5
5
|
import { DisposableStore, toDisposable, MutableDisposable } from '../../../../base/common/lifecycle.js';
|
|
6
6
|
import { Emitter } from '../../../../base/common/event.js';
|
|
7
|
-
import { $ as $$1, getWindow, addDisposableListener, isHTMLElement, prepend, append, getDomNodeZoomLevel } from '../../../../base/browser/dom.js';
|
|
7
|
+
import { $ as $$1, getWindow, addDisposableListener, isHTMLElement, prepend, append, getActiveElement, getDomNodeZoomLevel } from '../../../../base/browser/dom.js';
|
|
8
8
|
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.service.js';
|
|
9
9
|
import { KeyCode } from '../../../../base/common/keyCodes.js';
|
|
10
10
|
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
@@ -245,7 +245,7 @@ let HoverWidget = class HoverWidget extends Widget {
|
|
|
245
245
|
}
|
|
246
246
|
render(container) {
|
|
247
247
|
container.appendChild(this._hoverContainer);
|
|
248
|
-
const hoverFocused = this._hoverContainer.contains(this._hoverContainer.ownerDocument
|
|
248
|
+
const hoverFocused = this._hoverContainer.contains(getActiveElement(this._hoverContainer.ownerDocument));
|
|
249
249
|
const accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(this._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel());
|
|
250
250
|
if (accessibleViewHint) {
|
|
251
251
|
status(accessibleViewHint);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { ViewEventHandler } from '../../common/viewEventHandler.js';
|
|
3
|
+
import { getRootContainer } from '../../../base/browser/dom.js';
|
|
3
4
|
|
|
4
5
|
class ViewPart extends ViewEventHandler {
|
|
5
6
|
constructor(context) {
|
|
@@ -40,7 +41,7 @@ class PartFingerprints {
|
|
|
40
41
|
static collect(child, stopAt) {
|
|
41
42
|
const result = [];
|
|
42
43
|
let resultLen = 0;
|
|
43
|
-
while (child && child !== child
|
|
44
|
+
while (child && child !== getRootContainer(child)) {
|
|
44
45
|
if (child === stopAt) {
|
|
45
46
|
break;
|
|
46
47
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { getDomNodePagePosition, getClientArea } from '../../../../base/browser/dom.js';
|
|
2
|
+
import { getDomNodePagePosition, getClientArea, getActiveElement } from '../../../../base/browser/dom.js';
|
|
3
3
|
import { createFastDomNode } from '../../../../base/browser/fastDomNode.js';
|
|
4
4
|
import { ContentWidgetPositionPreference } from '../../editorBrowser.js';
|
|
5
5
|
import { ViewPart, PartFingerprints, PartFingerprint } from '../../view/viewPart.js';
|
|
@@ -300,7 +300,7 @@ class Widget {
|
|
|
300
300
|
if (!primary) {
|
|
301
301
|
return {
|
|
302
302
|
kind: 'offViewport',
|
|
303
|
-
preserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument
|
|
303
|
+
preserveFocus: this.domNode.domNode.contains(getActiveElement(this.domNode.domNode.ownerDocument))
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
if (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
3
|
-
import { Dimension, append, trackFocus, getClientArea, getDomNodePagePosition, getTotalHeight, getTotalWidth } from '../../../../base/browser/dom.js';
|
|
3
|
+
import { Dimension, append, trackFocus, getClientArea, getDomNodePagePosition, getTotalHeight, getActiveElement, getTotalWidth } from '../../../../base/browser/dom.js';
|
|
4
4
|
import { ContentWidgetPositionPreference } from '../../../browser/editorBrowser.js';
|
|
5
5
|
import { EditorOption } from '../../../common/config/editorOptions.js';
|
|
6
6
|
import { HoverStartSource } from './hoverOperation.js';
|
|
@@ -264,7 +264,7 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
264
264
|
this._hover.containerDomNode.focus();
|
|
265
265
|
}
|
|
266
266
|
this._onDidResize.fire();
|
|
267
|
-
const hoverFocused = this._hover.containerDomNode.ownerDocument
|
|
267
|
+
const hoverFocused = getActiveElement(this._hover.containerDomNode.ownerDocument) === this._hover.containerDomNode;
|
|
268
268
|
const accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(this._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel() ?? '');
|
|
269
269
|
if (accessibleViewHint) {
|
|
270
270
|
this._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ', ' + accessibleViewHint;
|
|
@@ -208,7 +208,7 @@ let ActionList = class ActionList extends Disposable {
|
|
|
208
208
|
}
|
|
209
209
|
else {
|
|
210
210
|
const itemWidths = ( this._allMenuItems.map((_, index) => {
|
|
211
|
-
const element = this.domNode.
|
|
211
|
+
const element = this.domNode.getRootNode().getElementById(this._list.getElementID(index));
|
|
212
212
|
if (element) {
|
|
213
213
|
element.style.width = 'auto';
|
|
214
214
|
const width = element.getBoundingClientRect().width;
|
|
@@ -5,8 +5,8 @@ import { Disposable } from '../../base/common/lifecycle.js';
|
|
|
5
5
|
import { setConstant } from '../../platform/contextkey/common/contextkey.js';
|
|
6
6
|
import { IContextKeyService } from '../../platform/contextkey/common/contextkey.service.js';
|
|
7
7
|
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsIOSContext, IsMobileContext, IsDevelopmentContext, ProductQualityContext, InputFocusedContext } from '../../platform/contextkey/common/contextkeys.js';
|
|
8
|
+
import { onDidRegisterWindow, addDisposableListener, EventType, getActiveElement, isEditableElement, trackFocus, getActiveWindow } from '../../base/browser/dom.js';
|
|
8
9
|
import { RemoteNameContext, VirtualWorkspaceContext, TemporaryWorkspaceContext, HasWebFileSystemAccess, EmbedderIdentifierContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, DirtyWorkingCopiesContext, WorkbenchStateContext, WorkspaceFolderCountContext, OpenFolderWorkspaceSupportContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, SplitEditorsVertically, IsMainWindowFullscreenContext, IsAuxiliaryWindowFocusedContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, EditorTabsVisibleContext, SideBarVisibleContext, TitleBarVisibleContext, TitleBarStyleContext, PanelPositionContext, PanelVisibleContext, PanelMaximizedContext, PanelAlignmentContext, AuxiliaryBarVisibleContext, IsSandboxWorkspaceContext } from '../common/contextkeys.js';
|
|
9
|
-
import { onDidRegisterWindow, addDisposableListener, EventType, isEditableElement, trackFocus, getActiveWindow } from '../../base/browser/dom.js';
|
|
10
10
|
import { preferredSideBySideGroupDirection, GroupDirection } from '../services/editor/common/editorGroupsService.js';
|
|
11
11
|
import { IEditorGroupsService } from '../services/editor/common/editorGroupsService.service.js';
|
|
12
12
|
import { IConfigurationService } from '../../platform/configuration/common/configuration.service.js';
|
|
@@ -183,12 +183,13 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
|
|
|
183
183
|
}
|
|
184
184
|
updateInputContextKeys(ownerDocument, disposables) {
|
|
185
185
|
function activeElementIsInput() {
|
|
186
|
-
|
|
186
|
+
const activeElement = getActiveElement(ownerDocument);
|
|
187
|
+
return !!activeElement && isEditableElement(activeElement);
|
|
187
188
|
}
|
|
188
189
|
const isInputFocused = activeElementIsInput();
|
|
189
190
|
this.inputFocusedContext.set(isInputFocused);
|
|
190
191
|
if (isInputFocused) {
|
|
191
|
-
const tracker = disposables.add(trackFocus(ownerDocument
|
|
192
|
+
const tracker = disposables.add(trackFocus(getActiveElement(ownerDocument)));
|
|
192
193
|
Event.once(tracker.onDidBlur)(() => {
|
|
193
194
|
if (getActiveWindow().document === ownerDocument) {
|
|
194
195
|
this.inputFocusedContext.set(activeElementIsInput());
|