{"version":3,"file":"resizable-cover-popover.cjs","names":["unlock","blockEditorPrivateApis","useState"],"sources":["../../../src/cover/edit/resizable-cover-popover.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useState } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { unlock } from '../../lock-unlock';\n\nconst RESIZABLE_BOX_ENABLE_OPTION = {\n\ttop: false,\n\tright: false,\n\tbottom: true,\n\tleft: false,\n\ttopRight: false,\n\tbottomRight: false,\n\tbottomLeft: false,\n\ttopLeft: false,\n};\n\nconst { ResizableBoxPopover } = unlock( blockEditorPrivateApis );\n\nexport default function ResizableCoverPopover( {\n\tclassName,\n\theight,\n\tminHeight,\n\tonResize,\n\tonResizeStart,\n\tonResizeStop,\n\tshowHandle,\n\tsize,\n\twidth,\n\t...props\n} ) {\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\n\tconst resizableBoxProps = {\n\t\tclassName: clsx( className, { 'is-resizing': isResizing } ),\n\t\tenable: RESIZABLE_BOX_ENABLE_OPTION,\n\t\tonResizeStart: ( _event, _direction, elt ) => {\n\t\t\tonResizeStart( elt.clientHeight );\n\t\t\tonResize( elt.clientHeight );\n\t\t},\n\t\tonResize: ( _event, _direction, elt ) => {\n\t\t\tonResize( elt.clientHeight );\n\t\t\tif ( ! isResizing ) {\n\t\t\t\tsetIsResizing( true );\n\t\t\t}\n\t\t},\n\t\tonResizeStop: ( _event, _direction, elt ) => {\n\t\t\tonResizeStop( elt.clientHeight );\n\t\t\tsetIsResizing( false );\n\t\t},\n\t\tshowHandle,\n\t\tsize,\n\t\t__experimentalShowTooltip: true,\n\t\t__experimentalTooltipProps: {\n\t\t\taxis: 'y',\n\t\t\tposition: 'bottom',\n\t\t\tisVisible: isResizing,\n\t\t},\n\t};\n\n\treturn (\n\t\t<ResizableBoxPopover\n\t\t\tclassName=\"block-library-cover__resizable-box-popover\"\n\t\t\tresizableBoxProps={ resizableBoxProps }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,8BAA8B;CACnC,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CACN,UAAU;CACV,aAAa;CACb,YAAY;CACZ,SAAS;AACV;AAEA,MAAM,EAAE,yBAAA,GAAwBA,qBAAAA,OAAAA,CAAQC,wBAAAA,WAAuB;AAE/D,SAAwB,sBAAuB,EAC9C,WACA,QACA,WACA,UACA,eACA,cACA,YACA,MACA,OACA,GAAG,SACA;CACH,MAAM,CAAE,YAAY,kBAAA,GAAkBC,mBAAAA,SAAAA,CAAU,KAAM;CAEtD,MAAM,oBAAoB;EACzB,YAAA,GAAW,KAAA,QAAA,CAAM,WAAW,EAAE,eAAe,WAAW,CAAE;EAC1D,QAAQ;EACR,gBAAiB,QAAQ,YAAY,QAAS;GAC7C,cAAe,IAAI,YAAa;GAChC,SAAU,IAAI,YAAa;EAC5B;EACA,WAAY,QAAQ,YAAY,QAAS;GACxC,SAAU,IAAI,YAAa;GAC3B,IAAK,CAAE,YACN,cAAe,IAAK;EAEtB;EACA,eAAgB,QAAQ,YAAY,QAAS;GAC5C,aAAc,IAAI,YAAa;GAC/B,cAAe,KAAM;EACtB;EACA;EACA;EACA,2BAA2B;EAC3B,4BAA4B;GAC3B,MAAM;GACN,UAAU;GACV,WAAW;EACZ;CACD;CAEA,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAD;EACC,WAAU;EACU;EACpB,GAAK;CACL,CAAA;AAEH"}