How to use the @wordpress/block-editor.__experimentalBlock.figure function in @wordpress/block-editor

To help you get started, we’ve selected a few @wordpress/block-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / vip-go-mu-plugins-built / jetpack / extensions / blocks / videopress / edit.js View on Github external
import classnames from 'classnames';
import { get } from 'lodash';

/**
 * Internal dependencies
 */
import Loading from './loading';
import { getVideoPressUrl } from './url';

const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = [ 'image' ];

// For Gutenberg versions that support it, use the figure block wrapper (from '@wordpress/block-editor')
// to wrap the VideoPress component the same way the underlying `core/video` block is wrapped.
// (Otherwise there's an issue with Gutenberg >= 8.1 where the VideoPress block becomes unselectable,
// see https://github.com/Automattic/jetpack/issues/15922.)
const BlockFigureWrapper = Block ? Block.figure : 'figure';

const VideoPressEdit = CoreVideoEdit =>
	class extends Component {
		constructor() {
			super( ...arguments );
			this.state = {
				media: null,
				isFetchingMedia: false,
				fallback: false,
				interactive: false,
			};
			this.posterImageButton = createRef();
		}

		static getDerivedStateFromProps( nextProps, state ) {
			if ( ! nextProps.isSelected && state.interactive ) {