{"version":3,"file":"edit.cjs","names":["useBlockProps","RichText","Figure","BlockQuote","__","createBlock","getDefaultBlockName"],"sources":["../../src/pullquote/edit.jsx"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { Figure } from './figure';\nimport { BlockQuote } from './blockquote';\nimport useDeprecatedTextAlign from '../utils/deprecated-text-align-attributes';\n\nfunction PullQuoteEdit( props ) {\n\tconst { attributes, setAttributes, isSelected, insertBlocksAfter } = props;\n\tuseDeprecatedTextAlign( props );\n\tconst { citation, value } = attributes;\n\tconst blockProps = useBlockProps();\n\tconst shouldShowCitation = ! RichText.isEmpty( citation ) || isSelected;\n\n\treturn (\n\t\t<>\n\t\t\t<Figure { ...blockProps }>\n\t\t\t\t<BlockQuote>\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"value\"\n\t\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ ( nextValue ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tvalue: nextValue,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ __( 'Pullquote text' ) }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t// translators: placeholder text used for the quote\n\t\t\t\t\t\t\t__( 'Add quote' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ shouldShowCitation && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tidentifier=\"citation\"\n\t\t\t\t\t\t\ttagName=\"cite\"\n\t\t\t\t\t\t\tstyle={ { display: 'block' } }\n\t\t\t\t\t\t\tvalue={ citation }\n\t\t\t\t\t\t\taria-label={ __( 'Pullquote citation text' ) }\n\t\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t\t// translators: placeholder text used for the citation\n\t\t\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ ( nextCitation ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tcitation: nextCitation,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclassName=\"wp-block-pullquote__citation\"\n\t\t\t\t\t\t\t__unstableOnSplitAtEnd={\n\t\t\t\t\t\t\t\tinsertBlocksAfter\n\t\t\t\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockQuote>\n\t\t\t</Figure>\n\t\t</>\n\t);\n}\n\nexport default PullQuoteEdit;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,cAAe,OAAQ;CAC/B,MAAM,EAAE,YAAY,eAAe,YAAY,sBAAsB;CACrE,CAAA,GAAA,6CAAA,QAAA,CAAwB,KAAM;CAC9B,MAAM,EAAE,UAAU,UAAU;CAC5B,MAAM,cAAA,GAAaA,wBAAAA,cAAAA,CAAc;CACjC,MAAM,qBAAqB,CAAEC,wBAAAA,SAAS,QAAS,QAAS,KAAK;CAE7D,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,YAAAA,QAAD;EAAQ,GAAK;EACZ,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,YAAD,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CA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