UNPKG

@wordpress/block-library

Version:
1 lines • 1.92 kB
{"version":3,"file":"edit.cjs","names":["useBlockProps","PlainText","__"],"sources":["../../src/query-pagination-previous/edit.jsx"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '←',\n\tchevron: '«',\n};\n\nexport default function QueryPaginationPreviousEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { paginationArrow, showLabel },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#pagination-previous-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-query-pagination-previous-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t\taria-hidden\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t{ showLabel && (\n\t\t\t\t<PlainText\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\taria-label={ __( 'Previous page link' ) }\n\t\t\t\t\tplaceholder={ __( 'Previous Page' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</a>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,MAAM,WAAW;CAChB,MAAM;CACN,OAAO;CACP,SAAS;AACV;AAEA,SAAwB,4BAA6B,EACpD,YAAY,EAAE,SACd,eACA,SAAS,EAAE,iBAAiB,eACzB;CACH,MAAM,eAAe,SAAU;CAC/B,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;EACC,MAAK;EACL,UAAY,UAAW,MAAM,eAAe;EAC5C,IAAA,GAAKA,wBAAAA,cAAAA,CAAc;EAHpB,UAAA,CAKG,gBACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GACC,WAAY,qDAAsD;GAClE,eAAA;GAEE,UAAA;EACG,CAAA,GAEL,aACD,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,WAAD;GACC,uBAAwB;GACxB,SAAQ;GACR,eAAA,GAAaC,gBAAAA,GAAAA,CAAI,oBAAqB;GACtC,cAAA,GAAcA,gBAAAA,GAAAA,CAAI,eAAgB;GAClC,OAAQ;GACR,WAAa,aACZ,cAAe,EAAE,OAAO,SAAS,CAAE;EAEpC,CAAA,CAEA;;AAEL"}