/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-library/src/shortcode/edit.js
25 строк
850 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { __ } from '@wordpress/i18n'; import { PlainText, useBlockProps } from '@wordpress/block-editor'; import { useInstanceId } from '@wordpress/compose'; import { Placeholder } from '@wordpress/components'; import { shortcode } from '@wordpress/icons'; export default function ShortcodeEdit( { attributes, setAttributes } ) { const instanceId = useInstanceId( ShortcodeEdit ); const inputId = `blocks-shortcode-input-${ instanceId }`; return ( <div { ...useBlockProps() }> <Placeholder icon={ shortcode } label={ __( 'Shortcode' ) }> <PlainText className="blocks-shortcode__textarea" id={ inputId } value={ attributes.text } aria-label={ __( 'Shortcode text' ) } placeholder={ __( 'Write shortcode here…' ) } onChange={ ( text ) => setAttributes( { text } ) } /> </Placeholder> </div> ); }