/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-library/src/form-input/variations.js
82 строки
2 KB
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { __ } from '@wordpress/i18n'; const variations = [ { name: 'text', title: __( 'Text Input' ), description: __( 'A generic text input.' ), attributes: { type: 'text' }, isDefault: true, scope: [ 'inserter', 'transform' ], isActive: ( blockAttributes ) => ! blockAttributes?.type || blockAttributes?.type === 'text', }, { name: 'textarea', title: __( 'Textarea Input' ), description: __( 'A textarea input to allow entering multiple lines of text.' ), attributes: { type: 'textarea' }, isDefault: true, scope: [ 'inserter', 'transform' ], isActive: ( blockAttributes ) => blockAttributes?.type === 'textarea', }, { name: 'checkbox', title: __( 'Checkbox Input' ), description: __( 'A simple checkbox input.' ), attributes: { type: 'checkbox', inlineLabel: true }, isDefault: true, scope: [ 'inserter', 'transform' ], isActive: ( blockAttributes ) => blockAttributes?.type === 'checkbox', }, { name: 'email', title: __( 'Email Input' ), description: __( 'Used for email addresses.' ), attributes: { type: 'email' }, isDefault: true, scope: [ 'inserter', 'transform' ], isActive: ( blockAttributes ) => blockAttributes?.type === 'email', }, { name: 'url', title: __( 'URL Input' ), description: __( 'Used for URLs.' ), attributes: { type: 'url' }, isDefault: true, scope: [ 'inserter', 'transform' ], isActive: ( blockAttributes ) => blockAttributes?.type === 'url', }, { name: 'tel', title: __( 'Telephone Input' ), description: __( 'Used for phone numbers.' ), attributes: { type: 'tel' }, isDefault: true, scope: [ 'inserter', 'transform' ], isActive: ( blockAttributes ) => blockAttributes?.type === 'tel', }, { name: 'number', title: __( 'Number Input' ), description: __( 'A numeric input.' ), attributes: { type: 'number' }, isDefault: true, scope: [ 'inserter', 'transform' ], isActive: ( blockAttributes ) => blockAttributes?.type === 'number', }, { name: 'hidden', title: __( 'Hidden Input' ), icon: 'visibility', description: __( 'A hidden input field.' ), attributes: { type: 'hidden' }, isDefault: true, scope: [ 'inserter', 'transform' ], isActive: ( blockAttributes ) => blockAttributes?.type === 'hidden', }, ]; export default variations;