@wordpress/block-editor
Version:
8 lines (7 loc) • 2.2 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/components/list-view/leaf.js"],
"sourcesContent": ["/**\n * External dependencies\n */\nimport { animated } from '@react-spring/web';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalTreeGridRow as TreeGridRow } from '@wordpress/components';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../use-moving-animation';\n\nconst AnimatedTreeGridRow = animated( TreeGridRow );\n\nconst ListViewLeaf = forwardRef(\n\t(\n\t\t{\n\t\t\tisDragged,\n\t\t\tisSelected,\n\t\t\tposition,\n\t\t\tlevel,\n\t\t\trowCount,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tpath,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst animationRef = useMovingAnimation( {\n\t\t\tclientId: props[ 'data-block' ],\n\t\t\tenableAnimation: true,\n\t\t\ttriggerAnimationOnChange: path,\n\t\t} );\n\n\t\tconst mergedRef = useMergeRefs( [ ref, animationRef ] );\n\n\t\treturn (\n\t\t\t<AnimatedTreeGridRow\n\t\t\t\tref={ mergedRef }\n\t\t\t\tclassName={ clsx( 'block-editor-list-view-leaf', className ) }\n\t\t\t\tlevel={ level }\n\t\t\t\tpositionInSet={ position }\n\t\t\t\tsetSize={ rowCount }\n\t\t\t\tisExpanded={ undefined }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</AnimatedTreeGridRow>\n\t\t);\n\t}\n);\n\nexport default ListViewLeaf;\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAyB;AACzB,kBAAiB;AAKjB,wBAAyD;AACzD,qBAA6B;AAC7B,qBAA2B;AAK3B,kCAA+B;AA4B5B;AA1BH,IAAM,0BAAsB,qBAAU,kBAAAA,yBAAY;AAElD,IAAM,mBAAe;AAAA,EACpB,CACC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACJ,GACA,QACI;AACJ,UAAM,mBAAe,4BAAAC,SAAoB;AAAA,MACxC,UAAU,MAAO,YAAa;AAAA,MAC9B,iBAAiB;AAAA,MACjB,0BAA0B;AAAA,IAC3B,CAAE;AAEF,UAAM,gBAAY,6BAAc,CAAE,KAAK,YAAa,CAAE;AAEtD,WACC;AAAA,MAAC;AAAA;AAAA,QACA,KAAM;AAAA,QACN,eAAY,YAAAC,SAAM,+BAA+B,SAAU;AAAA,QAC3D;AAAA,QACA,eAAgB;AAAA,QAChB,SAAU;AAAA,QACV,YAAa;AAAA,QACX,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEF;AACD;AAEA,IAAO,eAAQ;",
"names": ["TreeGridRow", "useMovingAnimation", "clsx"]
}