@wordpress/block-library
Version:
Block library for the WordPress editor.
49 lines (48 loc) • 1.32 kB
JavaScript
import { jsx, jsxs } from "react/jsx-runtime";
import { __ } from "@wordpress/i18n";
import { useBlockProps, PlainText } from "@wordpress/block-editor";
const arrowMap = {
none: "",
arrow: "\u2190",
chevron: "\xAB"
};
function QueryPaginationPreviousEdit({
attributes: { label },
setAttributes,
context: { paginationArrow, showLabel }
}) {
const displayArrow = arrowMap[paginationArrow];
return /* @__PURE__ */ jsxs(
"a",
{
href: "#pagination-previous-pseudo-link",
onClick: (event) => event.preventDefault(),
...useBlockProps(),
children: [
displayArrow && /* @__PURE__ */ jsx(
"span",
{
className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`,
"aria-hidden": true,
children: displayArrow
}
),
showLabel && /* @__PURE__ */ jsx(
PlainText,
{
__experimentalVersion: 2,
tagName: "span",
"aria-label": __("Previous page link"),
placeholder: __("Previous Page"),
value: label,
onChange: (newLabel) => setAttributes({ label: newLabel })
}
)
]
}
);
}
export {
QueryPaginationPreviousEdit as default
};
//# sourceMappingURL=edit.js.map