@wordpress/block-library
Version:
Block library for the WordPress editor.
50 lines (48 loc) • 1.36 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = QueryPaginationPreviousEdit;
var _i18n = require("@wordpress/i18n");
var _blockEditor = require("@wordpress/block-editor");
var _jsxRuntime = require("react/jsx-runtime");
/**
* WordPress dependencies
*/
const arrowMap = {
none: '',
arrow: '←',
chevron: '«'
};
function QueryPaginationPreviousEdit({
attributes: {
label
},
setAttributes,
context: {
paginationArrow,
showLabel
}
}) {
const displayArrow = arrowMap[paginationArrow];
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", {
href: "#pagination-previous-pseudo-link",
onClick: event => event.preventDefault(),
...(0, _blockEditor.useBlockProps)(),
children: [displayArrow && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`,
"aria-hidden": true,
children: displayArrow
}), showLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": (0, _i18n.__)('Previous page link'),
placeholder: (0, _i18n.__)('Previous Page'),
value: label,
onChange: newLabel => setAttributes({
label: newLabel
})
})]
});
}
//# sourceMappingURL=edit.js.map
;