/** * Dashed "Add field" appender for container blocks (Columns, Repeater). * Opens the full mini inserter scoped to that container. */ import { Inserter } from '@wordpress/block-editor'; import { Button } from '@wordpress/components'; import { useState } from '@wordpress/element'; import { resolveMiniInserterPositionFor } from '../lib/miniInserterPlacement'; import { setMiniInserterTarget, clearMiniInserterTarget } from '../lib/miniInserterTarget'; const PlusIcon = () => ( ); /** * @param {Object} props * @param {string} [props.rootClientId] Container to insert into (undefined = root list). * @param {string} props.label Translatable button label. */ export default function AddFieldButton( { rootClientId, label } ) { const [ position, setPosition ] = useState( 'bottom center' ); return ( isOpen ? setMiniInserterTarget( { rootClientId } ) : clearMiniInserterTarget() } renderToggle={ ( { onToggle, disabled } ) => ( ) } /> ); }