: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/font-sizes/README.md
/* harmony default export */ const font_size_picker = (font_size_picker_FontSizePicker);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/with-font-sizes.js
const DEFAULT_FONT_SIZES = [];
* Capitalizes the first letter in a string.
* @param {string} str The string whose first letter the function will capitalize.
* @return {string} Capitalized string.
const with_font_sizes_upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join('');
* Higher-order component, which handles font size logic for class generation,
* font size value retrieval, and font size change handling.
* @param {...(Object|string)} fontSizeNames The arguments should all be strings.
* Each string contains the font size
* attribute name e.g: 'fontSize'.
* @return {Function} Higher-order component.
/* harmony default export */ const with_font_sizes = ((...fontSizeNames) => {
* Computes an object whose key is the font size attribute name as passed in the array,
* and the value is the custom font size attribute name.
* Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized.
const fontSizeAttributeNames = fontSizeNames.reduce((fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => {
fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${with_font_sizes_upperFirst(fontSizeAttributeName)}`;
return fontSizeAttributeNamesAccumulator;
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => {
const [fontSizes] = use_settings_useSettings('typography.fontSizes');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
fontSizes: fontSizes || DEFAULT_FONT_SIZES
}, 'withFontSizes'), WrappedComponent => {
return class extends external_wp_element_namespaceObject.Component {
this.setters = this.createSetters();
return Object.entries(fontSizeAttributeNames).reduce((settersAccumulator, [fontSizeAttributeName, customFontSizeAttributeName]) => {
const upperFirstFontSizeAttributeName = with_font_sizes_upperFirst(fontSizeAttributeName);
settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName);
return settersAccumulator;
createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) {
return fontSizeValue => {
const fontSizeObject = this.props.fontSizes?.find(({
}) => size === Number(fontSizeValue));
this.props.setAttributes({
[fontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : undefined,
[customFontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? undefined : fontSizeValue
static getDerivedStateFromProps({
const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => {
if (previousState[fontSizeAttributeName]) {
// If new font size is name compare with the previous slug.
if (attributes[fontSizeAttributeName]) {
return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug;
// If font size is not named, update when the font size value changes.
return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName];
// In this case we need to build the font size object.
if (!Object.values(fontSizeAttributeNames).some(didAttributesChange)) {
const newState = Object.entries(fontSizeAttributeNames).filter(([key, value]) => didAttributesChange(value, key)).reduce((newStateAccumulator, [fontSizeAttributeName, customFontSizeAttributeName]) => {
const fontSizeAttributeValue = attributes[fontSizeAttributeName];
const fontSizeObject = utils_getFontSize(fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName]);
newStateAccumulator[fontSizeAttributeName] = {
class: getFontSizeClass(fontSizeAttributeValue)
return newStateAccumulator;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/index.js
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
var remove_accents = __webpack_require__(9681);
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
regexp: /\u0130|\u0049|\u0049\u0307/g,
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
* Lower case as a function.
function lowerCase(str) {
return str.toLowerCase();
;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
* Normalize the string into something other libraries can manipulate easier.
function noCase(input, options) {
if (options === void 0) { options = {}; }
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
var result = dist_es2015_replace(dist_es2015_replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
while (result.charAt(end - 1) === "\0")
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
* Replace `re` in the input string with the replacement value.
function dist_es2015_replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-items.js
// Default search helpers.
const defaultGetName = item => item.name || '';
const defaultGetTitle = item => item.title;
const defaultGetDescription = item => item.description || '';
const defaultGetKeywords = item => item.keywords || [];
const defaultGetCategory = item => item.category;
const defaultGetCollection = () => null;
const splitRegexp = [/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,
// One lowercase or digit, followed by one uppercase.
/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu // One uppercase followed by one uppercase and one lowercase.
const stripRegexp = /(\p{C}|\p{P}|\p{S})+/giu; // Anything that's not a punctuation, symbol or control/format character.
const extractedWords = new Map();
const normalizedStrings = new Map();
* Extracts words from an input string.
* @param {string} input The input string.
* @return {Array} Words, extracted from the input string.
function extractWords(input = '') {
if (extractedWords.has(input)) {
return extractedWords.get(input);
const result = noCase(input, {
}).split(' ').filter(Boolean);
extractedWords.set(input, result);
* Sanitizes the search input string.
* @param {string} input The search input to normalize.
* @return {string} The normalized search input.
function normalizeString(input = '') {
if (normalizedStrings.has(input)) {
return normalizedStrings.get(input);
let result = remove_accents_default()(input);
// Accommodate leading slash, matching autocomplete expectations.
result = result.replace(/^\//, '');
result = result.toLowerCase();
normalizedStrings.set(input, result);
* Converts the search term into a list of normalized terms.
* @param {string} input The search term to normalize.
* @return {string[]} The normalized list of search terms.
const getNormalizedSearchTerms = (input = '') => {
return extractWords(normalizeString(input));
const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => {
return unmatchedTerms.filter(term => !getNormalizedSearchTerms(unprocessedTerms).some(unprocessedTerm => unprocessedTerm.includes(term)));
const searchBlockItems = (items, categories, collections, searchInput) => {
const normalizedSearchTerms = getNormalizedSearchTerms(searchInput);
if (normalizedSearchTerms.length === 0) {
getCategory: item => categories.find(({
}) => slug === item.category)?.title,
getCollection: item => collections[item.name.split('/')[0]]?.title
return searchItems(items, searchInput, config);
* Filters an item list given a search term.
* @param {Array} items Item list
* @param {string} searchInput Search input.
* @param {Object} config Search Config.
* @return {Array} Filtered item list.
const searchItems = (items = [], searchInput = '', config = {}) => {
const normalizedSearchTerms = getNormalizedSearchTerms(searchInput);
if (normalizedSearchTerms.length === 0) {
const rankedItems = items.map(item => {
return [item, getItemSearchRank(item, searchInput, config)];
}).filter(([, rank]) => rank > 0);
rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1);
return rankedItems.map(([item]) => item);
* Get the search rank for a given item and a specific search term.
* The better the match, the higher the rank.
* If the rank equals 0, it should be excluded from the results.
* @param {Object} item Item to filter.
* @param {string} searchTerm Search term.
* @param {Object} config Search Config.
* @return {number} Search Rank.
function getItemSearchRank(item, searchTerm, config = {}) {
getName = defaultGetName,
getTitle = defaultGetTitle,
getDescription = defaultGetDescription,
getKeywords = defaultGetKeywords,
getCategory = defaultGetCategory,
getCollection = defaultGetCollection
const name = getName(item);
const title = getTitle(item);
const description = getDescription(item);
const keywords = getKeywords(item);
const category = getCategory(item);
const collection = getCollection(item);
const normalizedSearchInput = normalizeString(searchTerm);
const normalizedTitle = normalizeString(title);
// Then prefers if the beginning of the title matches the search term
// name, keywords, categories, collection, variations match come later.
if (normalizedSearchInput === normalizedTitle) {
} else if (normalizedTitle.startsWith(normalizedSearchInput)) {
const terms = [name, title, description, ...keywords, category, collection].join(' ');
const normalizedSearchTerms = extractWords(normalizedSearchInput);
const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms);
if (unmatchedTerms.length === 0) {
// Give a better rank to "core" namespaced items.
if (rank !== 0 && name.startsWith('core/')) {
const isCoreBlockVariation = name !== item.id;
// Give a bit better rank to "core" blocks over "core" block variations.
rank += isCoreBlockVariation ? 1 : 2;
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-block-types-state.js
* Retrieves the block types inserter state.
* @param {string=} rootClientId Insertion's root client ID.
* @param {Function} onInsert function called when inserter a list of blocks.
* @param {boolean} isQuick
* @return {Array} Returns the block types state. (block types, categories, collections, onSelect handler)
const useBlockTypesState = (rootClientId, onInsert, isQuick) => {
const options = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[withRootClientIdOptionKey]: !isQuick
const [items] = (0,external_wp_data_namespaceObject.useSelect)(select => [select(store).getInserterItems(rootClientId, options)], [rootClientId, options]);
const [categories, collections] = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blocks_namespaceObject.store);
return [getCategories(), getCollections()];
const onSelectItem = (0,external_wp_element_namespaceObject.useCallback)(({
rootClientId: _rootClientId
}, shouldFocusBlock) => {
const insertedBlock = syncStatus === 'unsynced' ? (0,external_wp_blocks_namespaceObject.parse)(content, {
__unstableSkipMigrationLogs: true
}) : (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocks));
onInsert(insertedBlock, undefined, shouldFocusBlock, _rootClientId);
return [items, categories, collections, onSelectItem];
/* harmony default export */ const use_block_types_state = (useBlockTypesState);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/order-inserter-block-items.js
/** @typedef {import('../store/selectors').WPEditorInserterItem} WPEditorInserterItem */
* Helper function to order inserter block items according to a provided array of prioritized blocks.
* @param {WPEditorInserterItem[]} items The array of editor inserter block items to be sorted.
* @param {string[]} priority The array of block names to be prioritized.
* @return {WPEditorInserterItem[]} The sorted array of editor inserter block items.
const orderInserterBlockItems = (items, priority) => {
// Sort block items according to `priority`.
let aIndex = priority.indexOf(aName);
let bIndex = priority.indexOf(bName);
// All other block items should come after that.
aIndex = priority.length;
bIndex = priority.length;
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/autocompleters/block.js
const block_noop = () => {};
const SHOWN_BLOCK_TYPES = 9;