@gechiui/block-editor
Version:
45 lines (42 loc) • 1.07 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@gechiui/element";
/**
* External dependencies
*/
import { animated } from '@react-spring/web';
import classnames from 'classnames';
/**
* GeChiUI dependencies
*/
import { __experimentalTreeGridRow as TreeGridRow } from '@gechiui/components';
/**
* Internal dependencies
*/
import useMovingAnimation from '../use-moving-animation';
const AnimatedTreeGridRow = animated(TreeGridRow);
export default function ListViewLeaf(_ref) {
let {
isSelected,
position,
level,
rowCount,
children,
className,
path,
...props
} = _ref;
const ref = useMovingAnimation({
isSelected,
adjustScrolling: false,
enableAnimation: true,
triggerAnimationOnChange: path
});
return createElement(AnimatedTreeGridRow, _extends({
ref: ref,
className: classnames('block-editor-list-view-leaf', className),
level: level,
positionInSet: position,
setSize: rowCount
}, props), children);
}
//# sourceMappingURL=leaf.js.map