@wordpress/block-library
Version:
Block library for the WordPress editor.
42 lines (41 loc) • 1.16 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@wordpress/element";
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { useBlockProps, PlainText } from '@wordpress/block-editor';
const arrowMap = {
none: '',
arrow: '←',
chevron: '«'
};
export default function QueryPaginationPreviousEdit(_ref) {
let {
attributes: {
label
},
setAttributes,
context: {
paginationArrow
}
} = _ref;
const displayArrow = arrowMap[paginationArrow];
return createElement("a", _extends({
href: "#pagination-previous-pseudo-link",
onClick: event => event.preventDefault()
}, useBlockProps()), displayArrow && createElement("span", {
className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`,
"aria-hidden": true
}, displayArrow), createElement(PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": __('Previous page link'),
placeholder: __('Previous Page'),
value: label,
onChange: newLabel => setAttributes({
label: newLabel
})
}));
}
//# sourceMappingURL=edit.js.map