File tree Expand file tree Collapse file tree 5 files changed +58
-3
lines changed Expand file tree Collapse file tree 5 files changed +58
-3
lines changed Original file line number Diff line number Diff line change 4747 "eslint-plugin-svelte3" : " 4.0.0" ,
4848 "husky" : " 8.0.1" ,
4949 "mdsvex" : " 0.10.6" ,
50+ "package" : " link:package" ,
5051 "postcss" : " 8.4.16" ,
5152 "postcss-load-config" : " 4.0.1" ,
5253 "prettier" : " 2.7.1" ,
Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ import GeneralObserver from " ./general-observer.svelte"
3+
4+ export let width: string = ' 100'
5+ export let height: string = ' 500'
6+ export let id: string = ' '
7+ export let view: ' editor' | ' preview' | ' default' = ' default'
8+ export let clickToLoad: boolean = true // ctl
9+ export let hideNavigation: boolean = false // hideNavigation
10+ export let hideExplorer: boolean = true
11+ export let theme: string | ' light' | ' dark' | ' default' = ' dark'
12+ export let file: string | undefined
13+
14+ let baseUrl = " https://stackblitz.com/edit/vitejs-vite-yyoood?embed=1"
15+ const config = {
16+ ctl: ` ${clickToLoad ? 1 : 0 } ` ,
17+ hideExplorer: ` ${hideExplorer ? 1 : 0 } ` ,
18+ hideNavigation: ` ${hideNavigation ? 1 : 0 } ` ,
19+ theme
20+ }
21+ if (view !== ' default' ) {
22+ config [' view' ] = view
23+ }
24+ if (file ) {
25+ config [' file' ] = file
26+ }
27+ const queryString = new URLSearchParams (config )
28+ const src = ` ${baseUrl }&${queryString .toString ()} `
29+ </script >
30+
31+ <GeneralObserver {height } {width }>
32+ <iframe
33+ {height }
34+ class =" stackblitz-sveltekit-embed"
35+ title ={` stackblitz-${id } ` }
36+ {src }
37+ frameborder =" no"
38+ allowfullscreen
39+ style ={`
40+ width: 100%;
41+ ` }
42+ />
43+ </GeneralObserver >
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export { default as GenericEmbed } from './components/generic-embed.svelte'
77export { default as SimpleCast } from './components/simple-cast.svelte'
88export { default as SoundCloud } from './components/sound-cloud.svelte'
99export { default as Spotify } from './components/spotify.svelte'
10+ export { default as StackBlitz } from './components/stackblitz.svelte'
1011export { default as Tweet } from './components/tweet.svelte'
1112export { default as Vimeo } from './components/vimeo.svelte'
1213export { default as YouTube } from './components/you-tube.svelte'
Original file line number Diff line number Diff line change 1111 Tweet ,
1212 Vimeo ,
1313 YouTube ,
14+ StackBlitz
1415 } from ' sveltekit-embed'
1516 import { Head } from ' svead'
1617 import { page } from ' $app/stores'
@@ -322,3 +323,10 @@ Usage:
322323Output:
323324
324325<YouTube youTubeId =" L7_z8rcbFPg " />
326+
327+
328+ ## StackBlitz
329+
330+ Output:
331+
332+ <StackBlitz id =" vitejs-vite-yyoood " />
You can’t perform that action at this time.
0 commit comments