2020-06-11 21:18:59 +02:00
|
|
|
<script>
|
2020-11-18 20:18:18 +01:00
|
|
|
import { getContext } from "svelte"
|
2021-06-25 17:04:42 +02:00
|
|
|
import Placeholder from "./Placeholder.svelte"
|
2020-11-18 20:18:18 +01:00
|
|
|
|
2021-06-25 17:04:42 +02:00
|
|
|
const { styleable, builderStore } = getContext("sdk")
|
2020-11-24 12:02:10 +01:00
|
|
|
const component = getContext("component")
|
2020-11-17 13:08:24 +01:00
|
|
|
|
2020-06-11 21:18:59 +02:00
|
|
|
export let embed
|
|
|
|
</script>
|
|
|
|
|
2021-06-25 17:04:42 +02:00
|
|
|
{#if embed}
|
|
|
|
<div class="embed" use:styleable={$component.styles}>
|
|
|
|
{@html embed}
|
|
|
|
</div>
|
|
|
|
{:else if $builderStore.inBuilder}
|
|
|
|
<div use:styleable={{ ...$component.styles, empty: true }}>
|
|
|
|
<Placeholder />
|
|
|
|
</div>
|
|
|
|
{/if}
|
2020-11-17 13:08:24 +01:00
|
|
|
|
|
|
|
<style>
|
2021-06-25 17:04:42 +02:00
|
|
|
.embed {
|
2020-11-17 13:08:24 +01:00
|
|
|
position: relative;
|
|
|
|
}
|
2021-06-25 17:04:42 +02:00
|
|
|
.embed :global(> *) {
|
2020-11-19 19:39:22 +01:00
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2020-11-17 13:08:24 +01:00
|
|
|
}
|
|
|
|
</style>
|