start adding global toolbar
This commit is contained in:
parent
16e0ffdd99
commit
b96f8cb5f7
|
@ -42,7 +42,7 @@ export const SbBlockPicker = defineComponent({
|
|||
open.value = true;
|
||||
$event.stopPropagation();
|
||||
}}
|
||||
>Add a block</SbButton>
|
||||
>+</SbButton>
|
||||
<SbModal
|
||||
open={open.value}
|
||||
onClick={($event: MouseEvent) => $event.stopPropagation()}
|
||||
|
|
0
packages/core/lib/components/BlockToolbar.scss
Normal file
0
packages/core/lib/components/BlockToolbar.scss
Normal file
28
packages/core/lib/components/BlockToolbar.tsx
Normal file
28
packages/core/lib/components/BlockToolbar.tsx
Normal 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>
|
||||
);
|
||||
},
|
||||
});
|
|
@ -20,6 +20,7 @@ import { EditorDimensions, useResizeObserver } from '../use-resize-observer';
|
|||
import { ActiveBlock } from '../use-activation';
|
||||
|
||||
import { SbMainMenu } from './MainMenu';
|
||||
import { SbBlockToolbar } from './BlockToolbar';
|
||||
import { SbBlock } from './Block';
|
||||
|
||||
import './Schlechtenburg.scss';
|
||||
|
@ -80,7 +81,10 @@ export const Schlechtenburg = defineComponent({
|
|||
>
|
||||
{
|
||||
mode.value === SbMode.Edit
|
||||
? <SbMainMenu block={props.block} />
|
||||
? <>
|
||||
<SbMainMenu block={props.block} />
|
||||
<SbBlockToolbar block={props.block} />
|
||||
</>
|
||||
: null
|
||||
}
|
||||
<SbBlock
|
||||
|
|
Loading…
Reference in a new issue