diff --git a/bin/build-plugin-zip.sh b/bin/build-plugin-zip.sh
index 8b45a0ca5d59a..6ee22b8311007 100755
--- a/bin/build-plugin-zip.sh
+++ b/bin/build-plugin-zip.sh
@@ -78,7 +78,7 @@ mv gutenberg.tmp.php gutenberg.php
zip -r gutenberg.zip \
gutenberg.php \
lib/*.php \
- editor/library/*/*.php \
+ editor/blocks/*/*.php \
post-content.js \
$vendor_scripts \
components/build/*.{js,map} \
diff --git a/bin/create-php-parser.js b/bin/create-php-parser.js
index dfe396bf8ed60..30cb93327f5d4 100755
--- a/bin/create-php-parser.js
+++ b/bin/create-php-parser.js
@@ -5,7 +5,7 @@ const phpegjs = require( 'phpegjs' );
const fs = require( 'fs' );
const path = require( 'path' );
-const peg = fs.readFileSync( 'editor/api/post.pegjs', 'utf8' );
+const peg = fs.readFileSync( 'editor/block-api/post.pegjs', 'utf8' );
const parser = pegjs.generate(
peg,
diff --git a/bin/get-server-block-attributes.php b/bin/get-server-block-attributes.php
index 16037f8c8978e..e22eb68ac6065 100755
--- a/bin/get-server-block-attributes.php
+++ b/bin/get-server-block-attributes.php
@@ -31,7 +31,7 @@ function register_block_type( $name, $args = array() ) {
}
// Register server-side code for individual blocks.
-foreach ( glob( dirname( dirname( __FILE__ ) ) . '/editor/library/*/index.php' ) as $block_logic ) {
+foreach ( glob( dirname( dirname( __FILE__ ) ) . '/editor/blocks/*/index.php' ) as $block_logic ) {
require_once $block_logic;
}
diff --git a/editor/api/categories.js b/editor/block-api/categories.js
similarity index 100%
rename from editor/api/categories.js
rename to editor/block-api/categories.js
diff --git a/editor/api/factory.js b/editor/block-api/factory.js
similarity index 100%
rename from editor/api/factory.js
rename to editor/block-api/factory.js
diff --git a/editor/api/index.js b/editor/block-api/index.js
similarity index 100%
rename from editor/api/index.js
rename to editor/block-api/index.js
diff --git a/editor/api/parser.js b/editor/block-api/parser.js
similarity index 100%
rename from editor/api/parser.js
rename to editor/block-api/parser.js
diff --git a/editor/api/paste/blockquote-normaliser.js b/editor/block-api/paste/blockquote-normaliser.js
similarity index 100%
rename from editor/api/paste/blockquote-normaliser.js
rename to editor/block-api/paste/blockquote-normaliser.js
diff --git a/editor/api/paste/comment-remover.js b/editor/block-api/paste/comment-remover.js
similarity index 100%
rename from editor/api/paste/comment-remover.js
rename to editor/block-api/paste/comment-remover.js
diff --git a/editor/api/paste/create-unwrapper.js b/editor/block-api/paste/create-unwrapper.js
similarity index 100%
rename from editor/api/paste/create-unwrapper.js
rename to editor/block-api/paste/create-unwrapper.js
diff --git a/editor/api/paste/formatting-transformer.js b/editor/block-api/paste/formatting-transformer.js
similarity index 100%
rename from editor/api/paste/formatting-transformer.js
rename to editor/block-api/paste/formatting-transformer.js
diff --git a/editor/api/paste/image-corrector.js b/editor/block-api/paste/image-corrector.js
similarity index 100%
rename from editor/api/paste/image-corrector.js
rename to editor/block-api/paste/image-corrector.js
diff --git a/editor/api/paste/index.js b/editor/block-api/paste/index.js
similarity index 100%
rename from editor/api/paste/index.js
rename to editor/block-api/paste/index.js
diff --git a/editor/api/paste/is-inline-content.js b/editor/block-api/paste/is-inline-content.js
similarity index 100%
rename from editor/api/paste/is-inline-content.js
rename to editor/block-api/paste/is-inline-content.js
diff --git a/editor/api/paste/list-merger.js b/editor/block-api/paste/list-merger.js
similarity index 100%
rename from editor/api/paste/list-merger.js
rename to editor/block-api/paste/list-merger.js
diff --git a/editor/api/paste/ms-list-converter.js b/editor/block-api/paste/ms-list-converter.js
similarity index 100%
rename from editor/api/paste/ms-list-converter.js
rename to editor/block-api/paste/ms-list-converter.js
diff --git a/editor/api/paste/normalise-blocks.js b/editor/block-api/paste/normalise-blocks.js
similarity index 100%
rename from editor/api/paste/normalise-blocks.js
rename to editor/block-api/paste/normalise-blocks.js
diff --git a/editor/api/paste/strip-attributes.js b/editor/block-api/paste/strip-attributes.js
similarity index 100%
rename from editor/api/paste/strip-attributes.js
rename to editor/block-api/paste/strip-attributes.js
diff --git a/editor/api/paste/test/blockquote-normaliser.js b/editor/block-api/paste/test/blockquote-normaliser.js
similarity index 100%
rename from editor/api/paste/test/blockquote-normaliser.js
rename to editor/block-api/paste/test/blockquote-normaliser.js
diff --git a/editor/api/paste/test/comment-remover.js b/editor/block-api/paste/test/comment-remover.js
similarity index 100%
rename from editor/api/paste/test/comment-remover.js
rename to editor/block-api/paste/test/comment-remover.js
diff --git a/editor/api/paste/test/create-unwrapper.js b/editor/block-api/paste/test/create-unwrapper.js
similarity index 100%
rename from editor/api/paste/test/create-unwrapper.js
rename to editor/block-api/paste/test/create-unwrapper.js
diff --git a/editor/api/paste/test/formatting-transformer.js b/editor/block-api/paste/test/formatting-transformer.js
similarity index 100%
rename from editor/api/paste/test/formatting-transformer.js
rename to editor/block-api/paste/test/formatting-transformer.js
diff --git a/editor/api/paste/test/image-corrector.js b/editor/block-api/paste/test/image-corrector.js
similarity index 100%
rename from editor/api/paste/test/image-corrector.js
rename to editor/block-api/paste/test/image-corrector.js
diff --git a/editor/api/paste/test/index.js b/editor/block-api/paste/test/index.js
similarity index 100%
rename from editor/api/paste/test/index.js
rename to editor/block-api/paste/test/index.js
diff --git a/editor/api/paste/test/integration/apple-in.html b/editor/block-api/paste/test/integration/apple-in.html
similarity index 100%
rename from editor/api/paste/test/integration/apple-in.html
rename to editor/block-api/paste/test/integration/apple-in.html
diff --git a/editor/api/paste/test/integration/apple-out.html b/editor/block-api/paste/test/integration/apple-out.html
similarity index 100%
rename from editor/api/paste/test/integration/apple-out.html
rename to editor/block-api/paste/test/integration/apple-out.html
diff --git a/editor/api/paste/test/integration/google-docs-in.html b/editor/block-api/paste/test/integration/google-docs-in.html
similarity index 100%
rename from editor/api/paste/test/integration/google-docs-in.html
rename to editor/block-api/paste/test/integration/google-docs-in.html
diff --git a/editor/api/paste/test/integration/google-docs-out.html b/editor/block-api/paste/test/integration/google-docs-out.html
similarity index 100%
rename from editor/api/paste/test/integration/google-docs-out.html
rename to editor/block-api/paste/test/integration/google-docs-out.html
diff --git a/editor/api/paste/test/integration/index.js b/editor/block-api/paste/test/integration/index.js
similarity index 96%
rename from editor/api/paste/test/integration/index.js
rename to editor/block-api/paste/test/integration/index.js
index 039e573da5218..7e6190ffe4b28 100644
--- a/editor/api/paste/test/integration/index.js
+++ b/editor/block-api/paste/test/integration/index.js
@@ -8,7 +8,7 @@ import path from 'path';
/**
* Internal dependencies
*/
-import '../../../../library';
+import '../../../../blocks';
import paste from '../../index';
import serialize from '../../../serializer';
diff --git a/editor/api/paste/test/integration/ms-word-in.html b/editor/block-api/paste/test/integration/ms-word-in.html
similarity index 100%
rename from editor/api/paste/test/integration/ms-word-in.html
rename to editor/block-api/paste/test/integration/ms-word-in.html
diff --git a/editor/api/paste/test/integration/ms-word-online-in.html b/editor/block-api/paste/test/integration/ms-word-online-in.html
similarity index 100%
rename from editor/api/paste/test/integration/ms-word-online-in.html
rename to editor/block-api/paste/test/integration/ms-word-online-in.html
diff --git a/editor/api/paste/test/integration/ms-word-online-out.html b/editor/block-api/paste/test/integration/ms-word-online-out.html
similarity index 100%
rename from editor/api/paste/test/integration/ms-word-online-out.html
rename to editor/block-api/paste/test/integration/ms-word-online-out.html
diff --git a/editor/api/paste/test/integration/ms-word-out.html b/editor/block-api/paste/test/integration/ms-word-out.html
similarity index 100%
rename from editor/api/paste/test/integration/ms-word-out.html
rename to editor/block-api/paste/test/integration/ms-word-out.html
diff --git a/editor/api/paste/test/integration/plain-in.html b/editor/block-api/paste/test/integration/plain-in.html
similarity index 100%
rename from editor/api/paste/test/integration/plain-in.html
rename to editor/block-api/paste/test/integration/plain-in.html
diff --git a/editor/api/paste/test/integration/plain-out.html b/editor/block-api/paste/test/integration/plain-out.html
similarity index 100%
rename from editor/api/paste/test/integration/plain-out.html
rename to editor/block-api/paste/test/integration/plain-out.html
diff --git a/editor/api/paste/test/is-inline-content.js b/editor/block-api/paste/test/is-inline-content.js
similarity index 100%
rename from editor/api/paste/test/is-inline-content.js
rename to editor/block-api/paste/test/is-inline-content.js
diff --git a/editor/api/paste/test/list-merger.js b/editor/block-api/paste/test/list-merger.js
similarity index 100%
rename from editor/api/paste/test/list-merger.js
rename to editor/block-api/paste/test/list-merger.js
diff --git a/editor/api/paste/test/ms-list-converter.js b/editor/block-api/paste/test/ms-list-converter.js
similarity index 100%
rename from editor/api/paste/test/ms-list-converter.js
rename to editor/block-api/paste/test/ms-list-converter.js
diff --git a/editor/api/paste/test/normalise-blocks.js b/editor/block-api/paste/test/normalise-blocks.js
similarity index 100%
rename from editor/api/paste/test/normalise-blocks.js
rename to editor/block-api/paste/test/normalise-blocks.js
diff --git a/editor/api/paste/test/strip-attributes.js b/editor/block-api/paste/test/strip-attributes.js
similarity index 100%
rename from editor/api/paste/test/strip-attributes.js
rename to editor/block-api/paste/test/strip-attributes.js
diff --git a/editor/api/paste/test/utils.js b/editor/block-api/paste/test/utils.js
similarity index 100%
rename from editor/api/paste/test/utils.js
rename to editor/block-api/paste/test/utils.js
diff --git a/editor/api/paste/utils.js b/editor/block-api/paste/utils.js
similarity index 100%
rename from editor/api/paste/utils.js
rename to editor/block-api/paste/utils.js
diff --git a/editor/api/post.pegjs b/editor/block-api/post.pegjs
similarity index 100%
rename from editor/api/post.pegjs
rename to editor/block-api/post.pegjs
diff --git a/editor/api/registration.js b/editor/block-api/registration.js
similarity index 100%
rename from editor/api/registration.js
rename to editor/block-api/registration.js
diff --git a/editor/api/serializer.js b/editor/block-api/serializer.js
similarity index 100%
rename from editor/api/serializer.js
rename to editor/block-api/serializer.js
diff --git a/editor/api/source.js b/editor/block-api/source.js
similarity index 100%
rename from editor/api/source.js
rename to editor/block-api/source.js
diff --git a/editor/api/test/factory.js b/editor/block-api/test/factory.js
similarity index 100%
rename from editor/api/test/factory.js
rename to editor/block-api/test/factory.js
diff --git a/editor/api/test/parser.js b/editor/block-api/test/parser.js
similarity index 100%
rename from editor/api/test/parser.js
rename to editor/block-api/test/parser.js
diff --git a/editor/api/test/registration.js b/editor/block-api/test/registration.js
similarity index 100%
rename from editor/api/test/registration.js
rename to editor/block-api/test/registration.js
diff --git a/editor/api/test/serializer.js b/editor/block-api/test/serializer.js
similarity index 100%
rename from editor/api/test/serializer.js
rename to editor/block-api/test/serializer.js
diff --git a/editor/api/test/source.js b/editor/block-api/test/source.js
similarity index 100%
rename from editor/api/test/source.js
rename to editor/block-api/test/source.js
diff --git a/editor/api/test/validation.js b/editor/block-api/test/validation.js
similarity index 100%
rename from editor/api/test/validation.js
rename to editor/block-api/test/validation.js
diff --git a/editor/api/validation.js b/editor/block-api/validation.js
similarity index 100%
rename from editor/api/validation.js
rename to editor/block-api/validation.js
diff --git a/editor/block-autocomplete/index.js b/editor/block-autocomplete/index.js
index 363b2f2f754fb..54b1b611ec4f0 100644
--- a/editor/block-autocomplete/index.js
+++ b/editor/block-autocomplete/index.js
@@ -8,7 +8,7 @@ import { Autocomplete } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
-import { createBlock, getBlockTypes } from '../api';
+import { createBlock, getBlockTypes } from '../block-api';
import BlockIcon from '../block-icon';
class BlockAutocomplete extends Component {
diff --git a/editor/block-autocomplete/test/index.js b/editor/block-autocomplete/test/index.js
index 32a7fc528b0f6..39443cefc48df 100644
--- a/editor/block-autocomplete/test/index.js
+++ b/editor/block-autocomplete/test/index.js
@@ -10,7 +10,7 @@ import BlockIcon from '../../block-icon';
import {
registerBlockType,
unregisterBlockType,
-} from '../../api';
+} from '../../block-api';
import BlockAutocomplete from '../';
describe( 'BlockAutocomplete', () => {
diff --git a/editor/block-mover/index.js b/editor/block-mover/index.js
index 665da53278361..a870a18d0b068 100644
--- a/editor/block-mover/index.js
+++ b/editor/block-mover/index.js
@@ -14,7 +14,7 @@ import { IconButton } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
-import { getBlockType } from '../api';
+import { getBlockType } from '../block-api';
import { isFirstBlock, isLastBlock, getBlockIndex, getBlock } from '../selectors';
import { getBlockMoverLabel } from './mover-label';
diff --git a/editor/block-switcher/index.js b/editor/block-switcher/index.js
index aaa2b5a1da19f..1be9a50c00e76 100644
--- a/editor/block-switcher/index.js
+++ b/editor/block-switcher/index.js
@@ -16,7 +16,7 @@ import { Dashicon, IconButton } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
-import { getBlockType, getBlockTypes, switchToBlockType } from '../api';
+import { getBlockType, getBlockTypes, switchToBlockType } from '../block-api';
import { replaceBlocks } from '../actions';
import { getBlock } from '../selectors';
diff --git a/editor/library/audio/index.js b/editor/blocks/audio/index.js
similarity index 98%
rename from editor/library/audio/index.js
rename to editor/blocks/audio/index.js
index 671191335f713..0661409d68e31 100644
--- a/editor/library/audio/index.js
+++ b/editor/blocks/audio/index.js
@@ -13,7 +13,7 @@ import { Component } from '@wordpress/element';
* Internal dependencies
*/
import './style.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import MediaUploadButton from '../../media-upload-button';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
diff --git a/editor/library/audio/style.scss b/editor/blocks/audio/style.scss
similarity index 100%
rename from editor/library/audio/style.scss
rename to editor/blocks/audio/style.scss
diff --git a/editor/library/button/editor.scss b/editor/blocks/button/editor.scss
similarity index 100%
rename from editor/library/button/editor.scss
rename to editor/blocks/button/editor.scss
diff --git a/editor/library/button/index.js b/editor/blocks/button/index.js
similarity index 98%
rename from editor/library/button/index.js
rename to editor/blocks/button/index.js
index 00436226fd550..6b5942f783e8b 100644
--- a/editor/library/button/index.js
+++ b/editor/blocks/button/index.js
@@ -9,7 +9,7 @@ import { IconButton } from '@wordpress/components';
*/
import './editor.scss';
import './style.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import Editable from '../../editable';
import UrlInput from '../../url-input';
import BlockControls from '../../block-controls';
diff --git a/editor/library/button/style.scss b/editor/blocks/button/style.scss
similarity index 100%
rename from editor/library/button/style.scss
rename to editor/blocks/button/style.scss
diff --git a/editor/library/categories/data.js b/editor/blocks/categories/data.js
similarity index 100%
rename from editor/library/categories/data.js
rename to editor/blocks/categories/data.js
diff --git a/editor/library/categories/editor.scss b/editor/blocks/categories/editor.scss
similarity index 100%
rename from editor/library/categories/editor.scss
rename to editor/blocks/categories/editor.scss
diff --git a/editor/library/categories/index.js b/editor/blocks/categories/index.js
similarity index 99%
rename from editor/library/categories/index.js
rename to editor/blocks/categories/index.js
index 7b7f0c9c407a1..72a2e96b8b6a6 100644
--- a/editor/library/categories/index.js
+++ b/editor/blocks/categories/index.js
@@ -11,7 +11,7 @@ import { times, unescape } from 'lodash';
*/
import './editor.scss';
import './style.scss';
-import { registerBlockType } from '../../api';
+import { registerBlockType } from '../../block-api';
import { getCategories } from './data.js';
import InspectorControls from '../../inspector-controls';
import ToggleControl from '../../inspector-controls/toggle-control';
diff --git a/editor/library/categories/index.php b/editor/blocks/categories/index.php
similarity index 100%
rename from editor/library/categories/index.php
rename to editor/blocks/categories/index.php
diff --git a/editor/library/categories/style.scss b/editor/blocks/categories/style.scss
similarity index 100%
rename from editor/library/categories/style.scss
rename to editor/blocks/categories/style.scss
diff --git a/editor/library/code/editor.scss b/editor/blocks/code/editor.scss
similarity index 100%
rename from editor/library/code/editor.scss
rename to editor/blocks/code/editor.scss
diff --git a/editor/library/code/index.js b/editor/blocks/code/index.js
similarity index 95%
rename from editor/library/code/index.js
rename to editor/blocks/code/index.js
index 4b53eef76fca8..3af6db98d848a 100644
--- a/editor/library/code/index.js
+++ b/editor/blocks/code/index.js
@@ -12,7 +12,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType, source, createBlock } from '../../api';
+import { registerBlockType, source, createBlock } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
diff --git a/editor/library/cover-image/editor.scss b/editor/blocks/cover-image/editor.scss
similarity index 100%
rename from editor/library/cover-image/editor.scss
rename to editor/blocks/cover-image/editor.scss
diff --git a/editor/library/cover-image/index.js b/editor/blocks/cover-image/index.js
similarity index 98%
rename from editor/library/cover-image/index.js
rename to editor/blocks/cover-image/index.js
index 112f56ac5bd50..7c57b545f0ee3 100644
--- a/editor/library/cover-image/index.js
+++ b/editor/blocks/cover-image/index.js
@@ -10,7 +10,7 @@ import classnames from 'classnames';
*/
import './editor.scss';
import './style.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import Editable from '../../editable';
import MediaUploadButton from '../../media-upload-button';
import BlockControls from '../../block-controls';
diff --git a/editor/library/cover-image/style.scss b/editor/blocks/cover-image/style.scss
similarity index 100%
rename from editor/library/cover-image/style.scss
rename to editor/blocks/cover-image/style.scss
diff --git a/editor/library/embed/editor.scss b/editor/blocks/embed/editor.scss
similarity index 100%
rename from editor/library/embed/editor.scss
rename to editor/blocks/embed/editor.scss
diff --git a/editor/library/embed/index.js b/editor/blocks/embed/index.js
similarity index 99%
rename from editor/library/embed/index.js
rename to editor/blocks/embed/index.js
index be06689c1789c..1ae062f07b0df 100644
--- a/editor/library/embed/index.js
+++ b/editor/blocks/embed/index.js
@@ -17,7 +17,7 @@ import { addQueryArgs } from '@wordpress/url';
*/
import './style.scss';
import './editor.scss';
-import { registerBlockType, source, createBlock } from '../../api';
+import { registerBlockType, source, createBlock } from '../../block-api';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
diff --git a/editor/library/embed/style.scss b/editor/blocks/embed/style.scss
similarity index 100%
rename from editor/library/embed/style.scss
rename to editor/blocks/embed/style.scss
diff --git a/editor/library/freeform/editor.scss b/editor/blocks/freeform/editor.scss
similarity index 100%
rename from editor/library/freeform/editor.scss
rename to editor/blocks/freeform/editor.scss
diff --git a/editor/library/freeform/index.js b/editor/blocks/freeform/index.js
similarity index 96%
rename from editor/library/freeform/index.js
rename to editor/blocks/freeform/index.js
index 1df0c44a58d46..8edf5feeb1324 100644
--- a/editor/library/freeform/index.js
+++ b/editor/blocks/freeform/index.js
@@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType, source, setUnknownTypeHandlerName } from '../../api';
+import { registerBlockType, source, setUnknownTypeHandlerName } from '../../block-api';
import OldEditor from './old-editor';
const { prop } = source;
diff --git a/editor/library/freeform/old-editor.js b/editor/blocks/freeform/old-editor.js
similarity index 100%
rename from editor/library/freeform/old-editor.js
rename to editor/blocks/freeform/old-editor.js
diff --git a/editor/library/gallery/block.js b/editor/blocks/gallery/block.js
similarity index 100%
rename from editor/library/gallery/block.js
rename to editor/blocks/gallery/block.js
diff --git a/editor/library/gallery/editor.scss b/editor/blocks/gallery/editor.scss
similarity index 100%
rename from editor/library/gallery/editor.scss
rename to editor/blocks/gallery/editor.scss
diff --git a/editor/library/gallery/gallery-image.js b/editor/blocks/gallery/gallery-image.js
similarity index 100%
rename from editor/library/gallery/gallery-image.js
rename to editor/blocks/gallery/gallery-image.js
diff --git a/editor/library/gallery/index.js b/editor/blocks/gallery/index.js
similarity index 96%
rename from editor/library/gallery/index.js
rename to editor/blocks/gallery/index.js
index b736e591c8160..01d9f126aea34 100644
--- a/editor/library/gallery/index.js
+++ b/editor/blocks/gallery/index.js
@@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
*/
import './editor.scss';
import './style.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import GalleryImage from './gallery-image';
import { default as GalleryBlock, defaultColumnsNumber } from './block';
diff --git a/editor/library/gallery/style.scss b/editor/blocks/gallery/style.scss
similarity index 100%
rename from editor/library/gallery/style.scss
rename to editor/blocks/gallery/style.scss
diff --git a/editor/library/heading/editor.scss b/editor/blocks/heading/editor.scss
similarity index 100%
rename from editor/library/heading/editor.scss
rename to editor/blocks/heading/editor.scss
diff --git a/editor/library/heading/index.js b/editor/blocks/heading/index.js
similarity index 98%
rename from editor/library/heading/index.js
rename to editor/blocks/heading/index.js
index 5e4f01dc44d5a..3e0e2b8ce1539 100644
--- a/editor/library/heading/index.js
+++ b/editor/blocks/heading/index.js
@@ -9,7 +9,7 @@ import { Toolbar } from '@wordpress/components';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType, createBlock, source } from '../../api';
+import { registerBlockType, createBlock, source } from '../../block-api';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
import InspectorControls from '../../inspector-controls';
diff --git a/editor/library/html/editor.scss b/editor/blocks/html/editor.scss
similarity index 100%
rename from editor/library/html/editor.scss
rename to editor/blocks/html/editor.scss
diff --git a/editor/library/html/index.js b/editor/blocks/html/index.js
similarity index 96%
rename from editor/library/html/index.js
rename to editor/blocks/html/index.js
index 03d2ff3f38663..d13363b338d83 100644
--- a/editor/library/html/index.js
+++ b/editor/blocks/html/index.js
@@ -13,7 +13,7 @@ import { Component } from '@wordpress/element';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import BlockControls from '../../block-controls';
const { html } = source;
diff --git a/editor/library/image/block.js b/editor/blocks/image/block.js
similarity index 100%
rename from editor/library/image/block.js
rename to editor/blocks/image/block.js
diff --git a/editor/library/image/editor.scss b/editor/blocks/image/editor.scss
similarity index 100%
rename from editor/library/image/editor.scss
rename to editor/blocks/image/editor.scss
diff --git a/editor/library/image/image-size.js b/editor/blocks/image/image-size.js
similarity index 100%
rename from editor/library/image/image-size.js
rename to editor/blocks/image/image-size.js
diff --git a/editor/library/image/index.js b/editor/blocks/image/index.js
similarity index 96%
rename from editor/library/image/index.js
rename to editor/blocks/image/index.js
index 31b2a3199da04..1615609f0c4af 100644
--- a/editor/library/image/index.js
+++ b/editor/blocks/image/index.js
@@ -9,7 +9,7 @@ import { createMediaFromFile } from '@wordpress/utils';
*/
import './style.scss';
import './editor.scss';
-import { registerBlockType, source, createBlock } from '../../api';
+import { registerBlockType, source, createBlock } from '../../block-api';
import ImageBlock from './block';
const { attr, children } = source;
diff --git a/editor/library/image/style.scss b/editor/blocks/image/style.scss
similarity index 100%
rename from editor/library/image/style.scss
rename to editor/blocks/image/style.scss
diff --git a/editor/library/index.js b/editor/blocks/index.js
similarity index 100%
rename from editor/library/index.js
rename to editor/blocks/index.js
diff --git a/editor/library/latest-posts/data.js b/editor/blocks/latest-posts/data.js
similarity index 100%
rename from editor/library/latest-posts/data.js
rename to editor/blocks/latest-posts/data.js
diff --git a/editor/library/latest-posts/editor.scss b/editor/blocks/latest-posts/editor.scss
similarity index 100%
rename from editor/library/latest-posts/editor.scss
rename to editor/blocks/latest-posts/editor.scss
diff --git a/editor/library/latest-posts/index.js b/editor/blocks/latest-posts/index.js
similarity index 99%
rename from editor/library/latest-posts/index.js
rename to editor/blocks/latest-posts/index.js
index 7ccdc7a2ee2aa..7a2b636bcc220 100644
--- a/editor/library/latest-posts/index.js
+++ b/editor/blocks/latest-posts/index.js
@@ -13,7 +13,7 @@ import classnames from 'classnames';
*/
import './editor.scss';
import './style.scss';
-import { registerBlockType } from '../../api';
+import { registerBlockType } from '../../block-api';
import { getLatestPosts } from './data.js';
import InspectorControls from '../../inspector-controls';
import TextControl from '../../inspector-controls/text-control';
diff --git a/editor/library/latest-posts/index.php b/editor/blocks/latest-posts/index.php
similarity index 100%
rename from editor/library/latest-posts/index.php
rename to editor/blocks/latest-posts/index.php
diff --git a/editor/library/latest-posts/style.scss b/editor/blocks/latest-posts/style.scss
similarity index 100%
rename from editor/library/latest-posts/style.scss
rename to editor/blocks/latest-posts/style.scss
diff --git a/editor/library/list/editor.scss b/editor/blocks/list/editor.scss
similarity index 100%
rename from editor/library/list/editor.scss
rename to editor/blocks/list/editor.scss
diff --git a/editor/library/list/index.js b/editor/blocks/list/index.js
similarity index 99%
rename from editor/library/list/index.js
rename to editor/blocks/list/index.js
index 209cec1cefe49..ac30168b3946c 100644
--- a/editor/library/list/index.js
+++ b/editor/blocks/list/index.js
@@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType, source, createBlock } from '../../api';
+import { registerBlockType, source, createBlock } from '../../block-api';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
import InspectorControls from '../../inspector-controls';
diff --git a/editor/library/more/editor.scss b/editor/blocks/more/editor.scss
similarity index 100%
rename from editor/library/more/editor.scss
rename to editor/blocks/more/editor.scss
diff --git a/editor/library/more/index.js b/editor/blocks/more/index.js
similarity index 96%
rename from editor/library/more/index.js
rename to editor/blocks/more/index.js
index 6f786892dce65..ec239fc508a0e 100644
--- a/editor/library/more/index.js
+++ b/editor/blocks/more/index.js
@@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType } from '../../api';
+import { registerBlockType } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
import ToggleControl from '../../inspector-controls/toggle-control';
diff --git a/editor/library/paragraph/index.js b/editor/blocks/paragraph/index.js
similarity index 99%
rename from editor/library/paragraph/index.js
rename to editor/blocks/paragraph/index.js
index b3550f18d26f6..6ec0439a1d771 100644
--- a/editor/library/paragraph/index.js
+++ b/editor/blocks/paragraph/index.js
@@ -14,7 +14,7 @@ import { PanelBody } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
-import { registerBlockType, createBlock, source, setDefaultBlockName } from '../../api';
+import { registerBlockType, createBlock, source, setDefaultBlockName } from '../../block-api';
import AlignmentToolbar from '../../alignment-toolbar';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
import BlockControls from '../../block-controls';
diff --git a/editor/library/paragraph/style.scss b/editor/blocks/paragraph/style.scss
similarity index 100%
rename from editor/library/paragraph/style.scss
rename to editor/blocks/paragraph/style.scss
diff --git a/editor/library/preformatted/editor.scss b/editor/blocks/preformatted/editor.scss
similarity index 100%
rename from editor/library/preformatted/editor.scss
rename to editor/blocks/preformatted/editor.scss
diff --git a/editor/library/preformatted/index.js b/editor/blocks/preformatted/index.js
similarity index 96%
rename from editor/library/preformatted/index.js
rename to editor/blocks/preformatted/index.js
index dc9e3bf8ac334..b2c2575c0a6a0 100644
--- a/editor/library/preformatted/index.js
+++ b/editor/blocks/preformatted/index.js
@@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType, createBlock, source } from '../../api';
+import { registerBlockType, createBlock, source } from '../../block-api';
import Editable from '../../editable';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
diff --git a/editor/library/pullquote/editor.scss b/editor/blocks/pullquote/editor.scss
similarity index 100%
rename from editor/library/pullquote/editor.scss
rename to editor/blocks/pullquote/editor.scss
diff --git a/editor/library/pullquote/index.js b/editor/blocks/pullquote/index.js
similarity index 97%
rename from editor/library/pullquote/index.js
rename to editor/blocks/pullquote/index.js
index 0312828f16b2e..981729860ae04 100644
--- a/editor/library/pullquote/index.js
+++ b/editor/blocks/pullquote/index.js
@@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
*/
import './editor.scss';
import './style.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
diff --git a/editor/library/pullquote/style.scss b/editor/blocks/pullquote/style.scss
similarity index 100%
rename from editor/library/pullquote/style.scss
rename to editor/blocks/pullquote/style.scss
diff --git a/editor/library/quote/editor.scss b/editor/blocks/quote/editor.scss
similarity index 100%
rename from editor/library/quote/editor.scss
rename to editor/blocks/quote/editor.scss
diff --git a/editor/library/quote/index.js b/editor/blocks/quote/index.js
similarity index 98%
rename from editor/library/quote/index.js
rename to editor/blocks/quote/index.js
index 691c1942e981e..c80cb6bd642ad 100644
--- a/editor/library/quote/index.js
+++ b/editor/blocks/quote/index.js
@@ -13,7 +13,7 @@ import { Toolbar } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
-import { registerBlockType, createBlock, source } from '../../api';
+import { registerBlockType, createBlock, source } from '../../block-api';
import AlignmentToolbar from '../../alignment-toolbar';
import BlockControls from '../../block-controls';
import Editable from '../../editable';
diff --git a/editor/library/quote/style.scss b/editor/blocks/quote/style.scss
similarity index 100%
rename from editor/library/quote/style.scss
rename to editor/blocks/quote/style.scss
diff --git a/editor/library/separator/index.js b/editor/blocks/separator/index.js
similarity index 93%
rename from editor/library/separator/index.js
rename to editor/blocks/separator/index.js
index e55005f9d19dc..83ba60e6a3ee2 100644
--- a/editor/library/separator/index.js
+++ b/editor/blocks/separator/index.js
@@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './style.scss';
-import { registerBlockType, createBlock } from '../../api';
+import { registerBlockType, createBlock } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
diff --git a/editor/library/separator/style.scss b/editor/blocks/separator/style.scss
similarity index 100%
rename from editor/library/separator/style.scss
rename to editor/blocks/separator/style.scss
diff --git a/editor/library/shortcode/editor.scss b/editor/blocks/shortcode/editor.scss
similarity index 100%
rename from editor/library/shortcode/editor.scss
rename to editor/blocks/shortcode/editor.scss
diff --git a/editor/library/shortcode/index.js b/editor/blocks/shortcode/index.js
similarity index 96%
rename from editor/library/shortcode/index.js
rename to editor/blocks/shortcode/index.js
index d36530e83b380..3522f12e6cdb2 100644
--- a/editor/library/shortcode/index.js
+++ b/editor/blocks/shortcode/index.js
@@ -8,7 +8,7 @@ import { withInstanceId, Dashicon } from '@wordpress/components';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
diff --git a/editor/library/table/editor.scss b/editor/blocks/table/editor.scss
similarity index 100%
rename from editor/library/table/editor.scss
rename to editor/blocks/table/editor.scss
diff --git a/editor/library/table/index.js b/editor/blocks/table/index.js
similarity index 97%
rename from editor/library/table/index.js
rename to editor/blocks/table/index.js
index f2a9488246c8b..0f12af9238d1c 100644
--- a/editor/library/table/index.js
+++ b/editor/blocks/table/index.js
@@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
*/
import './editor.scss';
import './style.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import TableBlock from './table-block';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
diff --git a/editor/library/table/style.scss b/editor/blocks/table/style.scss
similarity index 100%
rename from editor/library/table/style.scss
rename to editor/blocks/table/style.scss
diff --git a/editor/library/table/table-block.js b/editor/blocks/table/table-block.js
similarity index 100%
rename from editor/library/table/table-block.js
rename to editor/blocks/table/table-block.js
diff --git a/editor/library/text-columns/editor.scss b/editor/blocks/text-columns/editor.scss
similarity index 100%
rename from editor/library/text-columns/editor.scss
rename to editor/blocks/text-columns/editor.scss
diff --git a/editor/library/text-columns/index.js b/editor/blocks/text-columns/index.js
similarity index 97%
rename from editor/library/text-columns/index.js
rename to editor/blocks/text-columns/index.js
index 0e1b7c787cea4..0184efe9a7909 100644
--- a/editor/library/text-columns/index.js
+++ b/editor/blocks/text-columns/index.js
@@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n';
*/
import './style.scss';
import './editor.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import BlockControls from '../../block-controls';
import BlockAlignmentToolbar from '../../block-alignment-toolbar';
import RangeControl from '../../inspector-controls/range-control';
diff --git a/editor/library/text-columns/style.scss b/editor/blocks/text-columns/style.scss
similarity index 100%
rename from editor/library/text-columns/style.scss
rename to editor/blocks/text-columns/style.scss
diff --git a/editor/library/verse/editor.scss b/editor/blocks/verse/editor.scss
similarity index 100%
rename from editor/library/verse/editor.scss
rename to editor/blocks/verse/editor.scss
diff --git a/editor/library/verse/index.js b/editor/blocks/verse/index.js
similarity index 95%
rename from editor/library/verse/index.js
rename to editor/blocks/verse/index.js
index 65a4f9d40fd15..d06011bcea29b 100644
--- a/editor/library/verse/index.js
+++ b/editor/blocks/verse/index.js
@@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './editor.scss';
-import { registerBlockType, createBlock, source } from '../../api';
+import { registerBlockType, createBlock, source } from '../../block-api';
import Editable from '../../editable';
import InspectorControls from '../../inspector-controls';
import BlockDescription from '../../block-description';
diff --git a/editor/library/video/index.js b/editor/blocks/video/index.js
similarity index 98%
rename from editor/library/video/index.js
rename to editor/blocks/video/index.js
index db99bea5e9e8b..5cf03ba03027b 100644
--- a/editor/library/video/index.js
+++ b/editor/blocks/video/index.js
@@ -12,7 +12,7 @@ import { Placeholder, Toolbar, Dashicon } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
-import { registerBlockType, source } from '../../api';
+import { registerBlockType, source } from '../../block-api';
import MediaUploadButton from '../../media-upload-button';
import Editable from '../../editable';
import BlockControls from '../../block-controls';
diff --git a/editor/library/video/style.scss b/editor/blocks/video/style.scss
similarity index 100%
rename from editor/library/video/style.scss
rename to editor/blocks/video/style.scss
diff --git a/editor/editable/index.js b/editor/editable/index.js
index 13592bf9f03fa..9d942772b9ea7 100644
--- a/editor/editable/index.js
+++ b/editor/editable/index.js
@@ -28,7 +28,7 @@ import { keycodes } from '@wordpress/utils';
* Internal dependencies
*/
import './style.scss';
-import { pasteHandler } from '../api';
+import { pasteHandler } from '../block-api';
import FormatToolbar from './format-toolbar';
import TinyMCE from './tinymce';
import patterns from './patterns';
diff --git a/editor/editable/patterns.js b/editor/editable/patterns.js
index e7adec6d41228..cd5dad989a094 100644
--- a/editor/editable/patterns.js
+++ b/editor/editable/patterns.js
@@ -12,7 +12,7 @@ import { keycodes } from '@wordpress/utils';
/**
* Internal dependencies
*/
-import { getBlockTypes } from '../api/registration';
+import { getBlockTypes } from '../block-api/registration';
/**
* Browser dependencies
diff --git a/editor/effects.js b/editor/effects.js
index 86ad97793a5fd..a903eaea70eb9 100644
--- a/editor/effects.js
+++ b/editor/effects.js
@@ -12,7 +12,7 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
-import { parse, getBlockType, switchToBlockType } from './api';
+import { parse, getBlockType, switchToBlockType } from './block-api';
import { getGutenbergURL, getWPAdminURL } from './utils/url';
import {
resetPost,
diff --git a/editor/index.js b/editor/index.js
index f5aef506c3310..f4850dd0119cd 100644
--- a/editor/index.js
+++ b/editor/index.js
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
-import './library';
+import './blocks';
// A "block" is the abstract term used to describe units of markup that,
// when composed together, form the content or layout of a page.
@@ -12,7 +12,7 @@ import './library';
//
// Blocks are inferred from the HTML source of a post through a parsing mechanism
// and then stored as objects in state, from which it is then rendered for editing.
-export * from './api';
+export * from './block-api';
// Reusable Editor Components
export { default as AlignmentToolbar } from './alignment-toolbar';
diff --git a/editor/inserter/index.js b/editor/inserter/index.js
index e2955a639e01c..383578c8ecaae 100644
--- a/editor/inserter/index.js
+++ b/editor/inserter/index.js
@@ -14,7 +14,7 @@ import { Popover, IconButton } from '@wordpress/components';
* Internal dependencies
*/
import InserterMenu from './menu';
-import { createBlock } from '../api';
+import { createBlock } from '../block-api';
import { getBlockInsertionPoint, getEditorMode } from '../selectors';
import { insertBlock, hideInsertionPoint } from '../actions';
diff --git a/editor/inserter/menu.js b/editor/inserter/menu.js
index d15356ed15edd..22a80b0401f42 100644
--- a/editor/inserter/menu.js
+++ b/editor/inserter/menu.js
@@ -16,7 +16,7 @@ import { keycodes } from '@wordpress/utils';
* Internal dependencies
*/
import './style.scss';
-import { getCategories, getBlockTypes } from '../api';
+import { getCategories, getBlockTypes } from '../block-api';
import BlockIcon from '../block-icon';
import { getBlocks, getRecentlyUsedBlocks } from '../selectors';
import { showInsertionPoint, hideInsertionPoint } from '../actions';
diff --git a/editor/inserter/test/menu.js b/editor/inserter/test/menu.js
index 9554dc7982809..8548b102fe21e 100644
--- a/editor/inserter/test/menu.js
+++ b/editor/inserter/test/menu.js
@@ -7,7 +7,7 @@ import { noop } from 'lodash';
/**
* Internal dependencies
*/
-import { registerBlockType, unregisterBlockType, getBlockTypes } from '../../api';
+import { registerBlockType, unregisterBlockType, getBlockTypes } from '../../block-api';
import { InserterMenu, searchBlocks } from '../menu';
const textBlock = {
diff --git a/editor/modes/text-editor/index.js b/editor/modes/text-editor/index.js
index 4ba537d6f4847..ab4c02b9d50c5 100644
--- a/editor/modes/text-editor/index.js
+++ b/editor/modes/text-editor/index.js
@@ -14,7 +14,7 @@ import { Component } from '@wordpress/element';
* Internal dependencies
*/
import './style.scss';
-import { parse } from '../../api';
+import { parse } from '../../block-api';
import PostTitle from '../../post-title';
import { getEditedPostContent } from '../../selectors';
import { editPost, resetBlocks } from '../../actions';
diff --git a/editor/modes/visual-editor/block-drop-zone.js b/editor/modes/visual-editor/block-drop-zone.js
index f368a54ce6720..453e796c010ff 100644
--- a/editor/modes/visual-editor/block-drop-zone.js
+++ b/editor/modes/visual-editor/block-drop-zone.js
@@ -12,7 +12,7 @@ import { DropZone } from '@wordpress/components';
/**
* Internal dependencies
*/
-import { getBlockTypes } from '../../api';
+import { getBlockTypes } from '../../block-api';
import { insertBlocks } from '../../actions';
function BlockDropZone( { index, ...props } ) {
diff --git a/editor/modes/visual-editor/block-list.js b/editor/modes/visual-editor/block-list.js
index ca2d1802dee8c..30b8cfd1444d1 100644
--- a/editor/modes/visual-editor/block-list.js
+++ b/editor/modes/visual-editor/block-list.js
@@ -13,7 +13,7 @@ import { Component } from '@wordpress/element';
/**
* Internal dependencies
*/
-import { serialize, getDefaultBlockName, createBlock } from '../../api';
+import { serialize, getDefaultBlockName, createBlock } from '../../block-api';
import VisualEditorBlock from './block';
import BlockDropZone from './block-drop-zone';
import {
diff --git a/editor/modes/visual-editor/block.js b/editor/modes/visual-editor/block.js
index 572160553ec99..bff60e26f9fc3 100644
--- a/editor/modes/visual-editor/block.js
+++ b/editor/modes/visual-editor/block.js
@@ -18,7 +18,7 @@ import { __, sprintf } from '@wordpress/i18n';
/**
* Internal dependencies
*/
-import { getBlockType, getBlockDefaultClassname, createBlock } from '../../api';
+import { getBlockType, getBlockDefaultClassname, createBlock } from '../../block-api';
import InvalidBlockWarning from './invalid-block-warning';
import BlockCrashWarning from './block-crash-warning';
import BlockCrashBoundary from './block-crash-boundary';
diff --git a/editor/modes/visual-editor/inserter.js b/editor/modes/visual-editor/inserter.js
index 0306cd96d6c76..97496c56a035d 100644
--- a/editor/modes/visual-editor/inserter.js
+++ b/editor/modes/visual-editor/inserter.js
@@ -14,7 +14,7 @@ import { Component } from '@wordpress/element';
/**
* Internal dependencies
*/
-import { createBlock } from '../../api';
+import { createBlock } from '../../block-api';
import Inserter from '../../inserter';
import { insertBlock } from '../../actions';
diff --git a/editor/modes/visual-editor/invalid-block-warning.js b/editor/modes/visual-editor/invalid-block-warning.js
index a5bde200f1177..2af9dc366c346 100644
--- a/editor/modes/visual-editor/invalid-block-warning.js
+++ b/editor/modes/visual-editor/invalid-block-warning.js
@@ -21,7 +21,7 @@ import {
getBlockType,
getUnknownTypeHandlerName,
createBlock,
-} from '../../api';
+} from '../../block-api';
import { replaceBlock } from '../../actions';
function InvalidBlockWarning( { ignoreInvalid, switchToBlockType } ) {
diff --git a/editor/modes/visual-editor/test/inserter.js b/editor/modes/visual-editor/test/inserter.js
index 3d2076e4b6d3c..e74dc2f19efa4 100644
--- a/editor/modes/visual-editor/test/inserter.js
+++ b/editor/modes/visual-editor/test/inserter.js
@@ -10,7 +10,7 @@ import { VisualEditorInserter } from '../inserter';
describe( 'VisualEditorInserter', () => {
beforeAll( () => {
- require( '../../../library' );
+ require( '../../../blocks' );
} );
it( 'should show controls when receiving focus', () => {
diff --git a/editor/reducer.js b/editor/reducer.js
index 9f77d29eed26d..6b0e5be2f096b 100644
--- a/editor/reducer.js
+++ b/editor/reducer.js
@@ -8,7 +8,7 @@ import { get, reduce, keyBy, first, last, omit, without, mapValues } from 'lodas
/**
* Internal dependencies
*/
-import { getBlockTypes } from './api';
+import { getBlockTypes } from './block-api';
import { combineUndoableReducers } from './utils/undoable-reducer';
import { STORE_DEFAULTS } from './store-defaults';
diff --git a/editor/selectors.js b/editor/selectors.js
index 702d46ca5a61f..2546fb0a632f1 100644
--- a/editor/selectors.js
+++ b/editor/selectors.js
@@ -23,7 +23,7 @@ import { addQueryArgs } from '@wordpress/url';
/**
* Internal dependencies
*/
-import { serialize, getBlockType } from './api';
+import { serialize, getBlockType } from './block-api';
/**
* Returns the current editing mode.
diff --git a/editor/sidebar/block-inspector/advanced-controls.js b/editor/sidebar/block-inspector/advanced-controls.js
index 7d76306737420..84429e2f913d4 100644
--- a/editor/sidebar/block-inspector/advanced-controls.js
+++ b/editor/sidebar/block-inspector/advanced-controls.js
@@ -13,7 +13,7 @@ import { ClipboardButton, Tooltip, PanelBody } from '@wordpress/components';
/**
* Internal Dependencies
*/
-import { getBlockType } from '../../api';
+import { getBlockType } from '../../block-api';
import InspectorControls from '../../inspector-controls';
import { updateBlockAttributes } from '../../actions';
import { getSelectedBlock, getCurrentPost } from '../../selectors';
diff --git a/editor/test/effects.js b/editor/test/effects.js
index 3887da5c94f85..a30ba020a27ea 100644
--- a/editor/test/effects.js
+++ b/editor/test/effects.js
@@ -6,7 +6,7 @@ import { noop } from 'lodash';
/**
* Internal dependencies
*/
-import { getBlockTypes, unregisterBlockType, registerBlockType, createBlock } from '../api';
+import { getBlockTypes, unregisterBlockType, registerBlockType, createBlock } from '../block-api';
import {
resetPost,
setupNewPost,
diff --git a/editor/test/full-content.js b/editor/test/full-content.js
index 8ff5ba39df676..589e0da898143 100644
--- a/editor/test/full-content.js
+++ b/editor/test/full-content.js
@@ -9,10 +9,10 @@ import { format } from 'util';
/**
* Internal dependencies
*/
-import parse from '../api/parser';
-import { parse as grammarParse } from '../api/post.pegjs';
-import serialize from '../api/serializer';
-import { getBlockTypes } from '../api/registration';
+import parse from '../block-api/parser';
+import { parse as grammarParse } from '../block-api/post.pegjs';
+import serialize from '../block-api/serializer';
+import { getBlockTypes } from '../block-api/registration';
const fixturesDir = path.join( __dirname, 'fixtures' );
@@ -92,7 +92,7 @@ describe( 'full post content fixture', () => {
window._wpBlocksAttributes = require( './server-attributes.json' );
// Register all blocks.
- require( '../library' );
+ require( '../blocks' );
} );
fileBasenames.forEach( f => {
diff --git a/editor/test/reducer.js b/editor/test/reducer.js
index 74c64efb5c858..477b56712e403 100644
--- a/editor/test/reducer.js
+++ b/editor/test/reducer.js
@@ -7,7 +7,7 @@ import deepFreeze from 'deep-freeze';
/**
* Internal dependencies
*/
-import { registerBlockType, unregisterBlockType, getBlockType } from '../api';
+import { registerBlockType, unregisterBlockType, getBlockType } from '../block-api';
import {
getPostRawValue,
editor,
@@ -917,7 +917,7 @@ describe( 'state', () => {
describe( 'userData()', () => {
beforeAll( () => {
- require( '../library' );
+ require( '../blocks' );
registerBlockType( 'core/test-block', {
save: noop,
edit: noop,
diff --git a/editor/test/selectors.js b/editor/test/selectors.js
index 8f66ec5e69f01..049a2fe03fcd1 100644
--- a/editor/test/selectors.js
+++ b/editor/test/selectors.js
@@ -11,7 +11,7 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
-import { registerBlockType, unregisterBlockType } from '../api';
+import { registerBlockType, unregisterBlockType } from '../block-api';
import {
getEditorMode,
getPreference,
diff --git a/editor/word-count/index.js b/editor/word-count/index.js
index a6e1980327f6e..e178afc54a8ab 100644
--- a/editor/word-count/index.js
+++ b/editor/word-count/index.js
@@ -7,7 +7,7 @@ import { connect } from 'react-redux';
* Internal dependencies
*/
import { getBlocks } from '../selectors';
-import { serialize } from '../api';
+import { serialize } from '../block-api';
function WordCount( { content } ) {
const wordCount = wp.utils.WordCounter.prototype.count( content );
diff --git a/gutenberg.php b/gutenberg.php
index fabf19b58b493..7cd18bd89d19e 100644
--- a/gutenberg.php
+++ b/gutenberg.php
@@ -26,7 +26,7 @@
require_once dirname( __FILE__ ) . '/lib/register.php';
// Register server-side code for individual blocks.
- foreach ( glob( dirname( __FILE__ ) . '/editor/library/*/index.php' ) as $block_logic ) {
+ foreach ( glob( dirname( __FILE__ ) . '/editor/blocks/*/index.php' ) as $block_logic ) {
require_once $block_logic;
}
}
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 533a871a233af..77a373354151a 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -18,7 +18,7 @@
gutenberg.php
./lib
- ./editor/library
+ ./editor/blocks
./lib/parser.php
./phpunit
./bin
diff --git a/webpack.config.js b/webpack.config.js
index f275b2a18c4d9..dc24888c0b11a 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -104,21 +104,21 @@ const config = {
{
test: /style\.s?css$/,
include: [
- /editor\/library/,
+ /editor\/blocks/,
],
use: blocksCSSPlugin.extract( extractConfig ),
},
{
test: /editor\.s?css$/,
include: [
- /editor\/library/,
+ /editor\/blocks/,
],
use: editBlocksCSSPlugin.extract( extractConfig ),
},
{
test: /\.s?css$/,
exclude: [
- /editor\/library/,
+ /editor\/blocks/,
],
use: mainCSSExtractTextPlugin.extract( extractConfig ),
},