Rename customBlocks to availableBlocks

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

View file

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

View file

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