@codingame/monaco-vscode-api 23.0.0 → 23.0.2
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 +5 -0
- package/vscode/src/vs/base/browser/dom.js +25 -1
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.d.ts +2 -3
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +11 -14
- package/vscode/src/vs/platform/product/common/product.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.2",
|
|
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": "23.0.
|
|
19
|
-
"@codingame/monaco-vscode-environment-service-override": "23.0.
|
|
20
|
-
"@codingame/monaco-vscode-extensions-service-override": "23.0.
|
|
21
|
-
"@codingame/monaco-vscode-files-service-override": "23.0.
|
|
22
|
-
"@codingame/monaco-vscode-host-service-override": "23.0.
|
|
23
|
-
"@codingame/monaco-vscode-layout-service-override": "23.0.
|
|
24
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "23.0.
|
|
18
|
+
"@codingame/monaco-vscode-base-service-override": "23.0.2",
|
|
19
|
+
"@codingame/monaco-vscode-environment-service-override": "23.0.2",
|
|
20
|
+
"@codingame/monaco-vscode-extensions-service-override": "23.0.2",
|
|
21
|
+
"@codingame/monaco-vscode-files-service-override": "23.0.2",
|
|
22
|
+
"@codingame/monaco-vscode-host-service-override": "23.0.2",
|
|
23
|
+
"@codingame/monaco-vscode-layout-service-override": "23.0.2",
|
|
24
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "23.0.2",
|
|
25
25
|
"@vscode/iconv-lite-umd": "0.7.1",
|
|
26
26
|
"dompurify": "3.3.0",
|
|
27
27
|
"jschardet": "3.1.4",
|
package/services.js
CHANGED
|
@@ -402,10 +402,10 @@ export { IInlineCompletionsUnificationService } from './vscode/src/vs/workbench/
|
|
|
402
402
|
export { IMcpGalleryManifestService } from './vscode/src/vs/platform/mcp/common/mcpGalleryManifest.service.js';
|
|
403
403
|
export { IDataChannelService } from './vscode/src/vs/platform/dataChannel/common/dataChannel.service.js';
|
|
404
404
|
|
|
405
|
-
if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.106.0-
|
|
406
|
-
throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.106.0-
|
|
405
|
+
if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.106.0-2877b897-00b3-4b05-b212-984eee61cf21") {
|
|
406
|
+
throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.106.0-2877b897-00b3-4b05-b212-984eee61cf21"}, ${window.monacoVscodeApiBuildId} is already loaded`);
|
|
407
407
|
}
|
|
408
|
-
window.monacoVscodeApiBuildId = "1.106.0-
|
|
408
|
+
window.monacoVscodeApiBuildId = "1.106.0-2877b897-00b3-4b05-b212-984eee61cf21";
|
|
409
409
|
function registerCommands(options) {
|
|
410
410
|
function asMenuId(menu) {
|
|
411
411
|
switch (menu) {
|
|
@@ -18,6 +18,11 @@ export declare function clearNode(node: HTMLElement): void;
|
|
|
18
18
|
export declare function addDisposableListener<K extends keyof GlobalEventHandlersEventMap>(node: EventTarget, type: K, handler: (event: GlobalEventHandlersEventMap[K]) => void, useCapture?: boolean): IDisposable;
|
|
19
19
|
export declare function addDisposableListener(node: EventTarget, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable;
|
|
20
20
|
export declare function addDisposableListener(node: EventTarget, type: string, handler: (event: any) => void, options: AddEventListenerOptions): IDisposable;
|
|
21
|
+
export interface IActiveElementTracker extends Disposable {
|
|
22
|
+
readonly onDidChangeActiveElement: event.Event<Element | null>;
|
|
23
|
+
activeElement: Element | null;
|
|
24
|
+
}
|
|
25
|
+
export declare function trackActiveElement(window: CodeWindow): IActiveElementTracker;
|
|
21
26
|
export interface IAddStandardDisposableListenerSignature {
|
|
22
27
|
(node: HTMLElement | Element | Document, type: "click", handler: (event: IMouseEvent) => void, useCapture?: boolean): IDisposable;
|
|
23
28
|
(node: HTMLElement | Element | Document, type: "mousedown", handler: (event: IMouseEvent) => void, useCapture?: boolean): IDisposable;
|
|
@@ -109,6 +109,30 @@ class DomListener {
|
|
|
109
109
|
function addDisposableListener(node, type, handler, useCaptureOrOptions) {
|
|
110
110
|
return new DomListener(node, type, handler, useCaptureOrOptions);
|
|
111
111
|
}
|
|
112
|
+
class ActiveElementTracker extends Disposable {
|
|
113
|
+
get onDidChangeActiveElement() { return this._onDidChangeActiveElement.event; }
|
|
114
|
+
constructor(window) {
|
|
115
|
+
super();
|
|
116
|
+
this.window = window;
|
|
117
|
+
this.activeElement = null;
|
|
118
|
+
this._onDidChangeActiveElement = this._register(new Emitter());
|
|
119
|
+
this._onFocusIn = (e) => {
|
|
120
|
+
this.activeElement = getActiveElement(this.window.document);
|
|
121
|
+
this._onDidChangeActiveElement.fire(this.activeElement);
|
|
122
|
+
if (isElement(e.target) && e.target.shadowRoot) {
|
|
123
|
+
const disposableStore = ( new DisposableStore());
|
|
124
|
+
disposableStore.add(addDisposableListener(e.target.shadowRoot, EventType.FOCUS_IN, this._onFocusIn));
|
|
125
|
+
disposableStore.add(addDisposableListener(e.target, EventType.FOCUS_OUT, () => {
|
|
126
|
+
disposableStore.dispose();
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
this._register(addDisposableListener(this.window, EventType.FOCUS_IN, this._onFocusIn));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function trackActiveElement(window) {
|
|
134
|
+
return ( new ActiveElementTracker(window));
|
|
135
|
+
}
|
|
112
136
|
function _wrapAsStandardMouseEvent(targetWindow, handler) {
|
|
113
137
|
return function (e) {
|
|
114
138
|
return handler(( new StandardMouseEvent(targetWindow, e)));
|
|
@@ -1723,4 +1747,4 @@ function isObservable(obj) {
|
|
|
1723
1747
|
return !!obj && obj.read !== undefined && obj.reportChanges !== undefined;
|
|
1724
1748
|
}
|
|
1725
1749
|
|
|
1726
|
-
export { $, DetectedFullscreenMode, Dimension, DragAndDropObserver, EventHelper, EventType, LiveElement, ModifierKeyEmitter, Namespace, ObserverNode, ObserverNodeWithElement, SafeTriangle, WindowIdleValue, WindowIntervalTimer, addDisposableGenericMouseDownListener, addDisposableGenericMouseMoveListener, addDisposableGenericMouseUpListener, addDisposableListener, addDisposableThrottledListener, addStandardDisposableGenericMouseDownListener, addStandardDisposableGenericMouseUpListener, addStandardDisposableListener, after, animate, append, clearNode, computeScreenAwareSize, copyAttributes, createDocumentFragment, createElement, createElementNS, createLinkElement, createMetaElement, createTextNode, 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, isActiveDocument, isActiveElement, isAncestor, isAncestorOfActiveElement, isAncestorUsingFlowTo, isDragEvent, isEditableElement, isElement, isElementInBottomRightQuarter, isEventLike, isHTMLAnchorElement, isHTMLButtonElement, isHTMLDivElement, isHTMLElement, isHTMLIframeElement, isHTMLInputElement, isHTMLTextAreaElement, isInShadowDOM, isKeyboardEvent, isMouseEvent, isPointerEvent, isSVGElement, isShadowRoot, measure, modify, n, onDidRegisterWindow, onDidUnregisterWindow, onWillUnregisterWindow, position, prepend, registerWindow, reset, restoreParentsScrollTop, runAtThisOrScheduleAtNextAnimationFrame, runWhenWindowIdle, saveParentsScrollTop, scheduleAtNextAnimationFrame, setParentFlowTo, setVisibility, sharedMutationObserver, show, size, svgElem, trackAttributes, trackFocus, triggerDownload, triggerNotification, triggerUpload, windowOpenNoOpener, windowOpenPopup, windowOpenWithSuccess };
|
|
1750
|
+
export { $, DetectedFullscreenMode, Dimension, DragAndDropObserver, EventHelper, EventType, LiveElement, ModifierKeyEmitter, Namespace, ObserverNode, ObserverNodeWithElement, SafeTriangle, WindowIdleValue, WindowIntervalTimer, addDisposableGenericMouseDownListener, addDisposableGenericMouseMoveListener, addDisposableGenericMouseUpListener, addDisposableListener, addDisposableThrottledListener, addStandardDisposableGenericMouseDownListener, addStandardDisposableGenericMouseUpListener, addStandardDisposableListener, after, animate, append, clearNode, computeScreenAwareSize, copyAttributes, createDocumentFragment, createElement, createElementNS, createLinkElement, createMetaElement, createTextNode, 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, isActiveDocument, isActiveElement, isAncestor, isAncestorOfActiveElement, isAncestorUsingFlowTo, isDragEvent, isEditableElement, isElement, isElementInBottomRightQuarter, isEventLike, isHTMLAnchorElement, isHTMLButtonElement, isHTMLDivElement, isHTMLElement, isHTMLIframeElement, isHTMLInputElement, isHTMLTextAreaElement, isInShadowDOM, isKeyboardEvent, isMouseEvent, isPointerEvent, isSVGElement, isShadowRoot, measure, modify, n, onDidRegisterWindow, onDidUnregisterWindow, onWillUnregisterWindow, position, prepend, registerWindow, reset, restoreParentsScrollTop, runAtThisOrScheduleAtNextAnimationFrame, runWhenWindowIdle, saveParentsScrollTop, scheduleAtNextAnimationFrame, setParentFlowTo, setVisibility, sharedMutationObserver, show, size, svgElem, trackActiveElement, trackAttributes, trackFocus, triggerDownload, triggerNotification, triggerUpload, windowOpenNoOpener, windowOpenPopup, windowOpenWithSuccess };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Event, PauseableEmitter } from "../../../base/common/event.js";
|
|
2
2
|
import { Disposable } from "../../../base/common/lifecycle.js";
|
|
3
3
|
import { IConfigurationService } from "../../configuration/common/configuration.service.js";
|
|
4
|
+
import { ServicesAccessor } from "../../instantiation/common/instantiation.js";
|
|
4
5
|
import { ContextKeyExpression, ContextKeyValue, IContext, IContextKey, IContextKeyChangeEvent, IContextKeyServiceTarget, IScopedContextKeyService } from "../common/contextkey.js";
|
|
5
6
|
import { IContextKeyService } from "../common/contextkey.service.js";
|
|
6
|
-
import { ServicesAccessor } from "../../instantiation/common/instantiation.js";
|
|
7
|
-
import { ILayoutService } from "../../layout/browser/layoutService.service.js";
|
|
8
7
|
export declare class Context implements IContext {
|
|
9
8
|
protected _parent: Context | null;
|
|
10
9
|
protected _value: Record<string, any>;
|
|
@@ -47,7 +46,7 @@ export declare class ContextKeyService extends AbstractContextKeyService impleme
|
|
|
47
46
|
private _lastContextId;
|
|
48
47
|
private readonly _contexts;
|
|
49
48
|
private inputFocusedContext;
|
|
50
|
-
constructor(configurationService: IConfigurationService
|
|
49
|
+
constructor(configurationService: IConfigurationService);
|
|
51
50
|
private updateInputContextKeys;
|
|
52
51
|
getContextValuesContainer(contextId: number): Context;
|
|
53
52
|
createChildContext(parentContextId?: number): number;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
3
|
+
import { onDidRegisterWindow, trackActiveElement, getActiveElement, isEditableElement, trackFocus, getActiveDocument } from '../../../base/browser/dom.js';
|
|
4
|
+
import { mainWindow } from '../../../base/browser/window.js';
|
|
3
5
|
import { PauseableEmitter, Event } from '../../../base/common/event.js';
|
|
4
6
|
import { Iterable } from '../../../base/common/iterator.js';
|
|
5
7
|
import { Disposable, MutableDisposable, DisposableStore } from '../../../base/common/lifecycle.js';
|
|
@@ -14,9 +16,6 @@ import { IConfigurationService } from '../../configuration/common/configuration.
|
|
|
14
16
|
import { RawContextKey } from '../common/contextkey.js';
|
|
15
17
|
import { IContextKeyService } from '../common/contextkey.service.js';
|
|
16
18
|
import { InputFocusedContext } from '../common/contextkeys.js';
|
|
17
|
-
import { mainWindow } from '../../../base/browser/window.js';
|
|
18
|
-
import { onDidRegisterWindow, addDisposableListener, EventType, getActiveElement, isEditableElement, trackFocus, getActiveDocument } from '../../../base/browser/dom.js';
|
|
19
|
-
import { ILayoutService } from '../../layout/browser/layoutService.service.js';
|
|
20
19
|
|
|
21
20
|
const KEYBINDING_CONTEXT_ATTR = 'data-keybinding-context';
|
|
22
21
|
class Context {
|
|
@@ -302,7 +301,7 @@ class AbstractContextKeyService extends Disposable {
|
|
|
302
301
|
}
|
|
303
302
|
}
|
|
304
303
|
let ContextKeyService = class ContextKeyService extends AbstractContextKeyService {
|
|
305
|
-
constructor(configurationService
|
|
304
|
+
constructor(configurationService) {
|
|
306
305
|
super(0);
|
|
307
306
|
this._contexts = ( new Map());
|
|
308
307
|
this._lastContextId = 0;
|
|
@@ -311,21 +310,20 @@ let ContextKeyService = class ContextKeyService extends AbstractContextKeyServic
|
|
|
311
310
|
this._contexts.set(this._myContextId, myContext);
|
|
312
311
|
this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => {
|
|
313
312
|
const onFocusDisposables = disposables.add(( new MutableDisposable()));
|
|
314
|
-
disposables.add(
|
|
313
|
+
const activeElementTracker = disposables.add(trackActiveElement(window));
|
|
314
|
+
activeElementTracker.onDidChangeActiveElement((activeElement) => {
|
|
315
315
|
onFocusDisposables.value = ( new DisposableStore());
|
|
316
|
-
this.updateInputContextKeys(window.document, onFocusDisposables.value);
|
|
317
|
-
}
|
|
316
|
+
this.updateInputContextKeys(window.document, activeElement, onFocusDisposables.value);
|
|
317
|
+
});
|
|
318
318
|
}, { window: mainWindow, disposables: this._store }));
|
|
319
319
|
}
|
|
320
|
-
updateInputContextKeys(ownerDocument, disposables) {
|
|
321
|
-
function activeElementIsInput() {
|
|
322
|
-
const activeElement = getActiveElement(ownerDocument);
|
|
320
|
+
updateInputContextKeys(ownerDocument, activeElement, disposables) {
|
|
321
|
+
function activeElementIsInput(activeElement = getActiveElement(ownerDocument)) {
|
|
323
322
|
return !!activeElement && isEditableElement(activeElement);
|
|
324
323
|
}
|
|
325
|
-
const isInputFocused = activeElementIsInput();
|
|
324
|
+
const isInputFocused = activeElementIsInput(activeElement);
|
|
326
325
|
this.inputFocusedContext.set(isInputFocused);
|
|
327
326
|
if (isInputFocused) {
|
|
328
|
-
const activeElement = getActiveElement(ownerDocument);
|
|
329
327
|
const tracker = disposables.add(trackFocus(activeElement));
|
|
330
328
|
Event.once(tracker.onDidBlur)(() => {
|
|
331
329
|
if (getActiveDocument() === ownerDocument) {
|
|
@@ -359,8 +357,7 @@ let ContextKeyService = class ContextKeyService extends AbstractContextKeyServic
|
|
|
359
357
|
}
|
|
360
358
|
};
|
|
361
359
|
ContextKeyService = ( __decorate([
|
|
362
|
-
( __param(0, IConfigurationService))
|
|
363
|
-
( __param(1, ILayoutService))
|
|
360
|
+
( __param(0, IConfigurationService))
|
|
364
361
|
], ContextKeyService));
|
|
365
362
|
class ScopedContextKeyService extends AbstractContextKeyService {
|
|
366
363
|
constructor(parent, domNode) {
|