@wordpress/block-library
Version:
Block library for the WordPress editor.
1 lines • 1.39 kB
Source Map (JSON)
{"version":3,"file":"edit.mjs","names":[],"sources":["../../src/shortcode/edit.jsx"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { PlainText, useBlockProps } from '@wordpress/block-editor';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Placeholder } from '@wordpress/components';\nimport { shortcode } from '@wordpress/icons';\n\nexport default function ShortcodeEdit( { attributes, setAttributes } ) {\n\tconst instanceId = useInstanceId( ShortcodeEdit );\n\tconst inputId = `blocks-shortcode-input-${ instanceId }`;\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Placeholder icon={ shortcode } label={ __( 'Shortcode' ) }>\n\t\t\t\t<PlainText\n\t\t\t\t\tclassName=\"blocks-shortcode__textarea\"\n\t\t\t\t\tid={ inputId }\n\t\t\t\t\tvalue={ attributes.text }\n\t\t\t\t\taria-label={ __( 'Shortcode text' ) }\n\t\t\t\t\tplaceholder={ __( 'Write shortcode here…' ) }\n\t\t\t\t\tonChange={ ( text ) => setAttributes( { text } ) }\n\t\t\t\t/>\n\t\t\t</Placeholder>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAMA,SAAwB,cAAe,EAAE,YAAY,iBAAkB;CAEtE,MAAM,UAAU,0BADG,cAAe,aACkB;CAEpD,OACC,oBAAC,OAAD;EAAK,GAAK,cAAc;EACvB,UAAA,oBAAC,aAAD;GAAa,MAAO;GAAY,OAAQ,GAAI,WAAY;GACvD,UAAA,oBAAC,WAAD;IACC,WAAU;IACV,IAAK;IACL,OAAQ,WAAW;IACnB,cAAa,GAAI,gBAAiB;IAClC,aAAc,GAAI,uBAAwB;IAC1C,WAAa,SAAU,cAAe,EAAE,KAAK,CAAE;GAC/C,CAAA;EACW,CAAA;CACT,CAAA;AAEP"}