UNPKG

@wordpress/block-library

Version:
42 lines (41 loc) 1.14 kB
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 QueryPaginationNextEdit(_ref) { let { attributes: { label }, setAttributes, context: { paginationArrow } } = _ref; const displayArrow = arrowMap[paginationArrow]; return createElement("a", _extends({ href: "#pagination-next-pseudo-link", onClick: event => event.preventDefault() }, useBlockProps()), createElement(PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": __('Next page link'), placeholder: __('Next Page'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) }), displayArrow && createElement("span", { className: `wp-block-query-pagination-next-arrow is-arrow-${paginationArrow}`, "aria-hidden": true }, displayArrow)); } //# sourceMappingURL=edit.js.map