/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-library/src/verse/edit.js
46 строк
1 KB
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { __ } from '@wordpress/i18n'; import { RichText, useBlockProps } from '@wordpress/block-editor'; import { createBlock, getDefaultBlockName } from '@wordpress/blocks'; import useDeprecatedTextAlign from '../utils/deprecated-text-align-attributes'; export default function VerseEdit( props ) { const { attributes, setAttributes, mergeBlocks, onRemove, insertBlocksAfter, style, } = props; const { content } = attributes; useDeprecatedTextAlign( props ); const blockProps = useBlockProps( { style } ); return ( <RichText tagName="pre" identifier="content" preserveWhiteSpace value={ content } onChange={ ( nextContent ) => { setAttributes( { content: nextContent, } ); } } aria-label={ __( 'Poetry text' ) } placeholder={ __( 'Write poetry…' ) } onRemove={ onRemove } onMerge={ mergeBlocks } { ...blockProps } __unstablePastePlainText __unstableOnSplitAtDoubleLineEnd={ insertBlocksAfter ? () => insertBlocksAfter( createBlock( getDefaultBlockName() ) ) : undefined } /> ); }