Add proposed webview view API (#104601)

Add proposed webview view API

For #46585

This adds a new `WebviewView` proposed api to VS Code that lets webview be used inside views. Webview views can be contributed using a contribution point such as :

```json
    "views": {
      "explorer": [
        {
          "type": "webview",
          "id": "cats.cat",
          "name": "Cats",
          "visibility": "visible"
        }
      ]
    },
```

* Use proper activation event

* Transparent background

* Fix resize observer

* Adding documentation

* Move webview view to new directory under workbench

* Remove resolver

By moving the webviews view into their own fodler, I was able to avoid the cycle the resolver was originally introduced for

* Use enum in more places

* Hook up title and visible properties for webview views

* Remove test view

* Prefer Thenable

* Add unknown view type error to collector
This commit is contained in:
Matt Bierner
2020-08-20 13:59:22 -07:00
committed by GitHub
parent 038e1a93b9
commit 61f799f53b
12 changed files with 674 additions and 16 deletions

View File

@@ -612,6 +612,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
},
onDidChangeActiveColorTheme(listener, thisArg?, disposables?) {
return extHostTheming.onDidChangeActiveColorTheme(listener, thisArg, disposables);
},
registerWebviewViewProvider(viewId: string, provider: vscode.WebviewViewProvider, options?: {
webviewOptions?: {
retainContextWhenHidden?: boolean
}
}) {
checkProposedApiEnabled(extension);
return extHostWebviews.registerWebviewViewProvider(extension, viewId, provider, options?.webviewOptions);
}
};