@codingame/monaco-vscode-host-service-override 18.2.1 → 18.3.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 CHANGED
@@ -1,2 +1,6 @@
1
1
  import type { IEditorOverrideServices } from "@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices";
2
- export default function getServiceOverride(): IEditorOverrideServices;
2
+ interface BrowserHostServiceOverrideParams {
3
+ toggleFullScreen?: () => Promise<void>;
4
+ }
5
+ export default function getServiceOverride({ toggleFullScreen }?: BrowserHostServiceOverrideParams): IEditorOverrideServices;
6
+ export {};
package/index.js CHANGED
@@ -1,13 +1,53 @@
1
1
 
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
4
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
5
+ import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
6
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
2
7
  import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
3
- import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
4
- import { IHostColorSchemeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/hostColorSchemeService.service';
8
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
9
+ import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
10
+ import { ILayoutService } from '@codingame/monaco-vscode-api/vscode/vs/platform/layout/browser/layoutService.service';
11
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
12
+ import { IUserDataProfilesService } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
13
+ import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
14
+ import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-34a0ffd3-b9f5-5699-b43b-38af5732f38a-common/vscode/vs/workbench/services/environment/browser/environmentService.service';
5
15
  import { BrowserHostService } from './vscode/src/vs/workbench/services/host/browser/browserHostService.js';
16
+ import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
17
+ import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
6
18
  import { BrowserHostColorSchemeService } from './vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js';
19
+ import { IHostColorSchemeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/hostColorSchemeService.service';
7
20
 
8
- function getServiceOverride() {
21
+ let CustomBrowserHostService = class CustomBrowserHostService extends BrowserHostService {
22
+ constructor(_toggleFullScreen, layoutService, configurationService, fileService, labelService, environmentService, instantiationService, lifecycleService, logService, dialogService, contextService, userDataProfilesService) {
23
+ super(layoutService, configurationService, fileService, labelService, environmentService, instantiationService, lifecycleService, logService, dialogService, contextService, userDataProfilesService);
24
+ this._toggleFullScreen = _toggleFullScreen;
25
+ }
26
+ async toggleFullScreen(targetWindow) {
27
+ if (this._toggleFullScreen != null && targetWindow === mainWindow) {
28
+ await this._toggleFullScreen();
29
+ }
30
+ else {
31
+ await super.toggleFullScreen(targetWindow);
32
+ }
33
+ }
34
+ };
35
+ CustomBrowserHostService = __decorate([
36
+ __param(1, ILayoutService),
37
+ __param(2, IConfigurationService),
38
+ __param(3, IFileService),
39
+ __param(4, ILabelService),
40
+ __param(5, IBrowserWorkbenchEnvironmentService),
41
+ __param(6, IInstantiationService),
42
+ __param(7, ILifecycleService),
43
+ __param(8, ILogService),
44
+ __param(9, IDialogService),
45
+ __param(10, IWorkspaceContextService),
46
+ __param(11, IUserDataProfilesService)
47
+ ], CustomBrowserHostService);
48
+ function getServiceOverride({ toggleFullScreen } = {}) {
9
49
  return {
10
- [IHostService.toString()]: new SyncDescriptor(BrowserHostService, [], true),
50
+ [IHostService.toString()]: new SyncDescriptor(CustomBrowserHostService, [toggleFullScreen], true),
11
51
  [IHostColorSchemeService.toString()]: new SyncDescriptor(BrowserHostColorSchemeService, [], true)
12
52
  };
13
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-host-service-override",
3
- "version": "18.2.1",
3
+ "version": "18.3.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": "18.2.1",
19
- "@codingame/monaco-vscode-34a0ffd3-b9f5-5699-b43b-38af5732f38a-common": "18.2.1",
20
- "@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "18.2.1",
21
- "@codingame/monaco-vscode-api": "18.2.1"
18
+ "@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common": "18.3.0",
19
+ "@codingame/monaco-vscode-34a0ffd3-b9f5-5699-b43b-38af5732f38a-common": "18.3.0",
20
+ "@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "18.3.0",
21
+ "@codingame/monaco-vscode-api": "18.3.0"
22
22
  },
23
23
  "main": "index.js",
24
24
  "module": "index.js",
@@ -142,7 +142,7 @@ let BrowserHostService = class BrowserHostService extends Disposable {
142
142
  const windowId = getWindowId(window);
143
143
  const viewport = isIOS && window.visualViewport ? window.visualViewport : window ;
144
144
  const isFullScreen = () => {
145
- const fullScreen = detectFullscreen(window);
145
+ const fullScreen = detectFullscreen(window, this.layoutService.getContainer(window));
146
146
  return fullScreen !== null && !fullScreen.guess;
147
147
  };
148
148
  for (const event of [EventType.FULLSCREEN_CHANGE, EventType.WK_FULLSCREEN_CHANGE]) {