/** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; import { useContext } from '@wordpress/element'; import { __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, } from '@wordpress/components'; import { Stack } from '@wordpress/ui'; import { isAppleOS } from '@wordpress/keycodes'; /** * Internal dependencies */ import { AdminContext } from '../../index'; import { useSearchVisibility } from '../index'; import ItemHelp from '../components/item-help'; export default function MultiCursorModifier() { const { editorOptions, setEditorOptions } = useContext( AdminContext ); const title = __( 'Multi cursor modifier key', 'custom-html-block-extension' ); const isVisible = useSearchVisibility( title ); if ( ! isVisible ) { return null; } const items = [ { label: isAppleOS() ? __( 'Option', 'custom-html-block-extension' ) : __( 'Alt', 'custom-html-block-extension' ), value: 'alt', }, { label: isAppleOS() ? __( 'Command', 'custom-html-block-extension' ) : __( 'Ctrl', 'custom-html-block-extension' ), value: 'ctrlCmd', isDefault: true, }, ]; const onChange = ( value: string | number | undefined ) => { setEditorOptions( { ...editorOptions, multiCursorModifier: value as typeof editorOptions.multiCursorModifier, } ); }; return ( { items.map( ( item ) => ( ) ) } ); }