Automattic / isolated-block-editor

Repackages Gutenberg's editor playground as a full-featured multi-instance editor that does not require WordPress.
327 stars 48 forks source link

Add custom block to editor #258

Open SILITRA-Mihai-Andrei opened 4 months ago

SILITRA-Mihai-Andrei commented 4 months ago

Hi,

I read the docs, but I didn't figured out how to add a custom block to editor, like a simple Google Maps iframe. Is there a way to do this using Plain Text Editor?

Thank you!

johngodley commented 4 months ago

There's nothing specific here as its just the same in Gutenberg - you need to load and register the block.

SILITRA-Mihai-Andrei commented 4 months ago

Thank you for the answer!

The problem is that after I load and register the block, I get the following error in console, saying that the @wordpress/block-edit is not found.

Uncaught (in promise) TypeError: _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ is undefined save save.js:20

save.js import { useBlockProps } from '@wordpress/block-editor'; export default function save() { return ( <p { ...useBlockProps.save() }> // <=== error here { 'Quote – hello from the saved content!' } </p> ); }