UNPKG

@wordpress/block-library

Version:
8 lines (7 loc) 1.51 kB
{ "version": 3, "sources": ["../../../src/comments/edit/index.js"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentsInspectorControls from './comments-inspector-controls';\nimport CommentsLegacy from './comments-legacy';\nimport TEMPLATE from './template';\n\nexport default function CommentsEdit( props ) {\n\tconst { attributes, setAttributes, clientId } = props;\n\tconst { tagName: TagName, legacy } = attributes;\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\tif ( legacy ) {\n\t\treturn <CommentsLegacy { ...props } />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommentsInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"], "mappings": ";AAGA,SAAS,eAAe,2BAA2B;AAKnD,OAAO,+BAA+B;AACtC,OAAO,oBAAoB;AAC3B,OAAO,cAAc;AAYZ,SAIP,UAJO,KAIP,YAJO;AAVM,SAAR,aAA+B,OAAQ;AAC7C,QAAM,EAAE,YAAY,eAAe,SAAS,IAAI;AAChD,QAAM,EAAE,SAAS,SAAS,OAAO,IAAI;AAErC,QAAM,aAAa,cAAc;AACjC,QAAM,mBAAmB,oBAAqB,YAAY;AAAA,IACzD,UAAU;AAAA,EACX,CAAE;AAEF,MAAK,QAAS;AACb,WAAO,oBAAC,kBAAiB,GAAG,OAAQ;AAAA,EACrC;AAEA,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA,oBAAC,WAAU,GAAG,kBAAmB;AAAA,KAClC;AAEF;", "names": [] }