@wordpress/block-library
Version:
Block library for the WordPress editor.
8 lines (7 loc) • 1.56 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/shortcode/edit.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } 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\u2026' ) }\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": ";AAGA,SAAS,UAAU;AACnB,SAAS,WAAW,qBAAqB;AACzC,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAStB;AAPW,SAAR,cAAgC,EAAE,YAAY,cAAc,GAAI;AACtE,QAAM,aAAa,cAAe,aAAc;AAChD,QAAM,UAAU,0BAA2B,UAAW;AAEtD,SACC,oBAAC,SAAM,GAAG,cAAc,GACvB,8BAAC,eAAY,MAAO,WAAY,OAAQ,GAAI,WAAY,GACvD;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,IAAK;AAAA,MACL,OAAQ,WAAW;AAAA,MACnB,cAAa,GAAI,gBAAiB;AAAA,MAClC,aAAc,GAAI,4BAAwB;AAAA,MAC1C,UAAW,CAAE,SAAU,cAAe,EAAE,KAAK,CAAE;AAAA;AAAA,EAChD,GACD,GACD;AAEF;",
"names": []
}