Skip to content

Commit 06e25ae

Browse files
committed
Install the new demo component
1 parent 9f95351 commit 06e25ae

File tree

5 files changed

+14
-298
lines changed

5 files changed

+14
-298
lines changed

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"dependencies": {
1515
"@astrojs/language-server": "^2.5.2",
1616
"@astrojs/mdx": "^1.1.5",
17+
"@vscode-elements/webview-playground": "^1.1.1",
1718
"astro": "^3.6.0",
1819
"marked": "^10.0.0",
1920
"rehype-autolink-headings": "^7.1.0",

src/components/Demo.astro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ const { html, css, js } = Astro.slots;
66
const sourceVisible = html || css || js;
77
---
88

9+
<script>
10+
import '@vscode-elements/webview-playground/dist/index.js';
11+
</script>
12+
913
<div class="Demo" id={uid}>
10-
<component-preview><slot /></component-preview>
14+
<vscode-demo><slot /></vscode-demo>
1115
{
1216
sourceVisible ? (
1317
<div class="source">
@@ -70,7 +74,7 @@ const sourceVisible = html || css || js;
7074
margin: 15px 0;
7175
}
7276

73-
component-preview {
77+
vscode-demo {
7478
margin: 0;
7579
}
7680

src/layouts/Layout.astro

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ const filteredHeadings = headings.filter((h) => h.depth === 2);
2626
<meta name="generator" content={Astro.generator} />
2727
<GlobalStyles />
2828
<title>{title} &ndash; VSCode Elements</title>
29-
<script is:inline>
30-
window.__COMPONENT_PREVIEW_THEMES_DIR__ = "/dev-assets";
31-
</script>
32-
<script>
33-
import "../scripts/component-preview.js";
34-
</script>
3529
</head>
3630
<body class="vscode-light">
3731
<div class="container">

src/scripts/component-preview.js

Lines changed: 0 additions & 290 deletions
This file was deleted.

0 commit comments

Comments
 (0)