/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-editor/src/components/list-view/leaf.js
49 строк
1 KB
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { animated } from '@react-spring/web'; import clsx from 'clsx'; import { __experimentalTreeGridRow as TreeGridRow } from '@wordpress/components'; import { useMergeRefs } from '@wordpress/compose'; import { forwardRef } from '@wordpress/element'; import useMovingAnimation from '../use-moving-animation'; const AnimatedTreeGridRow = animated( TreeGridRow ); const ListViewLeaf = forwardRef( ( { isDragged, isSelected, position, level, rowCount, children, className, path, ...props }, ref ) => { const animationRef = useMovingAnimation( { clientId: props[ 'data-block' ], enableAnimation: true, triggerAnimationOnChange: path, } ); const mergedRef = useMergeRefs( [ ref, animationRef ] ); return ( <AnimatedTreeGridRow ref={ mergedRef } className={ clsx( 'block-editor-list-view-leaf', className ) } level={ level } positionInSet={ position } setSize={ rowCount } isExpanded={ undefined } { ...props } > { children } </AnimatedTreeGridRow> ); } ); export default ListViewLeaf;