60 lines
1.6 KiB
JavaScript
60 lines
1.6 KiB
JavaScript
import { useState } from '@wordpress/element';
|
|
import { BlockEditorProvider } from '@wordpress/block-editor';
|
|
|
|
import BlockEditor from './BlockEditor';
|
|
|
|
import './editor.scss';
|
|
|
|
export default function Editor() {
|
|
const [ blocks, updateBlocks ] = useState();
|
|
|
|
return <BlockEditorProvider
|
|
value={ blocks }
|
|
onInput={ updateBlocks }
|
|
onChange={ updateBlocks }
|
|
settings={ {
|
|
__experimentalFeatures: {
|
|
typography: {
|
|
defaultFontSizes: true,
|
|
dropCap: true,
|
|
fontSizes: {
|
|
default: [
|
|
{
|
|
name: "Small",
|
|
slug: "small",
|
|
size: "13px",
|
|
},
|
|
{
|
|
name: "Medium",
|
|
slug: "medium",
|
|
size: "20px",
|
|
},
|
|
{
|
|
name: "Large",
|
|
slug: "large",
|
|
size: "36px",
|
|
},
|
|
{
|
|
name: "Extra Large",
|
|
slug: "x-large",
|
|
size: "42px",
|
|
},
|
|
],
|
|
},
|
|
customFontSize: true,
|
|
fontStyle: true,
|
|
fontWeight: true,
|
|
letterSpacing: true,
|
|
textAlign: true,
|
|
textColumns: false,
|
|
textDecoration: true,
|
|
textTransform: true,
|
|
writingMode: false,
|
|
},
|
|
},
|
|
} }
|
|
>
|
|
<BlockEditor/>
|
|
</BlockEditorProvider>;
|
|
}
|