2021-11-02 09:45:27 +01:00
|
|
|
<script>
|
|
|
|
import { getContext, setContext } from "svelte"
|
|
|
|
|
|
|
|
const component = getContext("component")
|
|
|
|
const { styleable } = getContext("sdk")
|
|
|
|
|
2021-11-02 09:58:50 +01:00
|
|
|
// We need to set a block context to know we're inside a block, but also
|
|
|
|
// to be able to reference the actual component ID of the block from
|
|
|
|
// any depth
|
2021-11-02 09:45:27 +01:00
|
|
|
setContext("block", {
|
|
|
|
id: $component.id,
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div use:styleable={$component.styles}>
|
|
|
|
<slot />
|
|
|
|
</div>
|