Rename customBlocks to availableBlocks
This commit is contained in:
parent
412f26d71d
commit
ceadc8ad80
|
@ -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 }),
|
||||||
{},
|
{},
|
||||||
),
|
),
|
||||||
|
|
|
@ -2,4 +2,6 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue