Use block name in placeholders inside blocks
This commit is contained in:
parent
5f7e0cb895
commit
622553978b
|
@ -67,6 +67,9 @@
|
||||||
// any depth
|
// any depth
|
||||||
id: $component.id,
|
id: $component.id,
|
||||||
|
|
||||||
|
// Name can be used down the tree in placeholders
|
||||||
|
name: $component.name,
|
||||||
|
|
||||||
// We register block components with their raw props so that we can eject
|
// We register block components with their raw props so that we can eject
|
||||||
// blocks later on
|
// blocks later on
|
||||||
registerComponent: registerBlockComponent,
|
registerComponent: registerBlockComponent,
|
||||||
|
|
|
@ -3,13 +3,14 @@
|
||||||
|
|
||||||
const { builderStore } = getContext("sdk")
|
const { builderStore } = getContext("sdk")
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
|
const block = getContext("block")
|
||||||
|
|
||||||
export let text
|
export let text
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $builderStore.inBuilder}
|
{#if $builderStore.inBuilder}
|
||||||
<div>
|
<div>
|
||||||
{text || $component.name || "Placeholder"}
|
{text || block?.name || $component.name || "Placeholder"}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue