I am making an attempt to tranform legacy widgets to dam, I used to be studying the docs, however I could not perceive the place to place this javascript code :
transforms: {
from: [
{
type: 'block',
blocks: [ 'core/legacy-widget' ],
isMatch: ( { idBase, occasion } ) => {
if ( ! occasion?.uncooked ) {
// Cannot remodel if uncooked occasion just isn't proven in REST API.
return false;
}
return idBase === 'example_widget';
},
remodel: ( { occasion } ) => {
return createBlock( 'instance/block', {
identify: occasion.uncooked.identify,
} );
},
},
]},
it says that I ought to add this javascript to my block’s definition. the place is that?
wordpress docs: https://developer.wordpress.org/block-editor/how-to-guides/widgets/legacy-widget-block/