UNPKG

@wordpress/block-library

Version:
68 lines (66 loc) 2.61 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.jsx var enhanced_pagination_control_exports = {}; __export(enhanced_pagination_control_exports, { default: () => EnhancedPaginationControl }); module.exports = __toCommonJS(enhanced_pagination_control_exports); var import_components = require("@wordpress/components"); var import_i18n = require("@wordpress/i18n"); var import_utils = require("../../utils.cjs"); var import_jsx_runtime = require("react/jsx-runtime"); function EnhancedPaginationControl({ enhancedPagination, setAttributes, clientId }) { const unsupportedBlocks = (0, import_utils.useUnsupportedBlocks)(clientId); let help = (0, import_i18n.__)( "Reload the full page—instead of just the posts list—when visitors navigate between pages." ); if (unsupportedBlocks.length) { help = (0, import_i18n.sprintf)( /* translators: %s: A list of block titles. */ (0, import_i18n.__)( `Some blocks aren't supported: %s. Remove them to change this setting.` ), unsupportedBlocks.join( /* translators: Used between list items, there is a space after the comma. */ (0, import_i18n.__)(", ") // eslint-disable-line @wordpress/i18n-no-flanking-whitespace ) ); } return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_components.ToggleControl, { label: (0, import_i18n.__)("Reload full page"), help, checked: !enhancedPagination, disabled: !!unsupportedBlocks.length, onChange: (value) => { setAttributes({ enhancedPagination: !value }); } } ) }); } //# sourceMappingURL=enhanced-pagination-control.cjs.map