: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const focusingOutsideGroup = !event.currentTarget.contains(event.relatedTarget);
if (focusingOutsideGroup) {
/* harmony default export */ const group = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxGroup));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/row.js
CompositeGroupV2: CompositeGroup
} = unlock(external_wp_components_namespaceObject.privateApis);
function InserterListboxRow(props, ref) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeGroup, {
/* harmony default export */ const inserter_listbox_row = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxRow));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-types-list/index.js
function chunk(array, size) {
for (let i = 0, j = array.length; i < j; i += size) {
chunks.push(array.slice(i, i + size));
function BlockTypesList({
const className = 'block-editor-block-types-list';
const listId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockTypesList, className);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(group, {
children: [chunk(items, 3).map((row, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox_row, {
children: row.map((item, j) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_list_item, {
className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(item.id),
isDraggable: isDraggable && !item.isDisabled,
isFirst: i === 0 && j === 0,
/* harmony default export */ const block_types_list = (BlockTypesList);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/panel.js
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "block-editor-inserter__panel-header",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", {
className: "block-editor-inserter__panel-title",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "block-editor-inserter__panel-content",
/* harmony default export */ const panel = (InserterPanel);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/index.js
CompositeV2: inserter_listbox_Composite,
useCompositeStoreV2: inserter_listbox_useCompositeStore
} = unlock(external_wp_components_namespaceObject.privateApis);
function InserterListbox({
const store = inserter_listbox_useCompositeStore({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox_Composite, {
render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {}),
/* harmony default export */ const inserter_listbox = (InserterListbox);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/no-results.js
function InserterNoResults() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "block-editor-inserter__no-results",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
className: "block-editor-inserter__no-results-icon",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('No results found.')
/* harmony default export */ const no_results = (InserterNoResults);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-types-tab.js
const getBlockNamespace = item => item.name.split('/')[0];
const MAX_SUGGESTED_ITEMS = 6;
* Shared reference to an empty array for cases where it is important to avoid
* returning a new array reference on every invocation and rerendering the component.
const block_types_tab_EMPTY_ARRAY = [];
function BlockTypesTabPanel({
const suggestedItems = (0,external_wp_element_namespaceObject.useMemo)(() => {
return orderBy(items, 'frecency', 'desc').slice(0, MAX_SUGGESTED_ITEMS);
const uncategorizedItems = (0,external_wp_element_namespaceObject.useMemo)(() => {
return items.filter(item => !item.category);
const itemsPerCollection = (0,external_wp_element_namespaceObject.useMemo)(() => {
// Create a new Object to avoid mutating collection.
Object.keys(collections).forEach(namespace => {
result[namespace] = items.filter(item => getBlockNamespace(item) === namespace);
if (result[namespace].length === 0) {
delete result[namespace];
}, [items, collections]);
// Hide block preview on unmount.
(0,external_wp_element_namespaceObject.useEffect)(() => () => onHover(null), []);
* The inserter contains a big number of blocks and opening it is a costful operation.
* The rendering is the most costful part of it, in order to improve the responsiveness
* of the "opening" action, these lazy lists allow us to render the inserter category per category,
* once all the categories are rendered, we start rendering the collections and the uncategorized block types.
const currentlyRenderedCategories = (0,external_wp_compose_namespaceObject.useAsyncList)(categories);
const didRenderAllCategories = categories.length === currentlyRenderedCategories.length;
// Async List requires an array.
const collectionEntries = (0,external_wp_element_namespaceObject.useMemo)(() => {
return Object.entries(collections);
const currentlyRenderedCollections = (0,external_wp_compose_namespaceObject.useAsyncList)(didRenderAllCategories ? collectionEntries : block_types_tab_EMPTY_ARRAY);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [showMostUsedBlocks &&
// Only show the most used blocks if the total amount of block
// is larger than 1 row, otherwise it is not so useful.
items.length > 3 && !!suggestedItems.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, {
title: (0,external_wp_i18n_namespaceObject._x)('Most used', 'blocks'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, {
label: (0,external_wp_i18n_namespaceObject._x)('Most used', 'blocks')
}), currentlyRenderedCategories.map(category => {
const categoryItems = items.filter(item => item.category === category.slug);
if (!categoryItems || !categoryItems.length) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, {
}), didRenderAllCategories && uncategorizedItems.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, {
className: "block-editor-inserter__uncategorized-blocks-panel",
title: (0,external_wp_i18n_namespaceObject.__)('Uncategorized'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, {
items: uncategorizedItems,
label: (0,external_wp_i18n_namespaceObject.__)('Uncategorized')
}), currentlyRenderedCollections.map(([namespace, collection]) => {
const collectionItems = itemsPerCollection[namespace];
if (!collectionItems || !collectionItems.length) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, {
const [items, categories, collections, onSelectItem] = use_block_types_state(rootClientId, onInsert);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {});
const itemsForCurrentRoot = [];
const itemsRemaining = [];
for (const item of items) {
// Skip reusable blocks, they moved to the patterns tab.
if (item.category === 'reusable') {
if (rootClientId && item.rootClientId === rootClientId) {
itemsForCurrentRoot.push(item);
itemsRemaining.push(item);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [!!itemsForCurrentRoot.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTypesTabPanel, {
items: itemsForCurrentRoot,
collections: collections,
onSelectItem: onSelectItem,
showMostUsedBlocks: showMostUsedBlocks,
className: "block-editor-inserter__insertable-blocks-at-selection"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTypesTabPanel, {
collections: collections,
onSelectItem: onSelectItem,
showMostUsedBlocks: showMostUsedBlocks,
className: "block-editor-inserter__all-blocks"
/* harmony default export */ const block_types_tab = ((0,external_wp_element_namespaceObject.forwardRef)(BlockTypesTab));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js
function PatternCategoriesList({
const baseClassName = 'block-editor-block-patterns-explorer__sidebar';
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: `${baseClassName}__categories-list`,
children: patternCategories.map(({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: `${baseClassName}__categories-list__item`,
isPressed: selectedCategory === name,
function PatternsExplorerSearch({
const baseClassName = 'block-editor-block-patterns-explorer__search';
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: baseClassName,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, {
__nextHasNoMarginBottom: true,
onChange: setSearchValue,
label: (0,external_wp_i18n_namespaceObject.__)('Search for patterns'),
placeholder: (0,external_wp_i18n_namespaceObject.__)('Search')
function PatternExplorerSidebar({
const baseClassName = 'block-editor-block-patterns-explorer__sidebar';
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: baseClassName,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsExplorerSearch, {
searchValue: searchValue,
setSearchValue: setSearchValue
}), !searchValue && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternCategoriesList, {
selectedCategory: selectedCategory,
patternCategories: patternCategories,
onClickCategory: onClickCategory
/* harmony default export */ const pattern_explorer_sidebar = (PatternExplorerSidebar);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-patterns-paging/index.js
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
className: "block-editor-patterns__grid-pagination-wrapper",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
// translators: %s: Total number of patterns.
(0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Total number of patterns.
(0,external_wp_i18n_namespaceObject._n)('%s item', '%s items', totalItems), totalItems)
}), numPages > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
className: "block-editor-patterns__grid-pagination",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
className: "block-editor-patterns__grid-pagination-previous",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
onClick: () => changePage(1),
disabled: currentPage === 1,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('First page'),
__experimentalIsFocusable: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
onClick: () => changePage(currentPage - 1),
disabled: currentPage === 1,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page'),
__experimentalIsFocusable: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %1$s: Current page number, %2$s: Total number of pages.
(0,external_wp_i18n_namespaceObject._x)('%1$s of %2$s', 'paging'), currentPage, numPages)
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
className: "block-editor-patterns__grid-pagination-next",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
onClick: () => changePage(currentPage + 1),
disabled: currentPage === numPages,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page'),
__experimentalIsFocusable: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
onClick: () => changePage(numPages),
disabled: currentPage === numPages,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Last page'),
__experimentalIsFocusable: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {