File tree Expand file tree Collapse file tree 6 files changed +16
-47
lines changed Expand file tree Collapse file tree 6 files changed +16
-47
lines changed Original file line number Diff line number Diff line change 1
1
2
+ const WebToolkit = require ( `@vscode/webview-ui-toolkit/dist/toolkit.min.js` ) ;
3
+
2
4
const vscode = require ( `vscode` ) ;
3
5
const Tools = require ( `../tools` ) ;
4
6
@@ -45,14 +47,6 @@ module.exports = class ViewPanel {
45
47
}
46
48
47
49
async _getContent ( ) {
48
- const toolkitUri = Tools . getUri ( this . panel . webview , this . extensionUri , [
49
- `node_modules` ,
50
- `@vscode` ,
51
- `webview-ui-toolkit` ,
52
- `dist` ,
53
- `toolkit.js` ,
54
- ] ) ;
55
-
56
50
const proc = new Procedure ( this . schema , this . procedure )
57
51
58
52
Tools . setLoadingText ( this . panel . webview , `Fetching base info` ) ;
@@ -75,7 +69,7 @@ module.exports = class ViewPanel {
75
69
<head>
76
70
<meta charset="UTF-8">
77
71
<meta name="viewport" content="width=device-width, initial-scale=1.0">
78
- <script type="module" src=" ${ toolkitUri } "> </script>
72
+ <script type="module"> ${ WebToolkit } </script>
79
73
<style type="text/css">
80
74
.component {
81
75
margin-bottom: 0.5rem;
Original file line number Diff line number Diff line change 1
1
2
+ const WebToolkit = require ( `@vscode/webview-ui-toolkit/dist/toolkit.min.js` ) ;
3
+
2
4
const vscode = require ( `vscode` ) ;
3
5
const Tools = require ( `../tools` ) ;
4
6
@@ -38,14 +40,6 @@ module.exports = class TablePanel {
38
40
}
39
41
40
42
async _getContent ( ) {
41
- const toolkitUri = Tools . getUri ( this . panel . webview , this . extensionUri , [
42
- `node_modules` ,
43
- `@vscode` ,
44
- `webview-ui-toolkit` ,
45
- `dist` ,
46
- `toolkit.js` ,
47
- ] ) ;
48
-
49
43
const table = new Table ( this . schema , this . table ) ;
50
44
51
45
// TODO: each await should also send an update to the frontend loading screen (below)
@@ -105,7 +99,7 @@ module.exports = class TablePanel {
105
99
<head>
106
100
<meta charset="UTF-8">
107
101
<meta name="viewport" content="width=device-width, initial-scale=1.0">
108
- <script type="module" src=" ${ toolkitUri } "> </script>
102
+ <script type="module"> ${ WebToolkit } </script>
109
103
<style type="text/css">
110
104
.component {
111
105
margin-bottom: 0.5rem;
Original file line number Diff line number Diff line change 1
1
2
2
const vscode = require ( `vscode` ) ;
3
3
4
+ const WebToolkit = require ( `@vscode/webview-ui-toolkit/dist/toolkit.min.js` ) ;
5
+
4
6
module . exports = class {
5
7
/**
6
8
* @param {vscode.Webview } webview
@@ -19,21 +21,13 @@ module.exports = class {
19
21
}
20
22
21
23
static getLoadingHTML ( webview , extensionUri ) {
22
- const toolkitUri = this . getUri ( webview , extensionUri , [
23
- `node_modules` ,
24
- `@vscode` ,
25
- `webview-ui-toolkit` ,
26
- `dist` ,
27
- `toolkit.js` ,
28
- ] ) ;
29
-
30
24
return /*html*/ `
31
25
<!DOCTYPE html>
32
26
<html lang="en">
33
27
<head>
34
28
<meta charset="UTF-8">
35
29
<meta name="viewport" content="width=device-width, initial-scale=1.0">
36
- <script type="module" src=" ${ toolkitUri } "> </script>
30
+ <script type="module"> ${ WebToolkit } </script>
37
31
<script>
38
32
window.addEventListener("message", (event) => {
39
33
const command = event.data.command;
Original file line number Diff line number Diff line change 1
1
2
+ const WebToolkit = require ( `@vscode/webview-ui-toolkit/dist/toolkit.min.js` ) ;
3
+
2
4
const vscode = require ( `vscode` ) ;
3
5
const Tools = require ( `../tools` ) ;
4
6
@@ -44,14 +46,6 @@ module.exports = class ViewPanel {
44
46
}
45
47
46
48
async _getContent ( ) {
47
- const toolkitUri = Tools . getUri ( this . panel . webview , this . extensionUri , [
48
- `node_modules` ,
49
- `@vscode` ,
50
- `webview-ui-toolkit` ,
51
- `dist` ,
52
- `toolkit.js` ,
53
- ] ) ;
54
-
55
49
const trigger = new Trigger ( this . schema , this . trigger ) ;
56
50
57
51
Tools . setLoadingText ( this . panel . webview , `Fetching base info` ) ;
@@ -65,7 +59,7 @@ module.exports = class ViewPanel {
65
59
<head>
66
60
<meta charset="UTF-8">
67
61
<meta name="viewport" content="width=device-width, initial-scale=1.0">
68
- <script type="module" src=" ${ toolkitUri } "> </script>
62
+ <script type="module"> ${ WebToolkit } </script>
69
63
<style type="text/css">
70
64
.component {
71
65
margin-bottom: 0.5rem;
Original file line number Diff line number Diff line change 1
1
2
+ const WebToolkit = require ( `@vscode/webview-ui-toolkit/dist/toolkit.min.js` ) ;
3
+
2
4
const vscode = require ( `vscode` ) ;
3
5
const Tools = require ( `../tools` ) ;
4
6
@@ -45,14 +47,6 @@ module.exports = class ViewPanel {
45
47
}
46
48
47
49
async _getContent ( ) {
48
- const toolkitUri = Tools . getUri ( this . panel . webview , this . extensionUri , [
49
- `node_modules` ,
50
- `@vscode` ,
51
- `webview-ui-toolkit` ,
52
- `dist` ,
53
- `toolkit.js` ,
54
- ] ) ;
55
-
56
50
const view = new View ( this . schema , this . view ) ;
57
51
58
52
Tools . setLoadingText ( this . panel . webview , `Fetching base info` ) ;
@@ -75,7 +69,7 @@ module.exports = class ViewPanel {
75
69
<head>
76
70
<meta charset="UTF-8">
77
71
<meta name="viewport" content="width=device-width, initial-scale=1.0">
78
- <script type="module" src=" ${ toolkitUri } "> </script>
72
+ <script type="module"> ${ WebToolkit } </script>
79
73
<style type="text/css">
80
74
.component {
81
75
margin-bottom: 0.5rem;
Original file line number Diff line number Diff line change @@ -25,11 +25,10 @@ const config = {
25
25
extensions : [ `.ts` , `.js` , `.svg` ] ,
26
26
} ,
27
27
module : {
28
-
29
28
rules : [
30
29
{
31
30
test : / \. j s $ / ,
32
- include : path . resolve ( __dirname , `node_modules/@bendera/ vscode- webview-elements /dist` ) ,
31
+ include : path . resolve ( __dirname , `node_modules/@vscode/ webview-ui-toolkit /dist/toolkit.min.js ` ) ,
33
32
type : `asset/source`
34
33
}
35
34
]
You can’t perform that action at this time.
0 commit comments