{"version":3,"file":"comments-legacy.mjs","names":[],"sources":["../../../src/comments/edit/comments-legacy.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport Placeholder from './placeholder';\n\nexport default function CommentsLegacy( {\n\tattributes,\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tconst { textAlign } = attributes;\n\n\tconst actions = [\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tkey=\"convert\"\n\t\t\tonClick={ () => void setAttributes( { legacy: false } ) }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ __( 'Switch to editable mode' ) }\n\t\t</Button>,\n\t];\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning actions={ actions }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Comments block: You’re currently using the legacy version of the block. ' +\n\t\t\t\t\t\t\t'The following is just a placeholder - the final styling will likely look different. ' +\n\t\t\t\t\t\t\t'For a better representation and more customization options, ' +\n\t\t\t\t\t\t\t'switch the block to its editable mode.'\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t\t<Placeholder postId={ postId } postType={ postType } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAWA,SAAwB,eAAgB,EACvC,YACA,eACA,SAAS,EAAE,UAAU,YAClB;CACH,MAAM,EAAE,cAAc;CAEtB,MAAM,UAAU,CACf,oBAAC,QAAD;EACC,uBAAA;EAEA,eAAgB,KAAK,cAAe,EAAE,QAAQ,MAAM,CAAE;EACtD,SAAQ;EAEN,UAAA,GAAI,yBAA0B;CACzB,GALH,SAKG,CACT;CAEA,MAAM,aAAa,cAAe,EACjC,WAAW,KAAM,GACd,kBAAmB,cAAgB,UACtC,CAAE,EACH,CAAE;CAEF,OACC,qBAAA,UAAA,EAAA,UAAA,CACC,oBAAC,eAAD;EAAe,OAAM;EACpB,UAAA,oBAAC,kBAAD;GACC,OAAQ;GACR,WAAa,cAAe;IAC3B,cAAe,EAAE,WAAW,UAAU,CAAE;GACzC;EACA,CAAA;CACa,CAAA,GAEf,qBAAC,OAAD;EAAK,GAAK;EAAV,UAAA,CACC,oBAAC,SAAD;GAAmB;GAChB,UAAA,GACD,gQAID;EACQ,CAAA,GACT,oBAAC,aAAD;GAAsB;GAAoB;EAAY,CAAA,CAClD;CACJ,CAAA,CAAA,EAAA,CAAA;AAEJ"}