Optional
componentsComponents for the block schema type
contentEditable={false}
and with style={{userSelection: 'none'}}
so that
the editor can distinguish between editable text and non-editable text.{
block: (blockProps) => {
return (
<Flex>
<Box flex={1}>{blockProps.renderDefault(blockProps)}</Box>
<Box contentEditable={false} style={{userSelect: 'none'}}>
<Button
icon={TrashIcon}
onClick={(event) => {
event.preventDefault()
blockProps.onRemove()
}}
/>
</Box>
</Flex>
)
},
},
Schema definition for text blocks.
Example: the default block definition