@wordpress/block-library
Version:
Block library for the WordPress editor.
27 lines (26 loc) • 1.45 kB
JavaScript
;
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
let _wordpress_components = require("@wordpress/components");
let _wordpress_i18n = require("@wordpress/i18n");
let ______utils_js = require("../../utils.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
// packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.jsx
function EnhancedPaginationControl({ enhancedPagination, setAttributes, clientId }) {
const unsupportedBlocks = (0, ______utils_js.useUnsupportedBlocks)(clientId);
let help = (0, _wordpress_i18n.__)("Reload the full page—instead of just the posts list—when visitors navigate between pages.");
if (unsupportedBlocks.length) help = (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)(`Some blocks aren't supported: %s. Remove them to change this setting.`), unsupportedBlocks.join((0, _wordpress_i18n.__)(", ")));
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.ToggleControl, {
label: (0, _wordpress_i18n.__)("Reload full page"),
help,
checked: !enhancedPagination,
disabled: !!unsupportedBlocks.length,
onChange: (value) => {
setAttributes({ enhancedPagination: !value });
}
}) });
}
exports.default = EnhancedPaginationControl;
//# sourceMappingURL=enhanced-pagination-control.cjs.map