Hello there,
You can use PHP code to register the block, then check if the current page is the widget page and return $meta_boxes variable at that point. For example:
// Register a hero content block for Gutenberg.
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
global $pagenow;
if ( $pagenow == 'widgets.php' ) {
return $meta_boxes;
}
$meta_boxes[] = [
'title' => 'Hero Area',
'id' => 'hero-area',
'type' => 'block', // Important.
...
];
return $meta_boxes;
} );
Follow the WordPress documentation https://codex.wordpress.org/Global_Variables#Admin_Globals