@codingame/monaco-vscode-host-service-override 23.0.4 → 23.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 +3 -1
- package/index.js +35 -14
- package/package.json +5 -5
package/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IEditorOverrideServices } from "@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices";
|
|
2
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
3
|
interface BrowserHostServiceOverrideParams {
|
|
3
4
|
toggleFullScreen?: () => Promise<void>;
|
|
5
|
+
onDidChangeFullScreen?: Event<boolean>;
|
|
4
6
|
}
|
|
5
|
-
export default function getServiceOverride({ toggleFullScreen }?: BrowserHostServiceOverrideParams): IEditorOverrideServices;
|
|
7
|
+
export default function getServiceOverride({ toggleFullScreen, onDidChangeFullScreen }?: BrowserHostServiceOverrideParams): IEditorOverrideServices;
|
|
6
8
|
export {};
|
package/index.js
CHANGED
|
@@ -17,11 +17,29 @@ import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/s
|
|
|
17
17
|
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
18
18
|
import { BrowserHostColorSchemeService } from './vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js';
|
|
19
19
|
import { IHostColorSchemeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/hostColorSchemeService.service';
|
|
20
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
21
|
+
import { getWindowId } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
20
22
|
|
|
21
23
|
let CustomBrowserHostService = class CustomBrowserHostService extends BrowserHostService {
|
|
22
|
-
constructor(_toggleFullScreen, layoutService, configurationService, fileService, labelService, environmentService, instantiationService, lifecycleService, logService, dialogService, contextService, userDataProfilesService) {
|
|
24
|
+
constructor(_toggleFullScreen, _onDidChangeFullScreen, layoutService, configurationService, fileService, labelService, environmentService, instantiationService, lifecycleService, logService, dialogService, contextService, userDataProfilesService) {
|
|
23
25
|
super(layoutService, configurationService, fileService, labelService, environmentService, instantiationService, lifecycleService, logService, dialogService, contextService, userDataProfilesService);
|
|
24
26
|
this._toggleFullScreen = _toggleFullScreen;
|
|
27
|
+
this._onDidChangeFullScreen = (() => {
|
|
28
|
+
const mainWindowId = getWindowId(mainWindow);
|
|
29
|
+
const emitter = new Emitter();
|
|
30
|
+
_onDidChangeFullScreen?.((fullscreen) => {
|
|
31
|
+
emitter.fire({
|
|
32
|
+
windowId: mainWindowId,
|
|
33
|
+
fullscreen
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
super.onDidChangeFullScreen((event) => {
|
|
37
|
+
if (_onDidChangeFullScreen == null || event.windowId !== mainWindowId) {
|
|
38
|
+
emitter.fire(event);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return emitter.event;
|
|
42
|
+
})();
|
|
25
43
|
}
|
|
26
44
|
async toggleFullScreen(targetWindow) {
|
|
27
45
|
if (this._toggleFullScreen != null && targetWindow === mainWindow) {
|
|
@@ -31,23 +49,26 @@ let CustomBrowserHostService = class CustomBrowserHostService extends BrowserHos
|
|
|
31
49
|
await super.toggleFullScreen(targetWindow);
|
|
32
50
|
}
|
|
33
51
|
}
|
|
52
|
+
get onDidChangeFullScreen() {
|
|
53
|
+
return this._onDidChangeFullScreen;
|
|
54
|
+
}
|
|
34
55
|
};
|
|
35
56
|
CustomBrowserHostService = __decorate([
|
|
36
|
-
__param(
|
|
37
|
-
__param(
|
|
38
|
-
__param(
|
|
39
|
-
__param(
|
|
40
|
-
__param(
|
|
41
|
-
__param(
|
|
42
|
-
__param(
|
|
43
|
-
__param(
|
|
44
|
-
__param(
|
|
45
|
-
__param(
|
|
46
|
-
__param(
|
|
57
|
+
__param(2, ILayoutService),
|
|
58
|
+
__param(3, IConfigurationService),
|
|
59
|
+
__param(4, IFileService),
|
|
60
|
+
__param(5, ILabelService),
|
|
61
|
+
__param(6, IBrowserWorkbenchEnvironmentService),
|
|
62
|
+
__param(7, IInstantiationService),
|
|
63
|
+
__param(8, ILifecycleService),
|
|
64
|
+
__param(9, ILogService),
|
|
65
|
+
__param(10, IDialogService),
|
|
66
|
+
__param(11, IWorkspaceContextService),
|
|
67
|
+
__param(12, IUserDataProfilesService)
|
|
47
68
|
], CustomBrowserHostService);
|
|
48
|
-
function getServiceOverride({ toggleFullScreen } = {}) {
|
|
69
|
+
function getServiceOverride({ toggleFullScreen, onDidChangeFullScreen } = {}) {
|
|
49
70
|
return {
|
|
50
|
-
[IHostService.toString()]: new SyncDescriptor(CustomBrowserHostService, [toggleFullScreen], true),
|
|
71
|
+
[IHostService.toString()]: new SyncDescriptor(CustomBrowserHostService, [toggleFullScreen, onDidChangeFullScreen], true),
|
|
51
72
|
[IHostColorSchemeService.toString()]: new SyncDescriptor(BrowserHostColorSchemeService, [], true)
|
|
52
73
|
};
|
|
53
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-host-service-override",
|
|
3
|
-
"version": "23.0
|
|
3
|
+
"version": "23.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - host service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common": "23.0
|
|
19
|
-
"@codingame/monaco-vscode-4bf376c2-03c7-58cb-8303-c67aeefa3d3d-common": "23.0
|
|
20
|
-
"@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "23.0
|
|
21
|
-
"@codingame/monaco-vscode-api": "23.0
|
|
18
|
+
"@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common": "23.1.0",
|
|
19
|
+
"@codingame/monaco-vscode-4bf376c2-03c7-58cb-8303-c67aeefa3d3d-common": "23.1.0",
|
|
20
|
+
"@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "23.1.0",
|
|
21
|
+
"@codingame/monaco-vscode-api": "23.1.0"
|
|
22
22
|
},
|
|
23
23
|
"main": "index.js",
|
|
24
24
|
"module": "index.js",
|