Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
transform: attributes => createBlock( 'jetpack/field-textarea', attributes ),
},
transform: attributes => createBlock( 'jetpack/field-text', attributes ),
},
transform: ( attributes ) => {
const newAttributes = Object.assign(
GalleryTransforms( attributes ),
{ images: attributes.images.filter( image => typeof image.id !== 'undefined' ) }
);
return createBlock( 'coblocks/gallery-carousel', newAttributes );
},
},
transform: ( content ) => {
return createBlock( 'core-embed/speaker-deck', {
content,
} );
},
} ],
function* setBibliography({ items, meta }: Processor.Bibliography) {
const blocksList = select('core/block-editor').getBlocks();
const bibliographyBlock = blocksList.find(
block => block.name === 'abt/bibliography',
);
if (items.length > 0 && bibliographyBlock) {
yield dispatch('core/block-editor').updateBlockAttributes(
bibliographyBlock.clientId,
{ ...meta, items },
);
} else if (items.length > 0 && !bibliographyBlock) {
yield dispatch('core/block-editor').insertBlock(
createBlock('abt/bibliography', {
...meta,
items,
}),
blocksList.length,
undefined,
false,
);
} else if (items.length === 0 && bibliographyBlock) {
yield dispatch('core/block-editor').removeBlock(
bibliographyBlock.clientId,
);
}
}
const blocks = map( innerBlocksTemplate, ( [ name, attr, innerBlocks = [] ] ) =>
createBlock( name, attr, createBlocksFromInnerBlocksTemplate( innerBlocks ) )
);
transform: ( attributes ) => {
return createBlock( 'core/file', {
href: attributes.src,
fileName: attributes.caption && attributes.caption.join(),
textLinkHref: attributes.src,
id: attributes.id,
} );
},
},
transform: () => createBlock( 'core/separator' ),
},
transform: ( attributes ) => (
createBlock( 'core/gallery', {
...GalleryTransforms( attributes ),
} )
),
},
transform: ({ title, url, align, id }) => (
createBlock('core/image', {
caption: title,
url,
align,
id,
})
),
},