Editor
Block editor​
The BlockEditor
component is the main component of the editor. It is responsible for rendering the editor's toolbar and the editor's content.
<BlockEditor
contentField="json"
field="content.blocks"
label="Content"
sortableBy="order"
/>
Props​
Prop | Description |
---|---|
| string Field name of string field in entities referenced by field prop. Required |
| string The name of the column in Contember schema where to store data. Required |
| ReactNode The label for the field. Required |
| undefined | string The name of the column in Contember schema that is used to sort the options. Required |
| undefined | string | SugaredRelativeEntityList Field name of the references. |
| undefined | string | SugaredRelativeSingleField Field name of the reference discrimination. |
| undefined | ToolbarButtonSpec[] | ToolbarButtonSpec[][] Buttons to be displayed in the inline toolbar. |
| undefined | BlockHoveringToolbarConfig[] | BlockHoveringToolbarConfig[][] | Buttons to be displayed in the block toolbar. |
| undefined | ((baseEditor: BaseEditor) => BaseEditor) Function to be called when the editor is created. |
Block​
The Block
component is responsible for rendering the editor's content.
- Component - simple
- Component - advanced
<Block discriminateBy="gallery" label="Gallery">
...
</Block>
<Block
discriminateBy="gallery"
label="Gallery"
description=""
alternate=""
>
...
</Block>
Props​
Prop | Description |
---|---|
| OptionallyVariableFieldValue Field to discriminate by. Required |
| ReactNode The label for the field. |
| ReactNode The description for the field. |
| ReactNode |
| Renders content of the component. |