(webView: vscode.Webview, extensionPath: string, fileUriFsPath: string)
| 4 | import * as vscode from 'vscode'; |
| 5 | |
| 6 | export function getWebviewContent(webView: vscode.Webview, extensionPath: string, fileUriFsPath: string) { |
| 7 | |
| 8 | function resourceUrl(resource: string) { |
| 9 | // Get path to resource on disk |
| 10 | const onDiskPath = vscode.Uri.file(path.join(extensionPath, 'resources', resource)); |
| 11 | |
| 12 | // And get the special URI to use with the webview |
| 13 | return webView.asWebviewUri(onDiskPath); |
| 14 | } |
| 15 | |
| 16 | return `<!DOCTYPE html> |
| 17 | <html lang="en"> |
| 18 | <head> |
| 19 | <meta charset="UTF-8"> |
| 20 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 21 | <title>SandDance</title> |
| 22 | ${link(resourceUrl('app.css'))} |
| 23 | </head> |
| 24 | <body> |
| 25 | <div id="app"></div> |
| 26 | ${script(resourceUrl('dist.min.js'))} |
| 27 | ${script(resourceUrl('vega.js'))} |
| 28 | ${script(resourceUrl('react.production.min.js'))} |
| 29 | ${script(resourceUrl('react-dom.production.min.js'))} |
| 30 | ${script(resourceUrl('fluentui-react.js'))} |
| 31 | ${script(resourceUrl('sanddance-explorer.js'))} |
| 32 | ${script(resourceUrl('app.js'))} |
| 33 | </body> |
| 34 | </html>`; |
| 35 | } |
| 36 | |
| 37 | function link(href: vscode.Uri) { |
| 38 | return `<link rel="stylesheet" type="text/css" href="${href}" />`; |
no test coverage detected