UNPKG

@wordpress/block-library

Version:
37 lines (36 loc) • 1.46 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); let _wordpress_i18n = require("@wordpress/i18n"); let _wordpress_block_editor = require("@wordpress/block-editor"); let react_jsx_runtime = require("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__ */ (0, react_jsx_runtime.jsxs)("a", { href: "#pagination-previous-pseudo-link", onClick: (event) => event.preventDefault(), ...(0, _wordpress_block_editor.useBlockProps)(), children: [displayArrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`, "aria-hidden": true, children: displayArrow }), showLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": (0, _wordpress_i18n.__)("Previous page link"), placeholder: (0, _wordpress_i18n.__)("Previous Page"), value: label, onChange: (newLabel) => setAttributes({ label: newLabel }) })] }); } exports.default = QueryPaginationPreviousEdit; //# sourceMappingURL=edit.cjs.map