UNPKG

@wordpress/block-library

Version:
1 lines • 1.65 kB
{"version":3,"file":"edit.cjs","names":["useInstanceId","useBlockProps","Placeholder","shortcode","__","PlainText"],"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,2BAAA,GADGA,mBAAAA,cAAAA,CAAe,aACkB;CAEpD,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,IAAA,GAAKC,wBAAAA,cAAAA,CAAc;EACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,aAAD;GAAa,MAAOC,iBAAAA;GAAY,QAAA,GAAQC,gBAAAA,GAAAA,CAAI,WAAY;GACvD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,WAAD;IACC,WAAU;IACV,IAAK;IACL,OAAQ,WAAW;IACnB,eAAA,GAAaD,gBAAAA,GAAAA,CAAI,gBAAiB;IAClC,cAAA,GAAcA,gBAAAA,GAAAA,CAAI,uBAAwB;IAC1C,WAAa,SAAU,cAAe,EAAE,KAAK,CAAE;GAC/C,CAAA;EACW,CAAA;CACT,CAAA;AAEP"}