Use block name in placeholders inside blocks

This commit is contained in:
Andrew Kingston 2022-10-14 19:13:44 +01:00
parent 5f7e0cb895
commit 622553978b
2 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,9 @@
// any depth
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
// blocks later on
registerComponent: registerBlockComponent,

View File

@ -3,13 +3,14 @@
const { builderStore } = getContext("sdk")
const component = getContext("component")
const block = getContext("block")
export let text
</script>
{#if $builderStore.inBuilder}
<div>
{text || $component.name || "Placeholder"}
{text || block?.name || $component.name || "Placeholder"}
</div>
{/if}