{"version":3,"file":"edit.cjs","names":["useBlockProps","useToolsPanelDropdownMenuProps","InspectorControls","ToolsPanel","__","ToolsPanelItem","ToggleControl","RichText","createBlock","getDefaultBlockName"],"sources":["../../src/read-more/edit.jsx"],"sourcesContent":["import {\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function ReadMore( {\n\tattributes: { content, linkTarget },\n\tsetAttributes,\n\tinsertBlocksAfter,\n} ) {\n\tconst blockProps = useBlockProps();\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => setAttributes( { linkTarget: '_self' } ) }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => linkTarget !== '_self' }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"a\"\n\t\t\t\taria-label={ __( '“Read more” link text' ) }\n\t\t\t\tplaceholder={ __( 'Read more' ) }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\tsetAttributes( { content: newValue } )\n\t\t\t\t}\n\t\t\t\t__unstableOnSplitAtEnd={\n\t\t\t\t\tinsertBlocksAfter\n\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t{ ...blockProps }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAwB,SAAU,EACjC,YAAY,EAAE,SAAS,cACvB,eACA,qBACG;CACH,MAAM,cAAA,GAAaA,wBAAAA,cAAAA,CAAc;CACjC,MAAM,qBAAA,GAAoBC,kBAAAA,+BAAAA,CAA+B;CAEzD,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,mBAAD,EAAA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,0BAAD;EACC,QAAA,GAAQC,gBAAAA,GAAAA,CAAI,UAAW;EACvB,gBAAiB,cAAe,EAAE,YAAY,QAAQ,CAAE;EACpC;EAEpB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,8BAAD;GACC,QAAA,GAAQD,gBAAAA,GAAAA,CAAI,iBAAkB;GAC9B,kBAAA;GACA,gBAAiB,eAAe;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