This sample demonstrates the usage of API in Block Editor. Use the properties panel to change read-only mode, enable/disable drag and drop, enable HTML encode, get JSON data, get block count, select all blocks, and control focus.
In this demo, you can explore the API behaviors by:
readOnly
checkbox to enable/disable editable and non-editable mode of the Block Editor.enableDragDrop
checkbox to enable/disable drag and drop functionality.getJsonData
button to display the focused block JSON data in an alert window.getHtmlData
button to display the editor content as HTML in an alert window.getBlockCount
button to display the total number of blocks in an alert window.selectAllBlocks
button to select all content in the editor.focusIn
button to focus the editor.focusOut
button to remove focus from the editor.print
button to preview the content before printing from the editor.