start adding global toolbar

This commit is contained in:
Benjamin Bädorf 2021-03-07 22:30:22 +01:00
parent 16e0ffdd99
commit b96f8cb5f7
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
4 changed files with 34 additions and 2 deletions

View file

@ -42,7 +42,7 @@ export const SbBlockPicker = defineComponent({
open.value = true; open.value = true;
$event.stopPropagation(); $event.stopPropagation();
}} }}
>Add a block</SbButton> >+</SbButton>
<SbModal <SbModal
open={open.value} open={open.value}
onClick={($event: MouseEvent) => $event.stopPropagation()} onClick={($event: MouseEvent) => $event.stopPropagation()}

View file

@ -0,0 +1,28 @@
import {
defineComponent,
PropType,
} from 'vue';
import { Block } from '../blocks';
import './BlockToolbar.scss';
interface BlockToolbarProps {
block: Block;
}
export const SbBlockToolbar = defineComponent({
name: 'sb-block-toolbar',
props: {
block: {
type: (null as unknown) as PropType<Block>,
required: true,
},
},
setup(props: BlockToolbarProps, context) {
return () => (
<div class="sb-block-toolbar"></div>
);
},
});

View file

@ -20,6 +20,7 @@ import { EditorDimensions, useResizeObserver } from '../use-resize-observer';
import { ActiveBlock } from '../use-activation'; import { ActiveBlock } from '../use-activation';
import { SbMainMenu } from './MainMenu'; import { SbMainMenu } from './MainMenu';
import { SbBlockToolbar } from './BlockToolbar';
import { SbBlock } from './Block'; import { SbBlock } from './Block';
import './Schlechtenburg.scss'; import './Schlechtenburg.scss';
@ -80,7 +81,10 @@ export const Schlechtenburg = defineComponent({
> >
{ {
mode.value === SbMode.Edit mode.value === SbMode.Edit
? <SbMainMenu block={props.block} /> ? <>
<SbMainMenu block={props.block} />
<SbBlockToolbar block={props.block} />
</>
: null : null
} }
<SbBlock <SbBlock