@codingame/monaco-vscode-view-common-service-override 4.5.0 → 4.5.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/index.d.ts +1 -1
- package/package.json +3 -3
- package/vscode/src/vs/base/browser/ui/grid/grid.js +12 -12
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +26 -26
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +4 -3
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +127 -220
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +43 -44
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +7 -30
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +67 -138
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +21 -36
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +26 -27
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +17 -31
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +215 -764
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +27 -42
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +24 -23
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +31 -33
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +51 -54
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +38 -41
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +21 -24
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +2 -5
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +17 -20
- package/vscode/src/vs/workbench/browser/window.js +41 -92
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +41 -78
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -46
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +36 -27
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +14 -15
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +10 -11
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +25 -52
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +55 -87
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +18 -48
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +61 -150
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +15 -70
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +9 -20
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +14 -65
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +38 -113
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +12 -19
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +34 -75
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +16 -37
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +40 -43
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +12 -11
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +24 -61
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +7 -6
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +37 -70
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -46
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +26 -27
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +50 -52
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +18 -34
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +7 -10
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +2 -2
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +45 -46
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +8 -6
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +45 -68
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +95 -98
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +34 -74
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +69 -67
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +52 -47
- package/viewCommon.d.ts +0 -5
|
@@ -29,12 +29,13 @@ import { WebviewFindWidget } from './webviewFindWidget.js';
|
|
|
29
29
|
import { decodeAuthority, webviewRootResourceAuthority, webviewGenericCspSource } from 'vscode/vscode/vs/workbench/contrib/webview/common/webview';
|
|
30
30
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
31
31
|
|
|
32
|
+
const _moduleId = "vs/workbench/contrib/webview/browser/webviewElement";
|
|
32
33
|
var WebviewState;
|
|
33
|
-
( (function(WebviewState) {
|
|
34
|
-
( (function(Type) {
|
|
34
|
+
( ((function(WebviewState) {
|
|
35
|
+
( ((function(Type) {
|
|
35
36
|
Type[Type["Initializing"] = 0] = "Initializing";
|
|
36
37
|
Type[Type["Ready"] = 1] = "Ready";
|
|
37
|
-
})(WebviewState.Type || (WebviewState.Type = {})));
|
|
38
|
+
})(WebviewState.Type || (WebviewState.Type = {}))));
|
|
38
39
|
class Initializing {
|
|
39
40
|
constructor(pendingMessages) {
|
|
40
41
|
this.pendingMessages = pendingMessages;
|
|
@@ -43,7 +44,7 @@ var WebviewState;
|
|
|
43
44
|
}
|
|
44
45
|
WebviewState.Initializing = Initializing;
|
|
45
46
|
WebviewState.Ready = { type: 1 };
|
|
46
|
-
})(WebviewState || (WebviewState = {})));
|
|
47
|
+
})(WebviewState || (WebviewState = {}))));
|
|
47
48
|
const webviewIdContext = 'webviewId';
|
|
48
49
|
let WebviewElement = class WebviewElement extends Disposable {
|
|
49
50
|
get window() { return typeof this._windowId === 'number' ? getWindowById(this._windowId)?.window : undefined; }
|
|
@@ -75,39 +76,39 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
75
76
|
this._windowId = undefined;
|
|
76
77
|
this._expectedServiceWorkerVersion = 4;
|
|
77
78
|
this._state = new WebviewState.Initializing([]);
|
|
78
|
-
this._resourceLoadingCts = this._register(( new CancellationTokenSource()));
|
|
79
|
-
this._focusDelayer = this._register(( new ThrottledDelayer(50)));
|
|
80
|
-
this._onDidHtmlChange = this._register(( new Emitter()));
|
|
79
|
+
this._resourceLoadingCts = this._register(( (new CancellationTokenSource())));
|
|
80
|
+
this._focusDelayer = this._register(( (new ThrottledDelayer(50))));
|
|
81
|
+
this._onDidHtmlChange = this._register(( (new Emitter())));
|
|
81
82
|
this.onDidHtmlChange = this._onDidHtmlChange.event;
|
|
82
|
-
this._messageHandlers = ( new Map());
|
|
83
|
+
this._messageHandlers = ( (new Map()));
|
|
83
84
|
this.checkImeCompletionState = true;
|
|
84
85
|
this._disposed = false;
|
|
85
|
-
this._onMissingCsp = this._register(( new Emitter()));
|
|
86
|
+
this._onMissingCsp = this._register(( (new Emitter())));
|
|
86
87
|
this.onMissingCsp = this._onMissingCsp.event;
|
|
87
|
-
this._onDidClickLink = this._register(( new Emitter()));
|
|
88
|
+
this._onDidClickLink = this._register(( (new Emitter())));
|
|
88
89
|
this.onDidClickLink = this._onDidClickLink.event;
|
|
89
|
-
this._onDidReload = this._register(( new Emitter()));
|
|
90
|
+
this._onDidReload = this._register(( (new Emitter())));
|
|
90
91
|
this.onDidReload = this._onDidReload.event;
|
|
91
|
-
this._onMessage = this._register(( new Emitter()));
|
|
92
|
+
this._onMessage = this._register(( (new Emitter())));
|
|
92
93
|
this.onMessage = this._onMessage.event;
|
|
93
|
-
this._onDidScroll = this._register(( new Emitter()));
|
|
94
|
+
this._onDidScroll = this._register(( (new Emitter())));
|
|
94
95
|
this.onDidScroll = this._onDidScroll.event;
|
|
95
|
-
this._onDidWheel = this._register(( new Emitter()));
|
|
96
|
+
this._onDidWheel = this._register(( (new Emitter())));
|
|
96
97
|
this.onDidWheel = this._onDidWheel.event;
|
|
97
|
-
this._onDidUpdateState = this._register(( new Emitter()));
|
|
98
|
+
this._onDidUpdateState = this._register(( (new Emitter())));
|
|
98
99
|
this.onDidUpdateState = this._onDidUpdateState.event;
|
|
99
|
-
this._onDidFocus = this._register(( new Emitter()));
|
|
100
|
+
this._onDidFocus = this._register(( (new Emitter())));
|
|
100
101
|
this.onDidFocus = this._onDidFocus.event;
|
|
101
|
-
this._onDidBlur = this._register(( new Emitter()));
|
|
102
|
+
this._onDidBlur = this._register(( (new Emitter())));
|
|
102
103
|
this.onDidBlur = this._onDidBlur.event;
|
|
103
|
-
this._onFatalError = this._register(( new Emitter()));
|
|
104
|
+
this._onFatalError = this._register(( (new Emitter())));
|
|
104
105
|
this.onFatalError = this._onFatalError.event;
|
|
105
|
-
this._onDidDispose = this._register(( new Emitter()));
|
|
106
|
+
this._onDidDispose = this._register(( (new Emitter())));
|
|
106
107
|
this.onDidDispose = this._onDidDispose.event;
|
|
107
108
|
this._hasAlertedAboutMissingCsp = false;
|
|
108
|
-
this._hasFindResult = this._register(( new Emitter()));
|
|
109
|
+
this._hasFindResult = this._register(( (new Emitter())));
|
|
109
110
|
this.hasFindResult = this._hasFindResult.event;
|
|
110
|
-
this._onDidStopFind = this._register(( new Emitter()));
|
|
111
|
+
this._onDidStopFind = this._register(( (new Emitter())));
|
|
111
112
|
this.onDidStopFind = this._onDidStopFind.event;
|
|
112
113
|
this.providedViewType = initInfo.providedViewType;
|
|
113
114
|
this.origin = initInfo.origin ?? this.id;
|
|
@@ -119,11 +120,11 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
119
120
|
options: initInfo.contentOptions,
|
|
120
121
|
state: undefined
|
|
121
122
|
};
|
|
122
|
-
this._portMappingManager = this._register(( new WebviewPortMappingManager(
|
|
123
|
+
this._portMappingManager = this._register(( (new WebviewPortMappingManager(
|
|
123
124
|
() => this.extension?.location,
|
|
124
125
|
() => this._content.options.portMapping || [],
|
|
125
126
|
this._tunnelService
|
|
126
|
-
)));
|
|
127
|
+
))));
|
|
127
128
|
this._element = this._createElement(initInfo.options, initInfo.contentOptions);
|
|
128
129
|
this._register(this.on('no-csp-found', () => {
|
|
129
130
|
this.handleNoCspFound();
|
|
@@ -157,12 +158,7 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
157
158
|
this._hasFindResult.fire(didFind);
|
|
158
159
|
}));
|
|
159
160
|
this._register(this.on('fatal-error', (e) => {
|
|
160
|
-
notificationService.error(( localizeWithPath(
|
|
161
|
-
'vs/workbench/contrib/webview/browser/webviewElement',
|
|
162
|
-
'fatalErrorMessage',
|
|
163
|
-
"Error loading webview: {0}",
|
|
164
|
-
e.message
|
|
165
|
-
)));
|
|
161
|
+
notificationService.error(( localizeWithPath(_moduleId, 0, "Error loading webview: {0}", e.message)));
|
|
166
162
|
this._onFatalError.fire({ message: e.message });
|
|
167
163
|
}));
|
|
168
164
|
this._register(this.on('did-keydown', (data) => {
|
|
@@ -197,12 +193,12 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
197
193
|
this._register(this.on('load-resource', async (entry) => {
|
|
198
194
|
try {
|
|
199
195
|
const authority = decodeAuthority(entry.authority);
|
|
200
|
-
const uri = ( URI.from({
|
|
196
|
+
const uri = ( (URI.from({
|
|
201
197
|
scheme: entry.scheme,
|
|
202
198
|
authority: authority,
|
|
203
199
|
path: decodeURIComponent(entry.path),
|
|
204
200
|
query: entry.query ? decodeURIComponent(entry.query) : entry.query,
|
|
205
|
-
}));
|
|
201
|
+
})));
|
|
206
202
|
this.loadResource(entry.id, uri, entry.ifNoneMatch);
|
|
207
203
|
}
|
|
208
204
|
catch (e) {
|
|
@@ -303,13 +299,13 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
303
299
|
if (options.purpose) {
|
|
304
300
|
params.purpose = options.purpose;
|
|
305
301
|
}
|
|
306
|
-
params.serviceWorkerUri = ( ( FileAccess.asBrowserUri('vs/workbench/contrib/webview/browser/pre/service-worker.js')).toString(true));
|
|
307
|
-
params.fakeHtmlUri = ( ( FileAccess.asBrowserUri('vs/workbench/contrib/webview/browser/pre/fake.html')).toString(true));
|
|
302
|
+
params.serviceWorkerUri = ( (( (FileAccess.asBrowserUri('vs/workbench/contrib/webview/browser/pre/service-worker.js'))).toString(true)));
|
|
303
|
+
params.fakeHtmlUri = ( (( (FileAccess.asBrowserUri('vs/workbench/contrib/webview/browser/pre/fake.html'))).toString(true)));
|
|
308
304
|
COI.addSearchParam(params, true, true);
|
|
309
|
-
const queryString = ( ( new URLSearchParams(params)).toString());
|
|
305
|
+
const queryString = ( (( (new URLSearchParams(params))).toString()));
|
|
310
306
|
const fileName = isFirefox ? 'index-no-csp.html' : 'index.html';
|
|
311
|
-
const relativeIframeSrc = ( FileAccess.asBrowserUri(`vs/workbench/contrib/webview/browser/pre/${fileName}`));
|
|
312
|
-
this.element.setAttribute('src', `${( relativeIframeSrc.toString(true))}?${queryString}`);
|
|
307
|
+
const relativeIframeSrc = ( (FileAccess.asBrowserUri(`vs/workbench/contrib/webview/browser/pre/${fileName}`)));
|
|
308
|
+
this.element.setAttribute('src', `${( (relativeIframeSrc.toString(true)))}?${queryString}`);
|
|
313
309
|
}
|
|
314
310
|
mountTo(element, targetWindow) {
|
|
315
311
|
if (!this.element) {
|
|
@@ -380,7 +376,9 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
380
376
|
webviewContentEndpoint(encodedWebviewOrigin) {
|
|
381
377
|
const webviewExternalEndpoint = this._environmentService.webviewExternalEndpoint;
|
|
382
378
|
if (!webviewExternalEndpoint) {
|
|
383
|
-
throw new Error(
|
|
379
|
+
throw ( (new Error(
|
|
380
|
+
`'webviewExternalEndpoint' has not been configured. Webviews will not work!`
|
|
381
|
+
)));
|
|
384
382
|
}
|
|
385
383
|
const endpoint = webviewExternalEndpoint.replace('{{uuid}}', encodedWebviewOrigin);
|
|
386
384
|
if (endpoint[endpoint.length - 1] === '/') {
|
|
@@ -398,7 +396,7 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
398
396
|
on(channel, handler) {
|
|
399
397
|
let handlers = this._messageHandlers.get(channel);
|
|
400
398
|
if (!handlers) {
|
|
401
|
-
handlers = ( new Set());
|
|
399
|
+
handlers = ( (new Set()));
|
|
402
400
|
this._messageHandlers.set(channel, handlers);
|
|
403
401
|
}
|
|
404
402
|
handlers.add(handler);
|
|
@@ -492,7 +490,7 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
492
490
|
}
|
|
493
491
|
}
|
|
494
492
|
handleKeyEvent(type, event) {
|
|
495
|
-
const emulatedKeyboardEvent = ( new KeyboardEvent(type, event));
|
|
493
|
+
const emulatedKeyboardEvent = ( (new KeyboardEvent(type, event)));
|
|
496
494
|
Object.defineProperty(emulatedKeyboardEvent, 'target', {
|
|
497
495
|
get: () => this.element,
|
|
498
496
|
});
|
|
@@ -639,18 +637,18 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
639
637
|
this._webviewFindWidget?.find(previous);
|
|
640
638
|
}
|
|
641
639
|
};
|
|
642
|
-
WebviewElement = ( __decorate([
|
|
643
|
-
( __param(2, IConfigurationService)),
|
|
644
|
-
( __param(3, IContextMenuService)),
|
|
645
|
-
( __param(4, INotificationService)),
|
|
646
|
-
( __param(5, IWorkbenchEnvironmentService)),
|
|
647
|
-
( __param(6, IFileService)),
|
|
648
|
-
( __param(7, ILogService)),
|
|
649
|
-
( __param(8, IRemoteAuthorityResolverService)),
|
|
650
|
-
( __param(9, ITelemetryService)),
|
|
651
|
-
( __param(10, ITunnelService)),
|
|
652
|
-
( __param(11, IInstantiationService)),
|
|
653
|
-
( __param(12, IAccessibilityService))
|
|
654
|
-
], WebviewElement));
|
|
640
|
+
WebviewElement = ( (__decorate([
|
|
641
|
+
( (__param(2, IConfigurationService))),
|
|
642
|
+
( (__param(3, IContextMenuService))),
|
|
643
|
+
( (__param(4, INotificationService))),
|
|
644
|
+
( (__param(5, IWorkbenchEnvironmentService))),
|
|
645
|
+
( (__param(6, IFileService))),
|
|
646
|
+
( (__param(7, ILogService))),
|
|
647
|
+
( (__param(8, IRemoteAuthorityResolverService))),
|
|
648
|
+
( (__param(9, ITelemetryService))),
|
|
649
|
+
( (__param(10, ITunnelService))),
|
|
650
|
+
( (__param(11, IInstantiationService))),
|
|
651
|
+
( (__param(12, IAccessibilityService)))
|
|
652
|
+
], WebviewElement)));
|
|
655
653
|
|
|
656
654
|
export { WebviewElement };
|
|
@@ -9,23 +9,23 @@ import { WebviewEditor } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/b
|
|
|
9
9
|
import { WebviewInput } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
|
|
10
10
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const _moduleId = "vs/workbench/contrib/webviewPanel/browser/webviewCommands";
|
|
13
|
+
const webviewActiveContextKeyExpr = ( (ContextKeyExpr.and(
|
|
14
|
+
(ContextKeyExpr.equals('activeEditor', WebviewEditor.ID)),
|
|
15
|
+
(EditorContextKeys.focus.toNegated())
|
|
16
|
+
)));
|
|
13
17
|
class ShowWebViewEditorFindWidgetAction extends Action2 {
|
|
14
18
|
static { this.ID = 'editor.action.webvieweditor.showFind'; }
|
|
15
|
-
static { this.LABEL = ( localizeWithPath(
|
|
16
|
-
'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
|
|
17
|
-
'editor.action.webvieweditor.showFind',
|
|
18
|
-
"Show find"
|
|
19
|
-
)); }
|
|
19
|
+
static { this.LABEL = ( localizeWithPath(_moduleId, 0, "Show find")); }
|
|
20
20
|
constructor() {
|
|
21
21
|
super({
|
|
22
22
|
id: ShowWebViewEditorFindWidgetAction.ID,
|
|
23
23
|
title: ShowWebViewEditorFindWidgetAction.LABEL,
|
|
24
24
|
keybinding: {
|
|
25
|
-
when: ( ContextKeyExpr.and(
|
|
25
|
+
when: ( (ContextKeyExpr.and(
|
|
26
26
|
webviewActiveContextKeyExpr,
|
|
27
27
|
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_ENABLED
|
|
28
|
-
)),
|
|
28
|
+
))),
|
|
29
29
|
primary: 2048 | 36 ,
|
|
30
30
|
weight: 100
|
|
31
31
|
}
|
|
@@ -37,20 +37,16 @@ class ShowWebViewEditorFindWidgetAction extends Action2 {
|
|
|
37
37
|
}
|
|
38
38
|
class HideWebViewEditorFindCommand extends Action2 {
|
|
39
39
|
static { this.ID = 'editor.action.webvieweditor.hideFind'; }
|
|
40
|
-
static { this.LABEL = ( localizeWithPath(
|
|
41
|
-
'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
|
|
42
|
-
'editor.action.webvieweditor.hideFind',
|
|
43
|
-
"Stop find"
|
|
44
|
-
)); }
|
|
40
|
+
static { this.LABEL = ( localizeWithPath(_moduleId, 1, "Stop find")); }
|
|
45
41
|
constructor() {
|
|
46
42
|
super({
|
|
47
43
|
id: HideWebViewEditorFindCommand.ID,
|
|
48
44
|
title: HideWebViewEditorFindCommand.LABEL,
|
|
49
45
|
keybinding: {
|
|
50
|
-
when: ( ContextKeyExpr.and(
|
|
46
|
+
when: ( (ContextKeyExpr.and(
|
|
51
47
|
webviewActiveContextKeyExpr,
|
|
52
48
|
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE
|
|
53
|
-
)),
|
|
49
|
+
))),
|
|
54
50
|
primary: 9 ,
|
|
55
51
|
weight: 100
|
|
56
52
|
}
|
|
@@ -62,20 +58,16 @@ class HideWebViewEditorFindCommand extends Action2 {
|
|
|
62
58
|
}
|
|
63
59
|
class WebViewEditorFindNextCommand extends Action2 {
|
|
64
60
|
static { this.ID = 'editor.action.webvieweditor.findNext'; }
|
|
65
|
-
static { this.LABEL = ( localizeWithPath(
|
|
66
|
-
'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
|
|
67
|
-
'editor.action.webvieweditor.findNext',
|
|
68
|
-
'Find next'
|
|
69
|
-
)); }
|
|
61
|
+
static { this.LABEL = ( localizeWithPath(_moduleId, 2, 'Find next')); }
|
|
70
62
|
constructor() {
|
|
71
63
|
super({
|
|
72
64
|
id: WebViewEditorFindNextCommand.ID,
|
|
73
65
|
title: WebViewEditorFindNextCommand.LABEL,
|
|
74
66
|
keybinding: {
|
|
75
|
-
when: ( ContextKeyExpr.and(
|
|
67
|
+
when: ( (ContextKeyExpr.and(
|
|
76
68
|
webviewActiveContextKeyExpr,
|
|
77
69
|
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED
|
|
78
|
-
)),
|
|
70
|
+
))),
|
|
79
71
|
primary: 3 ,
|
|
80
72
|
weight: 100
|
|
81
73
|
}
|
|
@@ -87,20 +79,16 @@ class WebViewEditorFindNextCommand extends Action2 {
|
|
|
87
79
|
}
|
|
88
80
|
class WebViewEditorFindPreviousCommand extends Action2 {
|
|
89
81
|
static { this.ID = 'editor.action.webvieweditor.findPrevious'; }
|
|
90
|
-
static { this.LABEL = ( localizeWithPath(
|
|
91
|
-
'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
|
|
92
|
-
'editor.action.webvieweditor.findPrevious',
|
|
93
|
-
'Find previous'
|
|
94
|
-
)); }
|
|
82
|
+
static { this.LABEL = ( localizeWithPath(_moduleId, 3, 'Find previous')); }
|
|
95
83
|
constructor() {
|
|
96
84
|
super({
|
|
97
85
|
id: WebViewEditorFindPreviousCommand.ID,
|
|
98
86
|
title: WebViewEditorFindPreviousCommand.LABEL,
|
|
99
87
|
keybinding: {
|
|
100
|
-
when: ( ContextKeyExpr.and(
|
|
88
|
+
when: ( (ContextKeyExpr.and(
|
|
101
89
|
webviewActiveContextKeyExpr,
|
|
102
90
|
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED
|
|
103
|
-
)),
|
|
91
|
+
))),
|
|
104
92
|
primary: 1024 | 3 ,
|
|
105
93
|
weight: 100
|
|
106
94
|
}
|
|
@@ -112,11 +100,7 @@ class WebViewEditorFindPreviousCommand extends Action2 {
|
|
|
112
100
|
}
|
|
113
101
|
class ReloadWebviewAction extends Action2 {
|
|
114
102
|
static { this.ID = 'workbench.action.webview.reloadWebviewAction'; }
|
|
115
|
-
static { this.LABEL = ( localize2WithPath(
|
|
116
|
-
'vs/workbench/contrib/webviewPanel/browser/webviewCommands',
|
|
117
|
-
'refreshWebviewLabel',
|
|
118
|
-
"Reload Webviews"
|
|
119
|
-
)); }
|
|
103
|
+
static { this.LABEL = ( localize2WithPath(_moduleId, 4, "Reload Webviews")); }
|
|
120
104
|
constructor() {
|
|
121
105
|
super({
|
|
122
106
|
id: ReloadWebviewAction.ID,
|
|
@@ -16,11 +16,8 @@ import 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbench
|
|
|
16
16
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
17
17
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'webview.editor.label',
|
|
22
|
-
"webview editor"
|
|
23
|
-
))), [( new SyncDescriptor(WebviewInput))]);
|
|
19
|
+
const _moduleId = "vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution";
|
|
20
|
+
(( (Registry.as(EditorExtensions.EditorPane)))).registerEditorPane(EditorPaneDescriptor.create(WebviewEditor, WebviewEditor.ID, ( localizeWithPath(_moduleId, 0, "webview editor"))), [( (new SyncDescriptor(WebviewInput)))]);
|
|
24
21
|
let WebviewPanelContribution = class WebviewPanelContribution extends Disposable {
|
|
25
22
|
static { this.ID = 'workbench.contrib.webviewPanel'; }
|
|
26
23
|
constructor(editorService, editorGroupService) {
|
|
@@ -54,12 +51,12 @@ let WebviewPanelContribution = class WebviewPanelContribution extends Disposable
|
|
|
54
51
|
previousGroup.closeEditor(editor);
|
|
55
52
|
}
|
|
56
53
|
};
|
|
57
|
-
WebviewPanelContribution = ( __decorate([
|
|
58
|
-
( __param(0, IEditorService)),
|
|
59
|
-
( __param(1, IEditorGroupsService))
|
|
60
|
-
], WebviewPanelContribution));
|
|
54
|
+
WebviewPanelContribution = ( (__decorate([
|
|
55
|
+
( (__param(0, IEditorService))),
|
|
56
|
+
( (__param(1, IEditorGroupsService)))
|
|
57
|
+
], WebviewPanelContribution)));
|
|
61
58
|
registerWorkbenchContribution2(WebviewPanelContribution.ID, WebviewPanelContribution, 1 );
|
|
62
|
-
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(WebviewEditorInputSerializer.ID, WebviewEditorInputSerializer);
|
|
59
|
+
( (Registry.as(EditorExtensions.EditorFactory))).registerEditorSerializer(WebviewEditorInputSerializer.ID, WebviewEditorInputSerializer);
|
|
63
60
|
registerAction2(ShowWebViewEditorFindWidgetAction);
|
|
64
61
|
registerAction2(HideWebViewEditorFindCommand);
|
|
65
62
|
registerAction2(WebViewEditorFindNextCommand);
|
|
@@ -13,7 +13,7 @@ class WebviewViewService extends Disposable {
|
|
|
13
13
|
}
|
|
14
14
|
register(viewType, resolver) {
|
|
15
15
|
if (( this._resolvers.has(viewType))) {
|
|
16
|
-
throw new Error(`View resolver already registered for ${viewType}`);
|
|
16
|
+
throw ( new Error(`View resolver already registered for ${viewType}`));
|
|
17
17
|
}
|
|
18
18
|
this._resolvers.set(viewType, resolver);
|
|
19
19
|
this._onNewResolverRegistered.fire({ viewType: viewType });
|
|
@@ -32,7 +32,7 @@ class WebviewViewService extends Disposable {
|
|
|
32
32
|
const resolver = this._resolvers.get(viewType);
|
|
33
33
|
if (!resolver) {
|
|
34
34
|
if (( this._awaitingRevival.has(viewType))) {
|
|
35
|
-
throw new Error('View already awaiting revival');
|
|
35
|
+
throw ( new Error('View already awaiting revival'));
|
|
36
36
|
}
|
|
37
37
|
const { promise, resolve } = promiseWithResolvers();
|
|
38
38
|
this._awaitingRevival.set(viewType, { webview, resolve });
|
|
@@ -20,21 +20,22 @@ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/service
|
|
|
20
20
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
21
21
|
|
|
22
22
|
var BrowserAuxiliaryWindowService_1;
|
|
23
|
+
const _moduleId = "vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService";
|
|
23
24
|
let AuxiliaryWindow = class AuxiliaryWindow extends BaseWindow {
|
|
24
25
|
constructor(window, container, stylesHaveLoaded, configurationService, hostService, environmentService) {
|
|
25
26
|
super(window, undefined, hostService, environmentService);
|
|
26
27
|
this.window = window;
|
|
27
28
|
this.container = container;
|
|
28
29
|
this.configurationService = configurationService;
|
|
29
|
-
this._onWillLayout = this._register(( new Emitter()));
|
|
30
|
+
this._onWillLayout = this._register(( (new Emitter())));
|
|
30
31
|
this.onWillLayout = this._onWillLayout.event;
|
|
31
|
-
this._onDidLayout = this._register(( new Emitter()));
|
|
32
|
+
this._onDidLayout = this._register(( (new Emitter())));
|
|
32
33
|
this.onDidLayout = this._onDidLayout.event;
|
|
33
|
-
this._onBeforeUnload = this._register(( new Emitter()));
|
|
34
|
+
this._onBeforeUnload = this._register(( (new Emitter())));
|
|
34
35
|
this.onBeforeUnload = this._onBeforeUnload.event;
|
|
35
|
-
this._onUnload = this._register(( new Emitter()));
|
|
36
|
+
this._onUnload = this._register(( (new Emitter())));
|
|
36
37
|
this.onUnload = this._onUnload.event;
|
|
37
|
-
this._onWillDispose = this._register(( new Emitter()));
|
|
38
|
+
this._onWillDispose = this._register(( (new Emitter())));
|
|
38
39
|
this.onWillDispose = this._onWillDispose.event;
|
|
39
40
|
this.whenStylesHaveLoaded = stylesHaveLoaded.wait().then(() => undefined);
|
|
40
41
|
this.registerListeners();
|
|
@@ -83,8 +84,8 @@ let AuxiliaryWindow = class AuxiliaryWindow extends BaseWindow {
|
|
|
83
84
|
preventUnload(e) {
|
|
84
85
|
e.preventDefault();
|
|
85
86
|
e.returnValue = ( localizeWithPath(
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
_moduleId,
|
|
88
|
+
0,
|
|
88
89
|
"Changes that you made may not be saved. Please check press 'Cancel' and try again."
|
|
89
90
|
));
|
|
90
91
|
}
|
|
@@ -107,11 +108,11 @@ let AuxiliaryWindow = class AuxiliaryWindow extends BaseWindow {
|
|
|
107
108
|
super.dispose();
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
|
-
AuxiliaryWindow = ( __decorate([
|
|
111
|
-
( __param(3, IConfigurationService)),
|
|
112
|
-
( __param(4, IHostService)),
|
|
113
|
-
( __param(5, IWorkbenchEnvironmentService))
|
|
114
|
-
], AuxiliaryWindow));
|
|
111
|
+
AuxiliaryWindow = ( (__decorate([
|
|
112
|
+
( (__param(3, IConfigurationService))),
|
|
113
|
+
( (__param(4, IHostService))),
|
|
114
|
+
( (__param(5, IWorkbenchEnvironmentService)))
|
|
115
|
+
], AuxiliaryWindow)));
|
|
115
116
|
let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends Disposable {
|
|
116
117
|
static { BrowserAuxiliaryWindowService_1 = this; }
|
|
117
118
|
static { this.DEFAULT_SIZE = { width: 800, height: 600 }; }
|
|
@@ -124,25 +125,25 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
124
125
|
this.telemetryService = telemetryService;
|
|
125
126
|
this.hostService = hostService;
|
|
126
127
|
this.environmentService = environmentService;
|
|
127
|
-
this._onDidOpenAuxiliaryWindow = this._register(( new Emitter()));
|
|
128
|
+
this._onDidOpenAuxiliaryWindow = this._register(( (new Emitter())));
|
|
128
129
|
this.onDidOpenAuxiliaryWindow = this._onDidOpenAuxiliaryWindow.event;
|
|
129
|
-
this.windows = ( new Map());
|
|
130
|
+
this.windows = ( (new Map()));
|
|
130
131
|
}
|
|
131
132
|
async open(options) {
|
|
132
133
|
mark('code/auxiliaryWindow/willOpen');
|
|
133
134
|
const targetWindow = await this.openWindow(options);
|
|
134
135
|
if (!targetWindow) {
|
|
135
|
-
throw new Error(localizeWithPath(
|
|
136
|
+
throw ( (new Error(localizeWithPath(_moduleId, 1, "Unable to open a new window."))));
|
|
136
137
|
}
|
|
137
138
|
const resolvedWindowId = await this.resolveWindowId(targetWindow);
|
|
138
139
|
ensureCodeWindow(targetWindow, resolvedWindowId);
|
|
139
|
-
const containerDisposables = ( new DisposableStore());
|
|
140
|
+
const containerDisposables = ( (new DisposableStore()));
|
|
140
141
|
const { container, stylesLoaded } = this.createContainer(targetWindow, containerDisposables, options);
|
|
141
142
|
const auxiliaryWindow = this.createAuxiliaryWindow(targetWindow, container, stylesLoaded);
|
|
142
|
-
const registryDisposables = ( new DisposableStore());
|
|
143
|
+
const registryDisposables = ( (new DisposableStore()));
|
|
143
144
|
this.windows.set(targetWindow.vscodeWindowId, auxiliaryWindow);
|
|
144
145
|
registryDisposables.add(toDisposable(() => this.windows.delete(targetWindow.vscodeWindowId)));
|
|
145
|
-
const eventDisposables = ( new DisposableStore());
|
|
146
|
+
const eventDisposables = ( (new DisposableStore()));
|
|
146
147
|
Event.once(auxiliaryWindow.onWillDispose)(() => {
|
|
147
148
|
targetWindow.close();
|
|
148
149
|
containerDisposables.dispose();
|
|
@@ -156,14 +157,16 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
156
157
|
return auxiliaryWindow;
|
|
157
158
|
}
|
|
158
159
|
createAuxiliaryWindow(targetWindow, container, stylesLoaded) {
|
|
159
|
-
return (
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
return (
|
|
161
|
+
(new AuxiliaryWindow(
|
|
162
|
+
targetWindow,
|
|
163
|
+
container,
|
|
164
|
+
stylesLoaded,
|
|
165
|
+
this.configurationService,
|
|
166
|
+
this.hostService,
|
|
167
|
+
this.environmentService
|
|
168
|
+
))
|
|
169
|
+
);
|
|
167
170
|
}
|
|
168
171
|
async openWindow(options) {
|
|
169
172
|
const activeWindow = getActiveWindow();
|
|
@@ -193,22 +196,18 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
193
196
|
return (await this.dialogService.prompt({
|
|
194
197
|
type: Severity$1.Warning,
|
|
195
198
|
message: ( localizeWithPath(
|
|
196
|
-
|
|
197
|
-
|
|
199
|
+
_moduleId,
|
|
200
|
+
2,
|
|
198
201
|
"The browser interrupted the opening of a new window. Press 'Retry' to try again."
|
|
199
202
|
)),
|
|
200
203
|
detail: ( localizeWithPath(
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
_moduleId,
|
|
205
|
+
3,
|
|
203
206
|
"To avoid this problem in the future, please ensure to allow popups for this website."
|
|
204
207
|
)),
|
|
205
208
|
buttons: [
|
|
206
209
|
{
|
|
207
|
-
label: ( localizeWithPath(
|
|
208
|
-
'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService',
|
|
209
|
-
{ key: 'retry', comment: ['&& denotes a mnemonic'] },
|
|
210
|
-
"&&Retry"
|
|
211
|
-
)),
|
|
210
|
+
label: ( localizeWithPath(_moduleId, 4, "&&Retry")),
|
|
212
211
|
run: () => this.openWindow(options)
|
|
213
212
|
}
|
|
214
213
|
],
|
|
@@ -248,10 +247,10 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
248
247
|
}
|
|
249
248
|
applyCSS(auxiliaryWindow, disposables) {
|
|
250
249
|
mark('code/auxiliaryWindow/willApplyCSS');
|
|
251
|
-
const mapOriginalToClone = ( new Map());
|
|
252
|
-
const stylesLoaded = ( new Barrier());
|
|
250
|
+
const mapOriginalToClone = ( (new Map()));
|
|
251
|
+
const stylesLoaded = ( (new Barrier()));
|
|
253
252
|
stylesLoaded.wait().then(() => mark('code/auxiliaryWindow/didLoadCSSStyles'));
|
|
254
|
-
const pendingLinksDisposables = disposables.add(( new DisposableStore()));
|
|
253
|
+
const pendingLinksDisposables = disposables.add(( (new DisposableStore())));
|
|
255
254
|
let pendingLinksToSettle = 0;
|
|
256
255
|
function onLinkSettled() {
|
|
257
256
|
if (--pendingLinksToSettle === 0) {
|
|
@@ -329,13 +328,13 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
329
328
|
return container;
|
|
330
329
|
}
|
|
331
330
|
};
|
|
332
|
-
BrowserAuxiliaryWindowService = BrowserAuxiliaryWindowService_1 = ( __decorate([
|
|
333
|
-
( __param(0, IWorkbenchLayoutService)),
|
|
334
|
-
( __param(1, IDialogService)),
|
|
335
|
-
( __param(2, IConfigurationService)),
|
|
336
|
-
( __param(3, ITelemetryService)),
|
|
337
|
-
( __param(4, IHostService)),
|
|
338
|
-
( __param(5, IWorkbenchEnvironmentService))
|
|
339
|
-
], BrowserAuxiliaryWindowService));
|
|
331
|
+
BrowserAuxiliaryWindowService = BrowserAuxiliaryWindowService_1 = ( (__decorate([
|
|
332
|
+
( (__param(0, IWorkbenchLayoutService))),
|
|
333
|
+
( (__param(1, IDialogService))),
|
|
334
|
+
( (__param(2, IConfigurationService))),
|
|
335
|
+
( (__param(3, ITelemetryService))),
|
|
336
|
+
( (__param(4, IHostService))),
|
|
337
|
+
( (__param(5, IWorkbenchEnvironmentService)))
|
|
338
|
+
], BrowserAuxiliaryWindowService)));
|
|
340
339
|
|
|
341
340
|
export { AuxiliaryWindow, BrowserAuxiliaryWindowService };
|
|
@@ -51,7 +51,9 @@ let BrowserWindowDriver = class BrowserWindowDriver {
|
|
|
51
51
|
chain.unshift(`${tagName}${id}${classes}`);
|
|
52
52
|
el = el.parentElement;
|
|
53
53
|
}
|
|
54
|
-
throw new Error(
|
|
54
|
+
throw ( new Error(
|
|
55
|
+
`Active element not found. Current active element is '${chain.join(' > ')}'. Looking for ${selector}`
|
|
56
|
+
));
|
|
55
57
|
}
|
|
56
58
|
return true;
|
|
57
59
|
}
|
|
@@ -99,7 +101,7 @@ let BrowserWindowDriver = class BrowserWindowDriver {
|
|
|
99
101
|
async typeInEditor(selector, text) {
|
|
100
102
|
const element = mainWindow.document.querySelector(selector);
|
|
101
103
|
if (!element) {
|
|
102
|
-
throw new Error(`Editor not found: ${selector}`);
|
|
104
|
+
throw ( new Error(`Editor not found: ${selector}`));
|
|
103
105
|
}
|
|
104
106
|
const textarea = element;
|
|
105
107
|
const start = textarea.selectionStart;
|
|
@@ -114,11 +116,11 @@ let BrowserWindowDriver = class BrowserWindowDriver {
|
|
|
114
116
|
async getTerminalBuffer(selector) {
|
|
115
117
|
const element = mainWindow.document.querySelector(selector);
|
|
116
118
|
if (!element) {
|
|
117
|
-
throw new Error(`Terminal not found: ${selector}`);
|
|
119
|
+
throw ( new Error(`Terminal not found: ${selector}`));
|
|
118
120
|
}
|
|
119
121
|
const xterm = element.xterm;
|
|
120
122
|
if (!xterm) {
|
|
121
|
-
throw new Error(`Xterm not found: ${selector}`);
|
|
123
|
+
throw ( new Error(`Xterm not found: ${selector}`));
|
|
122
124
|
}
|
|
123
125
|
const lines = [];
|
|
124
126
|
for (let i = 0; i < xterm.buffer.active.length; i++) {
|
|
@@ -129,11 +131,11 @@ let BrowserWindowDriver = class BrowserWindowDriver {
|
|
|
129
131
|
async writeInTerminal(selector, text) {
|
|
130
132
|
const element = mainWindow.document.querySelector(selector);
|
|
131
133
|
if (!element) {
|
|
132
|
-
throw new Error(`Element not found: ${selector}`);
|
|
134
|
+
throw ( new Error(`Element not found: ${selector}`));
|
|
133
135
|
}
|
|
134
136
|
const xterm = element.xterm;
|
|
135
137
|
if (!xterm) {
|
|
136
|
-
throw new Error(`Xterm not found: ${selector}`);
|
|
138
|
+
throw ( new Error(`Xterm not found: ${selector}`));
|
|
137
139
|
}
|
|
138
140
|
xterm._core.coreService.triggerDataEvent(text);
|
|
139
141
|
}
|