Rename customBlocks to availableBlocks

master
Benjamin Bädorf 2022-03-12 17:42:42 +01:00
parent 412f26d71d
commit ceadc8ad80
No known key found for this signature in database
GPG Key ID: 4406E80E13CD656C
3 changed files with 6 additions and 4 deletions

View File

@ -35,7 +35,7 @@ export const SbMain = defineComponent({
model,
props: {
customBlocks: {
availableBlocks: {
type: Array as PropType<IBlockDefinition<any>[]>,
default: () => [],
},
@ -69,7 +69,7 @@ export const SbMain = defineComponent({
provide(SymBlockTreeUnregister, () => { blockTree.value = null; });
const blockLibrary: IBlockLibrary = shallowReactive({
...props.customBlocks.reduce(
...props.availableBlocks.reduce(
(blocks: IBlockLibrary, block: IBlockDefinition<any>) => ({ ...blocks, [block.name]: block }),
{},
),

View File

@ -2,4 +2,6 @@
position: absolute;
width: auto;
height: auto;
display: flex;
flex-wrap: wrap;
}

View File

@ -42,7 +42,7 @@ export default defineComponent({
onUpdate={(newBlock: IBlockData<any>) => {
block.data = newBlock.data;
}}
customBlocks={[
availableBlocks={[
SbLayout,
SbHeading,
SbImage,
@ -54,7 +54,7 @@ export default defineComponent({
case SbMode.Display:
return <SbMain
block={block}
customBlocks={[
availableBlocks={[
SbLayout,
SbHeading,
SbImage,