@codingame/monaco-vscode-views-service-override 2.2.0-next.3 → 2.2.0-next.5
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 +2 -2
- package/index.js +1 -1
- package/package.json +11 -11
- package/tools/views.d.ts +6 -3
- package/tools/views.js +23 -9
- package/views.js +1 -1
package/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export { IView, SplitView } from 'vscode/vscode/vs/base/browser/ui/splitview/spl
|
|
|
10
10
|
export { GroupOrientation } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
11
11
|
export { IResolvedTextEditorModel } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
12
12
|
export { HoverService } from 'vscode/vscode/vs/editor/browser/services/hoverService';
|
|
13
|
-
export { CustomViewOption, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility } from './tools/views.js';
|
|
14
|
-
export { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
13
|
+
export { CustomViewOption, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
|
|
14
|
+
export { IViewContainerDescriptor, IViewDescriptor, ViewContainer, ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
15
15
|
export { EditorInput, IEditorCloseHandler } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
16
16
|
export { ConfirmResult } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
17
17
|
export { EditorInputFactoryObject, RegisteredEditorInfo, RegisteredEditorOptions, RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { GroupOrientation } from 'vscode/vscode/vs/workbench/services/editor/com
|
|
|
5
5
|
export { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
6
6
|
export { EditorInputCapabilities } from 'vscode/vscode/vs/workbench/common/editor';
|
|
7
7
|
export { Parts, Position } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
8
|
-
export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility } from './tools/views.js';
|
|
8
|
+
export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
|
|
9
9
|
export { ConfirmResult } from './override/vs/platform/dialogs/common/dialogs.js';
|
|
10
10
|
export { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
11
11
|
export { AbstractResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/resourceEditorInput';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-views-service-override",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.5",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@2.2.0-next.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.2.0-next.5",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
23
|
-
"@codingame/monaco-vscode-bulk-edit-service-override": "2.2.0-next.
|
|
24
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "2.2.0-next.
|
|
25
|
-
"@codingame/monaco-vscode-keybindings-service-override": "2.2.0-next.
|
|
26
|
-
"@codingame/monaco-vscode-files-service-override": "2.2.0-next.
|
|
27
|
-
"@codingame/monaco-vscode-extensions-service-override": "2.2.0-next.
|
|
28
|
-
"@codingame/monaco-vscode-environment-service-override": "2.2.0-next.
|
|
29
|
-
"@codingame/monaco-vscode-layout-service-override": "2.2.0-next.
|
|
30
|
-
"@codingame/monaco-vscode-host-service-override": "2.2.0-next.
|
|
31
|
-
"@codingame/monaco-vscode-base-service-override": "2.2.0-next.
|
|
23
|
+
"@codingame/monaco-vscode-bulk-edit-service-override": "2.2.0-next.5",
|
|
24
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "2.2.0-next.5",
|
|
25
|
+
"@codingame/monaco-vscode-keybindings-service-override": "2.2.0-next.5",
|
|
26
|
+
"@codingame/monaco-vscode-files-service-override": "2.2.0-next.5",
|
|
27
|
+
"@codingame/monaco-vscode-extensions-service-override": "2.2.0-next.5",
|
|
28
|
+
"@codingame/monaco-vscode-environment-service-override": "2.2.0-next.5",
|
|
29
|
+
"@codingame/monaco-vscode-layout-service-override": "2.2.0-next.5",
|
|
30
|
+
"@codingame/monaco-vscode-host-service-override": "2.2.0-next.5",
|
|
31
|
+
"@codingame/monaco-vscode-base-service-override": "2.2.0-next.5"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/tools/views.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ViewContainerLocation, ViewContainer } from 'vscode/vscode/vs/workbench/common/views';
|
|
2
|
-
export { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
1
|
+
import { ViewContainerLocation, ViewContainer, IViewContainersRegistry, IViewsRegistry } from 'vscode/vscode/vs/workbench/common/views';
|
|
2
|
+
export { IViewContainerDescriptor, IViewDescriptor, ViewContainer, ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
3
3
|
import { BrandedService, ServicesAccessor } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
4
|
import { IDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { Dimension } from 'vscode/vscode/vs/base/browser/dom';
|
|
@@ -29,6 +29,7 @@ type Label = string | {
|
|
|
29
29
|
};
|
|
30
30
|
declare abstract class SimpleEditorPane extends EditorPane {
|
|
31
31
|
protected container: HTMLElement;
|
|
32
|
+
protected wrapper: HTMLElement;
|
|
32
33
|
private scrollbar;
|
|
33
34
|
private inputDisposable;
|
|
34
35
|
constructor(id: string, telemetryService: ITelemetryService, themeService: IThemeService, storageService: IStorageService);
|
|
@@ -91,6 +92,8 @@ interface CustomViewOption {
|
|
|
91
92
|
hideByDefault?: boolean;
|
|
92
93
|
collapsed?: boolean;
|
|
93
94
|
}
|
|
95
|
+
declare const viewContainerRegistry: IViewContainersRegistry;
|
|
96
|
+
declare const viewRegistry: IViewsRegistry;
|
|
94
97
|
declare function registerCustomView(options: CustomViewOption): IDisposable;
|
|
95
98
|
declare function isPartVisibile(part: Parts): boolean;
|
|
96
99
|
declare function setPartVisibility(part: Exclude<Parts, Parts.STATUSBAR_PART | Parts.TITLEBAR_PART>, visible: boolean): void;
|
|
@@ -99,4 +102,4 @@ declare function getPanelPosition(): Position;
|
|
|
99
102
|
declare const onDidChangeSideBarPosition: Event<string>;
|
|
100
103
|
declare function getSideBarPosition(): Position;
|
|
101
104
|
|
|
102
|
-
export { type CustomViewOption, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility };
|
|
105
|
+
export { type CustomViewOption, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry };
|
package/tools/views.js
CHANGED
|
@@ -26,7 +26,7 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
26
26
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
27
27
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
28
28
|
import { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
29
|
-
import {
|
|
29
|
+
import { assertIsDefined, assertAllDefined } from 'vscode/vscode/vs/base/common/types';
|
|
30
30
|
export { ConfirmResult } from '../override/vs/platform/dialogs/common/dialogs.js';
|
|
31
31
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
32
32
|
export { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
@@ -40,8 +40,19 @@ let SimpleEditorPane = class SimpleEditorPane extends EditorPane {
|
|
|
40
40
|
}
|
|
41
41
|
createEditor(parent) {
|
|
42
42
|
this.container = this.initialize();
|
|
43
|
-
this.
|
|
43
|
+
this.wrapper = document.createElement('div');
|
|
44
|
+
this.wrapper.append(this.container);
|
|
45
|
+
this.scrollbar = this._register(new DomScrollableElement(this.wrapper, { horizontal: 1 , vertical: 1 }));
|
|
44
46
|
parent.appendChild(this.scrollbar.getDomNode());
|
|
47
|
+
const observer = new ResizeObserver(() => {
|
|
48
|
+
assertIsDefined(this.scrollbar).scanDomNode();
|
|
49
|
+
});
|
|
50
|
+
observer.observe(this.container);
|
|
51
|
+
this._register({
|
|
52
|
+
dispose() {
|
|
53
|
+
observer.disconnect();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
45
56
|
}
|
|
46
57
|
async setInput(input, editorOptions, context, token) {
|
|
47
58
|
await super.setInput(input, editorOptions, context, token);
|
|
@@ -49,10 +60,11 @@ let SimpleEditorPane = class SimpleEditorPane extends EditorPane {
|
|
|
49
60
|
return;
|
|
50
61
|
}
|
|
51
62
|
this.inputDisposable.value = await this.renderInput?.(input, editorOptions, context, token);
|
|
63
|
+
assertIsDefined(this.scrollbar).scanDomNode();
|
|
52
64
|
}
|
|
53
65
|
layout(dimension) {
|
|
54
|
-
const [
|
|
55
|
-
size(
|
|
66
|
+
const [wrapper, scrollbar] = assertAllDefined(this.wrapper, this.scrollbar);
|
|
67
|
+
size(wrapper, dimension.width, dimension.height);
|
|
56
68
|
scrollbar.scanDomNode();
|
|
57
69
|
}
|
|
58
70
|
focus() {
|
|
@@ -146,9 +158,11 @@ function registerEditor(globPattern, editorInfo, editorOptions, factory) {
|
|
|
146
158
|
function registerEditorSerializer(editorTypeId, ctor) {
|
|
147
159
|
return ( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(editorTypeId, ctor);
|
|
148
160
|
}
|
|
161
|
+
const viewContainerRegistry = ( Registry.as(Extensions.ViewContainersRegistry));
|
|
162
|
+
const viewRegistry = ( Registry.as(Extensions.ViewsRegistry));
|
|
149
163
|
function registerCustomView(options) {
|
|
150
164
|
const iconUrl = options.icon != null ? ( URI.parse(options.icon)) : undefined;
|
|
151
|
-
const viewContainer = options.viewContainer ??
|
|
165
|
+
const viewContainer = options.viewContainer ?? viewContainerRegistry.registerViewContainer({
|
|
152
166
|
id: options.id,
|
|
153
167
|
title: { value: options.name, original: options.name },
|
|
154
168
|
order: options.order,
|
|
@@ -197,13 +211,13 @@ function registerCustomView(options) {
|
|
|
197
211
|
order: options.order,
|
|
198
212
|
containerIcon: iconUrl
|
|
199
213
|
}];
|
|
200
|
-
|
|
214
|
+
viewRegistry.registerViews(views, viewContainer);
|
|
201
215
|
const disposableCollection = new DisposableStore();
|
|
202
216
|
disposableCollection.add({
|
|
203
217
|
dispose() {
|
|
204
|
-
|
|
218
|
+
viewRegistry.deregisterViews(views, viewContainer);
|
|
205
219
|
if (options.viewContainer == null) {
|
|
206
|
-
|
|
220
|
+
viewContainerRegistry.deregisterViewContainer(viewContainer);
|
|
207
221
|
}
|
|
208
222
|
}
|
|
209
223
|
});
|
|
@@ -250,4 +264,4 @@ function getSideBarPosition() {
|
|
|
250
264
|
return StandaloneServices.get(IWorkbenchLayoutService).getSideBarPosition();
|
|
251
265
|
}
|
|
252
266
|
|
|
253
|
-
export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility };
|
|
267
|
+
export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry };
|
package/views.js
CHANGED
|
@@ -93,7 +93,7 @@ import getServiceOverride$3 from '@codingame/monaco-vscode-keybindings-service-o
|
|
|
93
93
|
import { changeUrlDomain } from './tools/url.js';
|
|
94
94
|
import { onRenderWorkbench } from 'vscode/lifecycle';
|
|
95
95
|
import { registerAssets } from 'vscode/assets';
|
|
96
|
-
export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility } from './tools/views.js';
|
|
96
|
+
export { SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
|
|
97
97
|
export { ConfirmResult } from './override/vs/platform/dialogs/common/dialogs.js';
|
|
98
98
|
export { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
99
99
|
export { AbstractResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/resourceEditorInput';
|