UNPKG

@wordpress/block-library

Version:
32 lines (31 loc) • 1.15 kB
import { __ } from "@wordpress/i18n"; import { PlainText, useBlockProps } from "@wordpress/block-editor"; import { jsx, jsxs } from "react/jsx-runtime"; // packages/block-library/src/query-pagination-previous/edit.jsx const arrowMap = { none: "", arrow: "←", chevron: "«" }; 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.mjs.map