/** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; import { useContext } from '@wordpress/element'; import { Notice, ToggleControl } from '@wordpress/components'; import { Link, Stack, Text } from '@wordpress/ui'; /** * Internal dependencies */ import { AdminContext } from '../../index'; import { useSearchVisibility } from '../index'; import ItemHelp from '../components/item-help'; export default function Emmet() { const { editorSettings, setEditorSettings } = useContext( AdminContext ); const title = __( 'Enable Emmet', 'custom-html-block-extension' ); const isVisible = useSearchVisibility( title ); if ( ! isVisible ) { return null; } const onChange = ( value: boolean ) => { setEditorSettings( { ...editorSettings, emmet: value, } ); }; return ( }> { __( 'Emmet is a function for the editor that allow for high-speed coding via content assist.', 'custom-html-block-extension' ) } }> { __( 'Only valid for HTML tags and does not support inline CSS in the block and classic editor.', 'custom-html-block-extension' ) }
{ __( 'You can use Emmet if the file extension is html, php, sass, scss, css, or less in the theme/plugin editor.', 'custom-html-block-extension' ) }
}> { __( 'Check cheat sheet', 'custom-html-block-extension' ) } { __( 'Save and reload the browser to reflect this settings in the preview editor area.', 'custom-html-block-extension' ) } } isToggle defaultToggle image="editor-settings/emmet.gif" value={ editorSettings.emmet } />
); }