From e116c0a424a70ae8465c1525870011ddc15b7b6b Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 2 Oct 2017 15:34:29 +0100 Subject: [PATCH] Framework: rename `editor/api` to `editor/block-api` and `editor/library` to `editor/blocks` --- bin/build-plugin-zip.sh | 2 +- bin/create-php-parser.js | 2 +- bin/get-server-block-attributes.php | 2 +- editor/{api => block-api}/categories.js | 0 editor/{api => block-api}/factory.js | 0 editor/{api => block-api}/index.js | 0 editor/{api => block-api}/parser.js | 0 .../{api => block-api}/paste/blockquote-normaliser.js | 0 editor/{api => block-api}/paste/comment-remover.js | 0 editor/{api => block-api}/paste/create-unwrapper.js | 0 .../{api => block-api}/paste/formatting-transformer.js | 0 editor/{api => block-api}/paste/image-corrector.js | 0 editor/{api => block-api}/paste/index.js | 0 editor/{api => block-api}/paste/is-inline-content.js | 0 editor/{api => block-api}/paste/list-merger.js | 0 editor/{api => block-api}/paste/ms-list-converter.js | 0 editor/{api => block-api}/paste/normalise-blocks.js | 0 editor/{api => block-api}/paste/strip-attributes.js | 0 .../paste/test/blockquote-normaliser.js | 0 .../{api => block-api}/paste/test/comment-remover.js | 0 .../{api => block-api}/paste/test/create-unwrapper.js | 0 .../paste/test/formatting-transformer.js | 0 .../{api => block-api}/paste/test/image-corrector.js | 0 editor/{api => block-api}/paste/test/index.js | 0 .../paste/test/integration/apple-in.html | 0 .../paste/test/integration/apple-out.html | 0 .../paste/test/integration/google-docs-in.html | 0 .../paste/test/integration/google-docs-out.html | 0 .../{api => block-api}/paste/test/integration/index.js | 2 +- .../paste/test/integration/ms-word-in.html | 0 .../paste/test/integration/ms-word-online-in.html | 0 .../paste/test/integration/ms-word-online-out.html | 0 .../paste/test/integration/ms-word-out.html | 0 .../paste/test/integration/plain-in.html | 0 .../paste/test/integration/plain-out.html | 0 .../{api => block-api}/paste/test/is-inline-content.js | 0 editor/{api => block-api}/paste/test/list-merger.js | 0 .../{api => block-api}/paste/test/ms-list-converter.js | 0 .../{api => block-api}/paste/test/normalise-blocks.js | 0 .../{api => block-api}/paste/test/strip-attributes.js | 0 editor/{api => block-api}/paste/test/utils.js | 0 editor/{api => block-api}/paste/utils.js | 0 editor/{api => block-api}/post.pegjs | 0 editor/{api => block-api}/registration.js | 0 editor/{api => block-api}/serializer.js | 0 editor/{api => block-api}/source.js | 0 editor/{api => block-api}/test/factory.js | 0 editor/{api => block-api}/test/parser.js | 0 editor/{api => block-api}/test/registration.js | 0 editor/{api => block-api}/test/serializer.js | 0 editor/{api => block-api}/test/source.js | 0 editor/{api => block-api}/test/validation.js | 0 editor/{api => block-api}/validation.js | 0 editor/block-autocomplete/index.js | 2 +- editor/block-autocomplete/test/index.js | 2 +- editor/block-mover/index.js | 2 +- editor/block-switcher/index.js | 2 +- editor/{library => blocks}/audio/index.js | 2 +- editor/{library => blocks}/audio/style.scss | 0 editor/{library => blocks}/button/editor.scss | 0 editor/{library => blocks}/button/index.js | 2 +- editor/{library => blocks}/button/style.scss | 0 editor/{library => blocks}/categories/data.js | 0 editor/{library => blocks}/categories/editor.scss | 0 editor/{library => blocks}/categories/index.js | 2 +- editor/{library => blocks}/categories/index.php | 0 editor/{library => blocks}/categories/style.scss | 0 editor/{library => blocks}/code/editor.scss | 0 editor/{library => blocks}/code/index.js | 2 +- editor/{library => blocks}/cover-image/editor.scss | 0 editor/{library => blocks}/cover-image/index.js | 2 +- editor/{library => blocks}/cover-image/style.scss | 0 editor/{library => blocks}/embed/editor.scss | 0 editor/{library => blocks}/embed/index.js | 2 +- editor/{library => blocks}/embed/style.scss | 0 editor/{library => blocks}/freeform/editor.scss | 0 editor/{library => blocks}/freeform/index.js | 2 +- editor/{library => blocks}/freeform/old-editor.js | 0 editor/{library => blocks}/gallery/block.js | 0 editor/{library => blocks}/gallery/editor.scss | 0 editor/{library => blocks}/gallery/gallery-image.js | 0 editor/{library => blocks}/gallery/index.js | 2 +- editor/{library => blocks}/gallery/style.scss | 0 editor/{library => blocks}/heading/editor.scss | 0 editor/{library => blocks}/heading/index.js | 2 +- editor/{library => blocks}/html/editor.scss | 0 editor/{library => blocks}/html/index.js | 2 +- editor/{library => blocks}/image/block.js | 0 editor/{library => blocks}/image/editor.scss | 0 editor/{library => blocks}/image/image-size.js | 0 editor/{library => blocks}/image/index.js | 2 +- editor/{library => blocks}/image/style.scss | 0 editor/{library => blocks}/index.js | 0 editor/{library => blocks}/latest-posts/data.js | 0 editor/{library => blocks}/latest-posts/editor.scss | 0 editor/{library => blocks}/latest-posts/index.js | 2 +- editor/{library => blocks}/latest-posts/index.php | 0 editor/{library => blocks}/latest-posts/style.scss | 0 editor/{library => blocks}/list/editor.scss | 0 editor/{library => blocks}/list/index.js | 2 +- editor/{library => blocks}/more/editor.scss | 0 editor/{library => blocks}/more/index.js | 2 +- editor/{library => blocks}/paragraph/index.js | 2 +- editor/{library => blocks}/paragraph/style.scss | 0 editor/{library => blocks}/preformatted/editor.scss | 0 editor/{library => blocks}/preformatted/index.js | 2 +- editor/{library => blocks}/pullquote/editor.scss | 0 editor/{library => blocks}/pullquote/index.js | 2 +- editor/{library => blocks}/pullquote/style.scss | 0 editor/{library => blocks}/quote/editor.scss | 0 editor/{library => blocks}/quote/index.js | 2 +- editor/{library => blocks}/quote/style.scss | 0 editor/{library => blocks}/separator/index.js | 2 +- editor/{library => blocks}/separator/style.scss | 0 editor/{library => blocks}/shortcode/editor.scss | 0 editor/{library => blocks}/shortcode/index.js | 2 +- editor/{library => blocks}/table/editor.scss | 0 editor/{library => blocks}/table/index.js | 2 +- editor/{library => blocks}/table/style.scss | 0 editor/{library => blocks}/table/table-block.js | 0 editor/{library => blocks}/text-columns/editor.scss | 0 editor/{library => blocks}/text-columns/index.js | 2 +- editor/{library => blocks}/text-columns/style.scss | 0 editor/{library => blocks}/verse/editor.scss | 0 editor/{library => blocks}/verse/index.js | 2 +- editor/{library => blocks}/video/index.js | 2 +- editor/{library => blocks}/video/style.scss | 0 editor/editable/index.js | 2 +- editor/editable/patterns.js | 2 +- editor/effects.js | 2 +- editor/index.js | 4 ++-- editor/inserter/index.js | 2 +- editor/inserter/menu.js | 2 +- editor/inserter/test/menu.js | 2 +- editor/modes/text-editor/index.js | 2 +- editor/modes/visual-editor/block-drop-zone.js | 2 +- editor/modes/visual-editor/block-list.js | 2 +- editor/modes/visual-editor/block.js | 2 +- editor/modes/visual-editor/inserter.js | 2 +- editor/modes/visual-editor/invalid-block-warning.js | 2 +- editor/modes/visual-editor/test/inserter.js | 2 +- editor/reducer.js | 2 +- editor/selectors.js | 2 +- editor/sidebar/block-inspector/advanced-controls.js | 2 +- editor/test/effects.js | 2 +- editor/test/full-content.js | 10 +++++----- editor/test/reducer.js | 4 ++-- editor/test/selectors.js | 2 +- editor/word-count/index.js | 2 +- gutenberg.php | 2 +- phpcs.xml.dist | 2 +- webpack.config.js | 6 +++--- 152 files changed, 65 insertions(+), 65 deletions(-) rename editor/{api => block-api}/categories.js (100%) rename editor/{api => block-api}/factory.js (100%) rename editor/{api => block-api}/index.js (100%) rename editor/{api => block-api}/parser.js (100%) rename editor/{api => block-api}/paste/blockquote-normaliser.js (100%) rename editor/{api => block-api}/paste/comment-remover.js (100%) rename editor/{api => block-api}/paste/create-unwrapper.js (100%) rename editor/{api => block-api}/paste/formatting-transformer.js (100%) rename editor/{api => block-api}/paste/image-corrector.js (100%) rename editor/{api => block-api}/paste/index.js (100%) rename editor/{api => block-api}/paste/is-inline-content.js (100%) rename editor/{api => block-api}/paste/list-merger.js (100%) rename editor/{api => block-api}/paste/ms-list-converter.js (100%) rename editor/{api => block-api}/paste/normalise-blocks.js (100%) rename editor/{api => block-api}/paste/strip-attributes.js (100%) rename editor/{api => block-api}/paste/test/blockquote-normaliser.js (100%) rename editor/{api => block-api}/paste/test/comment-remover.js (100%) rename editor/{api => block-api}/paste/test/create-unwrapper.js (100%) rename editor/{api => block-api}/paste/test/formatting-transformer.js (100%) rename editor/{api => block-api}/paste/test/image-corrector.js (100%) rename editor/{api => block-api}/paste/test/index.js (100%) rename editor/{api => block-api}/paste/test/integration/apple-in.html (100%) rename editor/{api => block-api}/paste/test/integration/apple-out.html (100%) rename editor/{api => block-api}/paste/test/integration/google-docs-in.html (100%) rename editor/{api => block-api}/paste/test/integration/google-docs-out.html (100%) rename editor/{api => block-api}/paste/test/integration/index.js (96%) rename editor/{api => block-api}/paste/test/integration/ms-word-in.html (100%) rename editor/{api => block-api}/paste/test/integration/ms-word-online-in.html (100%) rename editor/{api => block-api}/paste/test/integration/ms-word-online-out.html (100%) rename editor/{api => block-api}/paste/test/integration/ms-word-out.html (100%) rename editor/{api => block-api}/paste/test/integration/plain-in.html (100%) rename editor/{api => block-api}/paste/test/integration/plain-out.html (100%) rename editor/{api => block-api}/paste/test/is-inline-content.js (100%) rename editor/{api => block-api}/paste/test/list-merger.js (100%) rename editor/{api => block-api}/paste/test/ms-list-converter.js (100%) rename editor/{api => block-api}/paste/test/normalise-blocks.js (100%) rename editor/{api => block-api}/paste/test/strip-attributes.js (100%) rename editor/{api => block-api}/paste/test/utils.js (100%) rename editor/{api => block-api}/paste/utils.js (100%) rename editor/{api => block-api}/post.pegjs (100%) rename editor/{api => block-api}/registration.js (100%) rename editor/{api => block-api}/serializer.js (100%) rename editor/{api => block-api}/source.js (100%) rename editor/{api => block-api}/test/factory.js (100%) rename editor/{api => block-api}/test/parser.js (100%) rename editor/{api => block-api}/test/registration.js (100%) rename editor/{api => block-api}/test/serializer.js (100%) rename editor/{api => block-api}/test/source.js (100%) rename editor/{api => block-api}/test/validation.js (100%) rename editor/{api => block-api}/validation.js (100%) rename editor/{library => blocks}/audio/index.js (98%) rename editor/{library => blocks}/audio/style.scss (100%) rename editor/{library => blocks}/button/editor.scss (100%) rename editor/{library => blocks}/button/index.js (98%) rename editor/{library => blocks}/button/style.scss (100%) rename editor/{library => blocks}/categories/data.js (100%) rename editor/{library => blocks}/categories/editor.scss (100%) rename editor/{library => blocks}/categories/index.js (99%) rename editor/{library => blocks}/categories/index.php (100%) rename editor/{library => blocks}/categories/style.scss (100%) rename editor/{library => blocks}/code/editor.scss (100%) rename editor/{library => blocks}/code/index.js (95%) rename editor/{library => blocks}/cover-image/editor.scss (100%) rename editor/{library => blocks}/cover-image/index.js (98%) rename editor/{library => blocks}/cover-image/style.scss (100%) rename editor/{library => blocks}/embed/editor.scss (100%) rename editor/{library => blocks}/embed/index.js (99%) rename editor/{library => blocks}/embed/style.scss (100%) rename editor/{library => blocks}/freeform/editor.scss (100%) rename editor/{library => blocks}/freeform/index.js (96%) rename editor/{library => blocks}/freeform/old-editor.js (100%) rename editor/{library => blocks}/gallery/block.js (100%) rename editor/{library => blocks}/gallery/editor.scss (100%) rename editor/{library => blocks}/gallery/gallery-image.js (100%) rename editor/{library => blocks}/gallery/index.js (96%) rename editor/{library => blocks}/gallery/style.scss (100%) rename editor/{library => blocks}/heading/editor.scss (100%) rename editor/{library => blocks}/heading/index.js (98%) rename editor/{library => blocks}/html/editor.scss (100%) rename editor/{library => blocks}/html/index.js (96%) rename editor/{library => blocks}/image/block.js (100%) rename editor/{library => blocks}/image/editor.scss (100%) rename editor/{library => blocks}/image/image-size.js (100%) rename editor/{library => blocks}/image/index.js (96%) rename editor/{library => blocks}/image/style.scss (100%) rename editor/{library => blocks}/index.js (100%) rename editor/{library => blocks}/latest-posts/data.js (100%) rename editor/{library => blocks}/latest-posts/editor.scss (100%) rename editor/{library => blocks}/latest-posts/index.js (99%) rename editor/{library => blocks}/latest-posts/index.php (100%) rename editor/{library => blocks}/latest-posts/style.scss (100%) rename editor/{library => blocks}/list/editor.scss (100%) rename editor/{library => blocks}/list/index.js (99%) rename editor/{library => blocks}/more/editor.scss (100%) rename editor/{library => blocks}/more/index.js (96%) rename editor/{library => blocks}/paragraph/index.js (99%) rename editor/{library => blocks}/paragraph/style.scss (100%) rename editor/{library => blocks}/preformatted/editor.scss (100%) rename editor/{library => blocks}/preformatted/index.js (96%) rename editor/{library => blocks}/pullquote/editor.scss (100%) rename editor/{library => blocks}/pullquote/index.js (97%) rename editor/{library => blocks}/pullquote/style.scss (100%) rename editor/{library => blocks}/quote/editor.scss (100%) rename editor/{library => blocks}/quote/index.js (98%) rename editor/{library => blocks}/quote/style.scss (100%) rename editor/{library => blocks}/separator/index.js (93%) rename editor/{library => blocks}/separator/style.scss (100%) rename editor/{library => blocks}/shortcode/editor.scss (100%) rename editor/{library => blocks}/shortcode/index.js (96%) rename editor/{library => blocks}/table/editor.scss (100%) rename editor/{library => blocks}/table/index.js (97%) rename editor/{library => blocks}/table/style.scss (100%) rename editor/{library => blocks}/table/table-block.js (100%) rename editor/{library => blocks}/text-columns/editor.scss (100%) rename editor/{library => blocks}/text-columns/index.js (97%) rename editor/{library => blocks}/text-columns/style.scss (100%) rename editor/{library => blocks}/verse/editor.scss (100%) rename editor/{library => blocks}/verse/index.js (95%) rename editor/{library => blocks}/video/index.js (98%) rename editor/{library => blocks}/video/style.scss (100%) diff --git a/bin/build-plugin-zip.sh b/bin/build-plugin-zip.sh index 8b45a0ca5d59a7..6ee22b83110074 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 dfe396bf8ed60b..30cb93327f5d49 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 16037f8c8978e6..e22eb68ac60652 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 039e573da52180..7e6190ffe4b289 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 363b2f2f754fba..54b1b611ec4f0f 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 32a7fc528b0f66..39443cefc48dfa 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 665da532783613..a870a18d0b068e 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 aaa2b5a1da19f0..1be9a50c00e76e 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 671191335f7136..0661409d68e314 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 00436226fd550f..6b5942f783e8b0 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 7b7f0c9c407a12..72a2e96b8b6a69 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 4b53eef76fca81..3af6db98d848a2 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 112f56ac5bd506..7c57b545f0ee35 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 be06689c1789c7..1ae062f07b0df2 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 1df0c44a58d46e..8edf5feeb13246 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 b736e591c8160f..01d9f126aea342 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 5e4f01dc44d5a9..3e0e2b8ce15390 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 03d2ff3f386632..d13363b338d83d 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 31b2a3199da049..1615609f0c4af3 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 7ccdc7a2ee2aaf..7a2b636bcc2204 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 209cec1cefe49c..ac30168b3946ca 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 6f786892dce656..ec239fc508a0e9 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 b3550f18d26f69..6ec0439a1d771b 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 dc9e3bf8ac334a..b2c2575c0a6a0c 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 0312828f16b2e5..981729860ae04d 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 691c1942e981e4..c80cb6bd642ad3 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 e55005f9d19dc8..83ba60e6a3ee22 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 d36530e83b3808..3522f12e6cdb22 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 f2a9488246c8b5..0f12af9238d1c1 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 0e1b7c787cea47..0184efe9a7909e 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 65a4f9d40fd159..d06011bcea29b8 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 db99bea5e9e8b4..5cf03ba03027b2 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 13592bf9f03faa..9d942772b9ea7a 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 e7adec6d41228b..cd5dad989a0941 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 86ad97793a5fd8..a903eaea70eb9e 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 f5aef506c3310c..f4850dd0119cd2 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 e2955a639e01ca..383578c8ecaae0 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 d15356ed15eddd..22a80b0401f426 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 9554dc7982809a..8548b102fe21ee 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 4ba537d6f48471..ab4c02b9d50c50 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 f368a54ce67205..453e796c010ff2 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 ca2d1802dee8c0..30b8cfd1444d18 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 572160553ec99b..bff60e26f9fc39 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 0306cd96d6c765..97496c56a035d6 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 a5bde200f11777..2af9dc366c346b 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 3d2076e4b6d3c2..e74dc2f19efa44 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 9f77d29eed26df..6b0e5be2f096bf 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 702d46ca5a61f4..2546fb0a632f10 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 7d763067374200..84429e2f913d4a 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 3887da5c94f85f..a30ba020a27eaa 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 8ff5ba39df676d..589e0da898143a 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 74c64efb5c8583..477b56712e4039 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 8f66ec5e69f012..049a2fe03fcd15 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 a6e1980327f6e0..e178afc54a8ab0 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 fabf19b58b4935..7cd18bd89d19e1 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 533a871a233af9..77a373354151a0 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 f275b2a18c4d9d..dc24888c0b11a7 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 ), },