From 47f4a06c9094e753e44d1918c53b5050e413adb7 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Thu, 16 Jan 2020 18:19:00 +0100 Subject: [PATCH] Make it possible to apply initial attributes and inner blocks directly from the inserter --- .../src/components/block-types-list/index.js | 38 +++++++++++++++++-- .../components/inserter-list-item/index.js | 8 ++-- .../src/components/inserter/menu.js | 17 ++++++++- .../src/components/inserter/search-items.js | 26 +++++++------ .../components/inserter/test/search-items.js | 15 ++++++-- 5 files changed, 79 insertions(+), 25 deletions(-) diff --git a/packages/block-editor/src/components/block-types-list/index.js b/packages/block-editor/src/components/block-types-list/index.js index 4709fa81fa61b9..6cff8bb6145588 100644 --- a/packages/block-editor/src/components/block-types-list/index.js +++ b/packages/block-editor/src/components/block-types-list/index.js @@ -1,3 +1,8 @@ +/** + * External dependencies + */ +import { isEmpty } from 'lodash'; + /** * WordPress dependencies */ @@ -17,8 +22,36 @@ function BlockTypesList( { items, onSelect, onHover = () => {}, children } ) { /* eslint-disable jsx-a11y/no-redundant-roles */