/** * WordPress dependencies */ import { BlockControls, BlockAlignmentToolbar } from '@wordpress/block-editor'; import { _x } from '@wordpress/i18n'; import { Dropdown, ToolbarButton, ToolbarGroup } from '@wordpress/components'; /** * Internal dependencies */ import { AddressSearch } from './address-search'; import type { EditProps } from './types'; export const ToolbarControls = ( { attributes: { addressAlignment, blockAlignment, isMarkerVisible, zoom }, setAttributes, }: EditProps ): JSX.Element => ( /* @ts-expect-error BlockControls should work… */ { /* @ts-expect-error BlockAlignmentToolbar should work… */ } setAttributes( { blockAlignment: value } ) } /> ( ) } renderContent={ ( { onClose } ) => { return ( { setAttributes( { lat, lng, marker: { lat, lng }, zoom: Math.max( 12, zoom ), } ); onClose(); } } /> ); } } /> { isMarkerVisible && ( ( ) } popoverProps={ { onFocusOutside: () => void null } } renderContent={ ( { onClose } ) => { return ( { setAttributes( { marker: { lat, lng }, } ); onClose(); } } /> ); } } /> setAttributes( { addressAlignment: 'left' !== addressAlignment ? 'left' : 'none', } ) } /> setAttributes( { addressAlignment: 'right' !== addressAlignment ? 'right' : 'none', } ) } /> ) } );