/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-library/src/heading/variations.js
39 строк
892 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { __, sprintf } from '@wordpress/i18n'; import { headingLevel1, headingLevel2, headingLevel3, headingLevel4, headingLevel5, headingLevel6, } from '@wordpress/icons'; const LEVEL_ICONS = [ headingLevel1, headingLevel2, headingLevel3, headingLevel4, headingLevel5, headingLevel6, ]; const variations = [ ...[ 1, 2, 3, 4, 5, 6 ].map( ( level ) => ( { name: `h${ level }`, title: sprintf( /* translators: %d: heading level e.g: "1", "2", "3" */ __( 'Heading %d' ), level ), description: __( 'Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.' ), icon: LEVEL_ICONS[ level - 1 ], attributes: { level }, scope: [ 'block', 'transform' ], keywords: [ `h${ level }` ], isActive: ( blockAttributes ) => blockAttributes.level === level, } ) ), ]; export default variations;