|
6 | 6 | import { Dimension } from 'vs/base/browser/dom'; |
7 | 7 | import { FastDomNode } from 'vs/base/browser/fastDomNode'; |
8 | 8 | import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; |
9 | | -import { Emitter, Event } from 'vs/base/common/event'; |
| 9 | +import { Emitter } from 'vs/base/common/event'; |
10 | 10 | import { Disposable, DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle'; |
11 | 11 | import { URI } from 'vs/base/common/uri'; |
12 | 12 | import { generateUuid } from 'vs/base/common/uuid'; |
13 | 13 | import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; |
14 | 14 | import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; |
15 | 15 | import { ILayoutService } from 'vs/platform/layout/browser/layoutService'; |
16 | | -import { IWebviewService, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_ENABLED, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE, IWebview, WebviewContentOptions, IWebviewElement, WebviewExtensionDescription, WebviewMessageReceivedEvent, WebviewOptions, IOverlayWebview, WebviewInitInfo } from 'vs/workbench/contrib/webview/browser/webview'; |
| 16 | +import { IOverlayWebview, IWebview, IWebviewElement, IWebviewService, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_ENABLED, KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE, WebviewContentOptions, WebviewExtensionDescription, WebviewInitInfo, WebviewMessageReceivedEvent, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview'; |
17 | 17 |
|
18 | 18 | /** |
19 | 19 | * Webview that is absolutely positioned over another element and that can creates and destroys an underlying webview as needed. |
20 | 20 | */ |
21 | 21 | export class OverlayWebview extends Disposable implements IOverlayWebview { |
22 | 22 |
|
23 | | - private readonly _onDidWheel = this._register(new Emitter<IMouseWheelEvent>()); |
24 | | - public readonly onDidWheel = this._onDidWheel.event; |
25 | | - |
26 | 23 | private _isFirstLoad = true; |
27 | 24 | private readonly _firstLoadPendingMessages = new Set<{ readonly message: any; readonly transfer?: readonly ArrayBuffer[]; readonly resolve: (value: boolean) => void }>(); |
28 | 25 | private readonly _webview = this._register(new MutableDisposable<IWebviewElement>()); |
@@ -91,10 +88,9 @@ export class OverlayWebview extends Disposable implements IOverlayWebview { |
91 | 88 | super.dispose(); |
92 | 89 | } |
93 | 90 |
|
94 | | - |
95 | 91 | public get container(): HTMLElement { |
96 | 92 | if (this._isDisposed) { |
97 | | - throw new Error(`DynamicWebviewEditorOverlay has been disposed`); |
| 93 | + throw new Error(`OverlayWebview has been disposed`); |
98 | 94 | } |
99 | 95 |
|
100 | 96 | if (!this._container) { |
@@ -186,7 +182,7 @@ export class OverlayWebview extends Disposable implements IOverlayWebview { |
186 | 182 |
|
187 | 183 | private _show() { |
188 | 184 | if (this._isDisposed) { |
189 | | - throw new Error('Webview overlay is disposed'); |
| 185 | + throw new Error('OverlayWebview is disposed'); |
190 | 186 | } |
191 | 187 |
|
192 | 188 | if (!this._webview.value) { |
@@ -294,28 +290,31 @@ export class OverlayWebview extends Disposable implements IOverlayWebview { |
294 | 290 | } |
295 | 291 |
|
296 | 292 | private readonly _onDidFocus = this._register(new Emitter<void>()); |
297 | | - public readonly onDidFocus: Event<void> = this._onDidFocus.event; |
| 293 | + public readonly onDidFocus = this._onDidFocus.event; |
298 | 294 |
|
299 | 295 | private readonly _onDidBlur = this._register(new Emitter<void>()); |
300 | | - public readonly onDidBlur: Event<void> = this._onDidBlur.event; |
| 296 | + public readonly onDidBlur = this._onDidBlur.event; |
301 | 297 |
|
302 | 298 | private readonly _onDidClickLink = this._register(new Emitter<string>()); |
303 | | - public readonly onDidClickLink: Event<string> = this._onDidClickLink.event; |
| 299 | + public readonly onDidClickLink = this._onDidClickLink.event; |
304 | 300 |
|
305 | 301 | private readonly _onDidReload = this._register(new Emitter<void>()); |
306 | 302 | public readonly onDidReload = this._onDidReload.event; |
307 | 303 |
|
308 | | - private readonly _onDidScroll = this._register(new Emitter<{ scrollYPercentage: number }>()); |
309 | | - public readonly onDidScroll: Event<{ scrollYPercentage: number }> = this._onDidScroll.event; |
| 304 | + private readonly _onDidScroll = this._register(new Emitter<{ readonly scrollYPercentage: number }>()); |
| 305 | + public readonly onDidScroll = this._onDidScroll.event; |
310 | 306 |
|
311 | 307 | private readonly _onDidUpdateState = this._register(new Emitter<string | undefined>()); |
312 | | - public readonly onDidUpdateState: Event<string | undefined> = this._onDidUpdateState.event; |
| 308 | + public readonly onDidUpdateState = this._onDidUpdateState.event; |
313 | 309 |
|
314 | 310 | private readonly _onMessage = this._register(new Emitter<WebviewMessageReceivedEvent>()); |
315 | 311 | public readonly onMessage = this._onMessage.event; |
316 | 312 |
|
317 | 313 | private readonly _onMissingCsp = this._register(new Emitter<ExtensionIdentifier>()); |
318 | | - public readonly onMissingCsp: Event<any> = this._onMissingCsp.event; |
| 314 | + public readonly onMissingCsp = this._onMissingCsp.event; |
| 315 | + |
| 316 | + private readonly _onDidWheel = this._register(new Emitter<IMouseWheelEvent>()); |
| 317 | + public readonly onDidWheel = this._onDidWheel.event; |
319 | 318 |
|
320 | 319 | public async postMessage(message: any, transfer?: readonly ArrayBuffer[]): Promise<boolean> { |
321 | 320 | if (this._webview.value) { |
|
0 commit comments