-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks @matiasfha 🙏
- Loading branch information
Showing
4 changed files
with
78 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "sveltekit-embed", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": { | ||
"name": "Scott Spence", | ||
"email": "[email protected]", | ||
|
@@ -18,7 +18,7 @@ | |
"license": "MIT", | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "pnpm run sveltekit-embed && pnpm i -D sveltekit-embed && vite build", | ||
"build": "pnpm un sveltekit-embed && pnpm i -D sveltekit-embed && vite build", | ||
"package": "svelte-package", | ||
"preview": "vite preview", | ||
"test": "playwright test", | ||
|
@@ -59,7 +59,7 @@ | |
"svelte-check": "2.9.0", | ||
"svelte-preprocess": "4.10.7", | ||
"svelte2tsx": "0.5.19", | ||
"sveltekit-embed": "0.0.5", | ||
"sveltekit-embed": "^0.0.5", | ||
"tailwindcss": "3.1.8", | ||
"tslib": "2.4.0", | ||
"typescript": "4.8.3", | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
<script lang="ts"> | ||
import GeneralObserver from "./general-observer.svelte" | ||
export let width: string = '100' | ||
export let height: string = '500' | ||
export let id: string = '' | ||
export let view: 'editor' | 'preview' | 'default' = 'default' | ||
export let clickToLoad: boolean = true //ctl | ||
export let hideNavigation: boolean = false //hideNavigation | ||
export let hideExplorer: boolean = true | ||
export let theme: string | 'light' | 'dark' | 'default' = 'dark' | ||
export let file: string | undefined | ||
import GeneralObserver from './general-observer.svelte' | ||
let baseUrl = `https://stackblitz.com/edit/${id}?embed=1 | ||
const config = { | ||
ctl: `${clickToLoad ? 1 : 0}`, | ||
hideExplorer: `${hideExplorer ? 1 : 0}`, | ||
hideNavigation: `${hideNavigation ? 1: 0}`, | ||
theme | ||
} | ||
if(view !== 'default') { | ||
config['view'] = view | ||
} | ||
if(file) { | ||
config['file'] = file | ||
} | ||
const queryString = new URLSearchParams(config) | ||
const src = `${baseUrl}&${queryString.toString()}` | ||
export let width: string = '100' | ||
export let height: string = '500' | ||
export let id: string = '' | ||
export let view: 'editor' | 'preview' | 'default' = 'default' | ||
export let clickToLoad: boolean = true //ctl | ||
export let hideNavigation: boolean = false //hideNavigation | ||
export let hideExplorer: boolean = true | ||
export let theme: string | 'light' | 'dark' | 'default' = 'dark' | ||
export let file: string | undefined | ||
let baseUrl = `https://stackblitz.com/edit/${id}?embed=1` | ||
const config = { | ||
ctl: `${clickToLoad ? 1 : 0}`, | ||
hideExplorer: `${hideExplorer ? 1 : 0}`, | ||
hideNavigation: `${hideNavigation ? 1 : 0}`, | ||
theme, | ||
} | ||
if (view !== 'default') { | ||
config['view'] = view | ||
} | ||
if (file) { | ||
config['file'] = file | ||
} | ||
const queryString = new URLSearchParams(config) | ||
const src = `${baseUrl}&${queryString.toString()}` | ||
</script> | ||
|
||
<GeneralObserver {height} {width}> | ||
<iframe | ||
{height} | ||
class="stackblitz-sveltekit-embed" | ||
title={`stackblitz-${id}`} | ||
{src} | ||
frameborder="no" | ||
allowfullscreen | ||
style={` | ||
width: 100%; | ||
`} | ||
/> | ||
<iframe | ||
{height} | ||
class="stackblitz-sveltekit-embed" | ||
title={`stackblitz-${id}`} | ||
{src} | ||
frameborder="no" | ||
allowfullscreen | ||
style={` | ||
width: 100%; | ||
`} | ||
/> | ||
</GeneralObserver> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters