@wordpress/block-library
Version:
Block library for the WordPress editor.
8 lines (7 loc) • 2.02 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../../src/query/edit/inspector-controls/enhanced-pagination-control.jsx"],
"sourcesContent": ["import { ToggleControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useUnsupportedBlocks } from '../../utils';\n\nexport default function EnhancedPaginationControl( {\n\tenhancedPagination,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst unsupportedBlocks = useUnsupportedBlocks( clientId );\n\n\tlet help = __(\n\t\t'Reload the full page—instead of just the posts list—when visitors navigate between pages.'\n\t);\n\tif ( unsupportedBlocks.length ) {\n\t\thelp = sprintf(\n\t\t\t/* translators: %s: A list of block titles. */\n\t\t\t__(\n\t\t\t\t`Some blocks aren't supported: %s. Remove them to change this setting.`\n\t\t\t),\n\t\t\tunsupportedBlocks.join(\n\t\t\t\t/* translators: Used between list items, there is a space after the comma. */\n\t\t\t\t__( ', ' ) // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ToggleControl\n\t\t\t\tlabel={ __( 'Reload full page' ) }\n\t\t\t\thelp={ help }\n\t\t\t\tchecked={ ! enhancedPagination }\n\t\t\t\tdisabled={ !! unsupportedBlocks.length }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tenhancedPagination: ! value,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
"mappings": ";AAAA,SAAS,qBAAqB;AAC9B,SAAS,IAAI,eAAe;AAC5B,SAAS,4BAA4B;AA0BnC,mBACC,WADD;AAxBa,SAAR,0BAA4C;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,oBAAoB,qBAAsB,QAAS;AAEzD,MAAI,OAAO;AAAA,IACV;AAAA,EACD;AACA,MAAK,kBAAkB,QAAS;AAC/B,WAAO;AAAA;AAAA,MAEN;AAAA,QACC;AAAA,MACD;AAAA,MACA,kBAAkB;AAAA;AAAA,QAEjB,GAAI,IAAK;AAAA;AAAA,MACV;AAAA,IACD;AAAA,EACD;AAEA,SACC,gCACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,kBAAmB;AAAA,MAC/B;AAAA,MACA,SAAU,CAAE;AAAA,MACZ,UAAW,CAAC,CAAE,kBAAkB;AAAA,MAChC,UAAW,CAAE,UAAW;AACvB,sBAAe;AAAA,UACd,oBAAoB,CAAE;AAAA,QACvB,CAAE;AAAA,MACH;AAAA;AAAA,EACD,GACD;AAEF;",
"names": []
}