@wordpress/block-library
Version:
Block library for the WordPress editor.
1 lines • 951 B
Source Map (JSON)
{"version":3,"file":"index.mjs","names":["blockEditorStore"],"sources":["../../../src/terms-query/edit/index.jsx"],"sourcesContent":["import { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport TermsQueryContent from './terms-query-content';\nimport TermsQueryPlaceholder from './terms-query-placeholder';\n\nconst TermsQueryEdit = ( props ) => {\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( blockEditorStore ).getBlocks( props.clientId ).length,\n\t\t[ props.clientId ]\n\t);\n\tconst Component = hasInnerBlocks\n\t\t? TermsQueryContent\n\t\t: TermsQueryPlaceholder;\n\treturn <Component { ...props } />;\n};\n\nexport default TermsQueryEdit;\n"],"mappings":";;;;;;AAKA,MAAM,kBAAmB,UAAW;CAMnC,MAAM,YALiB,WACpB,WACD,CAAC,CAAE,OAAQA,KAAiB,CAAC,CAAC,UAAW,MAAM,QAAS,CAAC,CAAC,QAC3D,CAAE,MAAM,QAAS,CAEa,IAC5B,oBACA;CACH,OAAO,oBAAC,WAAD,EAAW,GAAK,MAAS,CAAA;AACjC"}