From 3db8496a131a53fb7b5e465dec50d4892aaa4cb4 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Tue, 1 May 2018 13:29:15 +0100 Subject: [PATCH 01/12] Framework: Move reusable block components from the blocks module to the editor module --- blocks/README.md | 110 ----------------- .../raw-handling/test/integration/index.js | 2 +- blocks/api/test/factory.js | 2 +- blocks/api/test/parser.js | 2 +- blocks/api/test/registration.js | 2 +- blocks/api/test/serializer.js | 6 +- blocks/contrast-checker/style.scss | 3 - blocks/index.js | 28 ----- blocks/index.native.js | 1 - core-blocks/audio/index.js | 4 +- core-blocks/block/index.js | 2 +- core-blocks/button/editor.scss | 10 +- core-blocks/button/index.js | 2 +- .../button/test/__snapshots__/index.js.snap | 6 +- core-blocks/categories/block.js | 2 +- core-blocks/code/edit.js | 2 +- core-blocks/code/edit.native.js | 2 +- core-blocks/code/editor.scss | 2 +- core-blocks/code/index.js | 4 +- .../code/test/__snapshots__/index.js.snap | 2 +- core-blocks/columns/index.js | 2 +- core-blocks/cover-image/editor.scss | 6 +- core-blocks/cover-image/index.js | 6 +- core-blocks/embed/index.js | 6 +- core-blocks/freeform/editor.scss | 2 +- core-blocks/gallery/block.js | 4 +- core-blocks/gallery/editor.scss | 6 +- core-blocks/gallery/gallery-image.js | 2 +- core-blocks/gallery/index.js | 2 +- core-blocks/heading/index.js | 5 +- .../heading/test/__snapshots__/index.js.snap | 6 +- core-blocks/html/index.js | 3 +- core-blocks/image/block.js | 6 +- core-blocks/image/editor.scss | 4 +- core-blocks/image/index.js | 2 +- core-blocks/latest-posts/block.js | 2 +- core-blocks/list/editor.scss | 6 +- core-blocks/list/index.js | 5 +- .../list/test/__snapshots__/index.js.snap | 6 +- core-blocks/more/index.js | 6 +- core-blocks/paragraph/index.js | 5 +- .../test/__snapshots__/index.js.snap | 6 +- core-blocks/preformatted/index.js | 7 +- .../test/__snapshots__/index.js.snap | 6 +- core-blocks/pullquote/editor.scss | 12 +- core-blocks/pullquote/index.js | 2 +- .../test/__snapshots__/index.js.snap | 6 +- core-blocks/quote/index.js | 5 +- .../quote/test/__snapshots__/index.js.snap | 6 +- core-blocks/shortcode/editor.scss | 2 +- core-blocks/shortcode/index.js | 2 +- .../test/__snapshots__/index.js.snap | 2 +- core-blocks/subhead/index.js | 6 +- core-blocks/table/index.js | 4 +- core-blocks/table/table-block.js | 2 +- .../table/test/__snapshots__/index.js.snap | 4 +- core-blocks/test/full-content.js | 2 +- core-blocks/test/helpers/index.js | 2 +- core-blocks/text-columns/editor.scss | 2 +- core-blocks/text-columns/index.js | 2 +- .../test/__snapshots__/index.js.snap | 12 +- core-blocks/verse/index.js | 6 +- .../verse/test/__snapshots__/index.js.snap | 6 +- core-blocks/video/index.js | 4 +- docs/extensibility/autocomplete.md | 2 +- .../assets/stylesheets/_admin-schemes.scss | 4 +- edit-post/assets/stylesheets/_z-index.scss | 9 +- editor/README.md | 111 ++++++++++++++++++ .../components}/alignment-toolbar/index.js | 0 .../test/__snapshots__/index.js.snap | 0 .../alignment-toolbar/test/index.js | 0 .../components}/autocomplete/README.md | 0 .../components}/autocomplete/index.js | 1 + .../components}/autocomplete/test/index.js | 0 .../components}/autocompleters/README.md | 0 .../components}/autocompleters/block.js | 8 +- .../components}/autocompleters/index.js | 0 .../components}/autocompleters/style.scss | 14 +-- .../components}/autocompleters/test/block.js | 6 +- .../components}/autocompleters/user.js | 8 +- .../block-alignment-toolbar/index.js | 6 +- .../test/__snapshots__/index.js.snap | 0 .../block-alignment-toolbar/test/index.js | 0 .../components}/block-controls/index.js | 0 .../test/__snapshots__/index.js.snap | 0 .../components}/block-controls/test/index.js | 0 .../components}/block-edit/context.js | 0 .../components}/block-edit/edit.js | 10 +- .../components}/block-edit/index.js | 0 .../components}/block-edit/test/edit.js | 10 +- .../block-format-controls/index.js | 0 .../components}/block-icon/index.js | 0 .../components}/block-icon/test/index.js | 0 editor/components/block-inspector/index.js | 10 +- editor/components/block-list/block.js | 2 +- editor/components/block-preview/index.js | 3 +- editor/components/block-switcher/index.js | 3 +- editor/components/block-toolbar/index.js | 3 +- .../components}/color-palette/index.js | 2 +- .../color-palette/with-color-context.js | 9 +- {blocks => editor/components}/colors/index.js | 0 {blocks => editor/components}/colors/utils.js | 0 .../components}/colors/with-colors.js | 2 +- .../components}/contrast-checker/index.js | 2 +- editor/components/contrast-checker/style.scss | 3 + .../test/__snapshots__/index.js.snap | 6 +- .../contrast-checker/test/index.js | 0 .../components}/image-placeholder/index.js | 3 +- editor/components/index.js | 25 ++++ .../components}/inner-blocks/README.md | 0 .../components}/inner-blocks/index.js | 0 .../inserter-with-shortcuts/index.js | 3 +- editor/components/inserter/group.js | 6 +- .../inspector-advanced-controls/index.js | 0 .../components}/inspector-controls/index.js | 0 .../components}/media-upload/README.md | 2 +- .../components}/media-upload/index.js | 1 + .../components}/panel-color/index.js | 2 +- .../components}/plain-text/README.md | 0 .../components}/plain-text/index.js | 2 +- .../components}/plain-text/index.native.js | 0 .../components}/plain-text/style.native.scss | 0 .../components}/plain-text/style.scss | 2 +- .../components/post-featured-image/index.js | 2 +- editor/components/provider/index.js | 7 +- .../components}/rich-text/README.md | 0 .../components}/rich-text/aria.js | 0 .../components}/rich-text/constants.js | 0 .../rich-text/format-toolbar/index.js | 22 ++-- .../rich-text/format-toolbar/style.scss | 18 +-- .../components}/rich-text/format.js | 0 .../components}/rich-text/index.js | 6 +- .../components}/rich-text/patterns.js | 2 +- .../components}/rich-text/provider.js | 0 .../components}/rich-text/style.scss | 7 +- .../test/__snapshots__/format.js.snap | 0 .../components}/rich-text/test/format.js | 0 .../components}/rich-text/test/index.js | 0 .../components}/rich-text/tinymce.js | 4 +- .../components}/url-input/button.js | 8 +- .../components}/url-input/index.js | 14 +-- .../components}/url-input/style.scss | 18 +-- .../components}/url-input/test/button.js | 4 +- {blocks => editor}/hooks/align.js | 5 +- {blocks => editor}/hooks/anchor.js | 4 +- {blocks => editor}/hooks/custom-class-name.js | 4 +- .../hooks/default-autocompleters.js | 4 +- .../hooks/generated-class-name.js | 6 +- {blocks => editor}/hooks/index.js | 0 {blocks => editor}/hooks/layout.js | 0 {blocks => editor}/hooks/test/align.js | 10 +- {blocks => editor}/hooks/test/anchor.js | 0 .../hooks/test/custom-class-name.js | 0 .../hooks/test/default-autocompleters.js | 2 +- .../hooks/test/generated-class-name.js | 0 {blocks => editor}/hooks/test/layout.js | 0 editor/index.js | 1 + editor/index.native.js | 1 + lib/client-assets.php | 38 ++---- 159 files changed, 418 insertions(+), 443 deletions(-) delete mode 100644 blocks/contrast-checker/style.scss rename {blocks => editor/components}/alignment-toolbar/index.js (100%) rename {blocks => editor/components}/alignment-toolbar/test/__snapshots__/index.js.snap (100%) rename {blocks => editor/components}/alignment-toolbar/test/index.js (100%) rename {blocks => editor/components}/autocomplete/README.md (100%) rename {blocks => editor/components}/autocomplete/index.js (99%) rename {blocks => editor/components}/autocomplete/test/index.js (100%) rename {blocks => editor/components}/autocompleters/README.md (100%) rename {blocks => editor/components}/autocompleters/block.js (88%) rename {blocks => editor/components}/autocompleters/index.js (100%) rename {blocks => editor/components}/autocompleters/style.scss (70%) rename {blocks => editor/components}/autocompleters/test/block.js (97%) rename {blocks => editor/components}/autocompleters/user.js (72%) rename {blocks => editor/components}/block-alignment-toolbar/index.js (93%) rename {blocks => editor/components}/block-alignment-toolbar/test/__snapshots__/index.js.snap (100%) rename {blocks => editor/components}/block-alignment-toolbar/test/index.js (100%) rename {blocks => editor/components}/block-controls/index.js (100%) rename {blocks => editor/components}/block-controls/test/__snapshots__/index.js.snap (100%) rename {blocks => editor/components}/block-controls/test/index.js (100%) rename {blocks => editor/components}/block-edit/context.js (100%) rename {blocks => editor/components}/block-edit/edit.js (88%) rename {blocks => editor/components}/block-edit/index.js (100%) rename {blocks => editor/components}/block-edit/test/edit.js (96%) rename {blocks => editor/components}/block-format-controls/index.js (100%) rename {blocks => editor/components}/block-icon/index.js (100%) rename {blocks => editor/components}/block-icon/test/index.js (100%) rename {blocks => editor/components}/color-palette/index.js (76%) rename blocks/with-color-context/index.js => editor/components/color-palette/with-color-context.js (86%) rename {blocks => editor/components}/colors/index.js (100%) rename {blocks => editor/components}/colors/utils.js (100%) rename {blocks => editor/components}/colors/with-colors.js (95%) rename {blocks => editor/components}/contrast-checker/index.js (96%) create mode 100644 editor/components/contrast-checker/style.scss rename {blocks => editor/components}/contrast-checker/test/__snapshots__/index.js.snap (94%) rename {blocks => editor/components}/contrast-checker/test/index.js (100%) rename {blocks => editor/components}/image-placeholder/index.js (95%) rename {blocks => editor/components}/inner-blocks/README.md (100%) rename {blocks => editor/components}/inner-blocks/index.js (100%) rename {blocks => editor/components}/inspector-advanced-controls/index.js (100%) rename {blocks => editor/components}/inspector-controls/index.js (100%) rename {blocks => editor/components}/media-upload/README.md (97%) rename {blocks => editor/components}/media-upload/index.js (95%) rename {blocks => editor/components}/panel-color/index.js (92%) rename {blocks => editor/components}/plain-text/README.md (100%) rename {blocks => editor/components}/plain-text/index.js (86%) rename {blocks => editor/components}/plain-text/index.native.js (100%) rename {blocks => editor/components}/plain-text/style.native.scss (100%) rename {blocks => editor/components}/plain-text/style.scss (83%) rename {blocks => editor/components}/rich-text/README.md (100%) rename {blocks => editor/components}/rich-text/aria.js (100%) rename {blocks => editor/components}/rich-text/constants.js (100%) rename {blocks => editor/components}/rich-text/format-toolbar/index.js (92%) rename {blocks => editor/components}/rich-text/format-toolbar/style.scss (72%) rename {blocks => editor/components}/rich-text/format.js (100%) rename {blocks => editor/components}/rich-text/index.js (99%) rename {blocks => editor/components}/rich-text/patterns.js (98%) rename {blocks => editor/components}/rich-text/provider.js (100%) rename {blocks => editor/components}/rich-text/style.scss (94%) rename {blocks => editor/components}/rich-text/test/__snapshots__/format.js.snap (100%) rename {blocks => editor/components}/rich-text/test/format.js (100%) rename {blocks => editor/components}/rich-text/test/index.js (100%) rename {blocks => editor/components}/rich-text/tinymce.js (97%) rename {blocks => editor/components}/url-input/button.js (88%) rename {blocks => editor/components}/url-input/index.js (92%) rename {blocks => editor/components}/url-input/style.scss (81%) rename {blocks => editor/components}/url-input/test/button.js (95%) rename {blocks => editor}/hooks/align.js (95%) rename {blocks => editor}/hooks/anchor.js (96%) rename {blocks => editor}/hooks/custom-class-name.js (96%) rename {blocks => editor}/hooks/default-autocompleters.js (84%) rename {blocks => editor}/hooks/generated-class-name.js (92%) rename {blocks => editor}/hooks/index.js (100%) rename {blocks => editor}/hooks/layout.js (100%) rename {blocks => editor}/hooks/test/align.js (99%) rename {blocks => editor}/hooks/test/anchor.js (100%) rename {blocks => editor}/hooks/test/custom-class-name.js (100%) rename {blocks => editor}/hooks/test/default-autocompleters.js (96%) rename {blocks => editor}/hooks/test/generated-class-name.js (100%) rename {blocks => editor}/hooks/test/layout.js (100%) create mode 100644 editor/index.native.js diff --git a/blocks/README.md b/blocks/README.md index 8ce7772cdeb4c..77a7624ed0a06 100644 --- a/blocks/README.md +++ b/blocks/README.md @@ -263,113 +263,3 @@ Returns type definitions associated with a registered block. Returns settings associated with a registered control. -## Components - -Because many blocks share the same complex behaviors, the following components -are made available to simplify implementations of your block's `edit` function. - -### `BlockControls` - -When returned by your block's `edit` implementation, renders a toolbar of icon -buttons. This is useful for block-level modifications to be made available when -a block is selected. For example, if your block supports alignment, you may -want to display alignment options in the selected block's toolbar. - -Example: - -```js -( function( blocks, element ) { - var el = element.createElement, - BlockControls = blocks.BlockControls, - AlignmentToolbar = blocks.AlignmentToolbar; - - function edit( props ) { - return [ - // Controls: (only visible when block is selected) - el( BlockControls, { key: 'controls' }, - el( AlignmentToolbar, { - value: props.align, - onChange: function( nextAlign ) { - props.setAttributes( { align: nextAlign } ) - } - } ) - ), - - // Block content: (with alignment as attribute) - el( 'p', { key: 'text', style: { textAlign: props.align } }, - 'Hello World!' - ), - ]; - } -} )( - window.wp.blocks, - window.wp.element -); -``` - -Note in this example that we render `AlignmentToolbar` as a child of the -`BlockControls` element. This is another pre-configured component you can use -to simplify block text alignment. - -Alternatively, you can create your own toolbar controls by passing an array of -`controls` as a prop to the `BlockControls` component. Each control should be -an object with the following properties: - -- `icon: string` - Slug of the Dashicon to be shown in the control's toolbar button -- `title: string` - A human-readable localized text to be shown as the tooltip label of the control's button -- `subscript: ?string` - Optional text to be shown adjacent the button icon as subscript (for example, heading levels) -- `isActive: ?boolean` - Whether the control should be considered active / selected. Defaults to `false`. - -To create divisions between sets of controls within the same `BlockControls` -element, passing `controls` instead as a nested array (array of arrays of -objects). A divider will be shown between each set of controls. - -### `RichText` - -Render a rich -[`contenteditable` input](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content), -providing users the option to add emphasis to content or links to content. It -behaves similarly to a -[controlled component](https://facebook.github.io/react/docs/forms.html#controlled-components), -except that `onChange` is triggered less frequently than would be expected from -a traditional `input` field, usually when the user exits the field. - -The following properties (non-exhaustive list) are made available: - -- `value: string` - Markup value of the field. Only valid markup is - allowed, as determined by `inline` value and available controls. -- `onChange: Function` - Callback handler when the value of the field changes, - passing the new value as its only argument. -- `placeholder: string` - A text hint to be shown to the user when the field - value is empty, similar to the - [`input` and `textarea` attribute of the same name](https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/HTML5_updates#The_placeholder_attribute). -- `multiline: String` - A tag name to use for the tag that should be inserted - when Enter is pressed. For example: `li` in a list block, and `p` for a - block that can contain multiple paragraphs. The default is that only inline - elements are allowed to be used in inserted into the text, effectively - disabling the behavior of the "Enter" key. - -Example: - -```js -( function( blocks, element ) { - var el = element.createElement, - RichText = blocks.RichText; - - function edit( props ) { - function onChange( value ) { - props.setAttributes( { text: value } ); - } - - return el( RichText, { - value: props.attributes.text, - onChange: onChange - } ); - } - - // blocks.registerBlockType( ..., { edit: edit, ... } ); -} )( - window.wp.blocks, - window.wp.element -); -``` diff --git a/blocks/api/raw-handling/test/integration/index.js b/blocks/api/raw-handling/test/integration/index.js index 2dc567ad10895..2a66cf04a5ff6 100644 --- a/blocks/api/raw-handling/test/integration/index.js +++ b/blocks/api/raw-handling/test/integration/index.js @@ -34,7 +34,7 @@ function readFile( filePath ) { describe( 'raw handling: integration', () => { beforeAll( () => { // Load all hooks that modify blocks - require( 'blocks/hooks' ); + require( 'editor/hooks' ); registerCoreBlocks(); } ); diff --git a/blocks/api/test/factory.js b/blocks/api/test/factory.js index 98f44734cd379..553d337245fd0 100644 --- a/blocks/api/test/factory.js +++ b/blocks/api/test/factory.js @@ -31,7 +31,7 @@ describe( 'block factory', () => { beforeAll( () => { // Load all hooks that modify blocks - require( 'blocks/hooks' ); + require( 'editor/hooks' ); } ); afterEach( () => { diff --git a/blocks/api/test/parser.js b/blocks/api/test/parser.js index 36208909138aa..1eacdc317e37f 100644 --- a/blocks/api/test/parser.js +++ b/blocks/api/test/parser.js @@ -43,7 +43,7 @@ describe( 'block parser', () => { beforeAll( () => { // Load all hooks that modify blocks - require( 'blocks/hooks' ); + require( 'editor/hooks' ); } ); afterEach( () => { diff --git a/blocks/api/test/registration.js b/blocks/api/test/registration.js index e68e8471c3220..0c6317ba11c96 100644 --- a/blocks/api/test/registration.js +++ b/blocks/api/test/registration.js @@ -30,7 +30,7 @@ describe( 'blocks', () => { beforeAll( () => { // Load all hooks that modify blocks - require( 'blocks/hooks' ); + require( 'editor/hooks' ); } ); afterEach( () => { diff --git a/blocks/api/test/serializer.js b/blocks/api/test/serializer.js index 78a8394e6e41a..345c3ef3cc2f7 100644 --- a/blocks/api/test/serializer.js +++ b/blocks/api/test/serializer.js @@ -23,12 +23,14 @@ import { setUnknownTypeHandlerName, } from '../registration'; import { createBlock } from '../'; -import InnerBlocks from '../../inner-blocks'; + +// Todo: move the test to the inner-blocks folder +import InnerBlocks from '../../../editor/components/inner-blocks'; describe( 'block serializer', () => { beforeAll( () => { // Load all hooks that modify blocks - require( 'blocks/hooks' ); + require( 'editor/hooks' ); } ); afterEach( () => { diff --git a/blocks/contrast-checker/style.scss b/blocks/contrast-checker/style.scss deleted file mode 100644 index 2456bd495e4ec..0000000000000 --- a/blocks/contrast-checker/style.scss +++ /dev/null @@ -1,3 +0,0 @@ -.blocks-contrast-checker > .notice { - margin: 0; -} diff --git a/blocks/index.js b/blocks/index.js index e36deba7e0281..624f66f8396ad 100644 --- a/blocks/index.js +++ b/blocks/index.js @@ -1,8 +1,3 @@ -/** - * Internal dependencies - */ -import './hooks'; - // A "block" is the abstract term used to describe units of markup that, // when composed together, form the content or layout of a page. // The API for blocks is exposed via `wp.blocks`. @@ -13,29 +8,6 @@ import './hooks'; // 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 './autocompleters'; -export * from './colors'; export { default as editorMediaUpload } from './editor-media-upload'; -export { default as AlignmentToolbar } from './alignment-toolbar'; -export { default as Autocomplete } from './autocomplete'; -export { default as BlockAlignmentToolbar } from './block-alignment-toolbar'; -export { default as BlockControls } from './block-controls'; -export { default as BlockFormatControls } from './block-format-controls'; -export { default as BlockEdit } from './block-edit'; -export { default as BlockIcon } from './block-icon'; -export { default as ColorPalette } from './color-palette'; -export { default as ContrastChecker } from './contrast-checker'; -export { default as ImagePlaceholder } from './image-placeholder'; -export { default as InnerBlocks } from './inner-blocks'; -export { default as InspectorControls } from './inspector-controls'; -export { default as InspectorAdvancedControls } from './inspector-advanced-controls'; -export { default as PlainText } from './plain-text'; -export { default as MediaUpload } from './media-upload'; -export { default as RichText } from './rich-text'; -export { default as RichTextProvider } from './rich-text/provider'; -export { default as UrlInput } from './url-input'; -export { default as UrlInputButton } from './url-input/button'; export { default as EditorSettings, withEditorSettings } from './editor-settings'; -export { default as PanelColor } from './panel-color'; -export { default as withColorContext } from './with-color-context'; diff --git a/blocks/index.native.js b/blocks/index.native.js index c949cf17d0a2a..2219a7dcfd3a9 100644 --- a/blocks/index.native.js +++ b/blocks/index.native.js @@ -9,4 +9,3 @@ // and then stored as objects in state, from which it is then rendered for editing. export * from './api'; -export { default as PlainText } from './plain-text'; diff --git a/core-blocks/audio/index.js b/core-blocks/audio/index.js index 6f0f47fe37110..955a72ae528c8 100644 --- a/core-blocks/audio/index.js +++ b/core-blocks/audio/index.js @@ -10,12 +10,12 @@ import { Toolbar, } from '@wordpress/components'; import { Component, Fragment } from '@wordpress/element'; +import { editorMediaUpload } from '@wordpress/blocks'; import { - editorMediaUpload, MediaUpload, RichText, BlockControls, -} from '@wordpress/blocks'; +} from '@wordpress/editor'; /** * Internal dependencies diff --git a/core-blocks/block/index.js b/core-blocks/block/index.js index 971ee4e3cd4d4..1ae8a3c345cbd 100644 --- a/core-blocks/block/index.js +++ b/core-blocks/block/index.js @@ -10,7 +10,7 @@ import { Component, Fragment, compose } from '@wordpress/element'; import { Placeholder, Spinner, Disabled } from '@wordpress/components'; import { withSelect, withDispatch } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; -import { BlockEdit } from '@wordpress/blocks'; +import { BlockEdit } from '@wordpress/editor'; /** * Internal dependencies diff --git a/core-blocks/button/editor.scss b/core-blocks/button/editor.scss index 2522496515dc5..a899a488b36f6 100644 --- a/core-blocks/button/editor.scss +++ b/core-blocks/button/editor.scss @@ -13,7 +13,7 @@ margin-bottom: 0; position: relative; - .blocks-rich-text__tinymce { + .editor-rich-text__tinymce { cursor: text; } } @@ -30,13 +30,13 @@ $blocks-button__link-input-width: 280px; width: $blocks-button__link-input-width; - .blocks-url-input { + .editor-url-input { width: auto; } - .blocks-url-input__suggestions { + .editor-url-input__suggestions { width: $blocks-button__link-input-width - $icon-button-size - $icon-button-size; - z-index: z-index( '.blocks-button__inline-link .blocks-url-input__suggestions' ); + z-index: z-index( '.blocks-button__inline-link .editor-url-input__suggestions' ); } > .dashicon { @@ -47,7 +47,7 @@ color: $dark-gray-100; } - .blocks-url-input input[type=text]::placeholder { + .editor-url-input input[type=text]::placeholder { color: $dark-gray-100; } diff --git a/core-blocks/button/index.js b/core-blocks/button/index.js index 8a710ef4c0cd8..e9fb9fbd9218f 100644 --- a/core-blocks/button/index.js +++ b/core-blocks/button/index.js @@ -26,7 +26,7 @@ import { getColorClass, withColors, PanelColor, -} from '@wordpress/blocks'; +} from '@wordpress/editor'; /** * Internal dependencies diff --git a/core-blocks/button/test/__snapshots__/index.js.snap b/core-blocks/button/test/__snapshots__/index.js.snap index 05d5185451e85..08b41dc9bc20a 100644 --- a/core-blocks/button/test/__snapshots__/index.js.snap +++ b/core-blocks/button/test/__snapshots__/index.js.snap @@ -5,7 +5,7 @@ exports[`core/button block edit matches snapshot 1`] = ` class="wp-block-button" >
@@ -17,13 +17,13 @@ exports[`core/button block edit matches snapshot 1`] = ` aria-expanded="false" aria-label="Add text…" aria-multiline="false" - class="wp-block-button__link blocks-rich-text__tinymce" + class="wp-block-button__link editor-rich-text__tinymce" contenteditable="true" data-is-placeholder-visible="true" role="textbox" /> Add text… diff --git a/core-blocks/categories/block.js b/core-blocks/categories/block.js index 21e940834bb14..c3152e3406a2f 100644 --- a/core-blocks/categories/block.js +++ b/core-blocks/categories/block.js @@ -10,7 +10,7 @@ import { InspectorControls, BlockControls, BlockAlignmentToolbar, -} from '@wordpress/blocks'; +} from '@wordpress/editor'; /** * Internal dependencies diff --git a/core-blocks/code/edit.js b/core-blocks/code/edit.js index 71414afaa6c00..8dd4f95078632 100644 --- a/core-blocks/code/edit.js +++ b/core-blocks/code/edit.js @@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n'; * Internal dependencies */ import './editor.scss'; -import { PlainText } from '@wordpress/blocks'; +import { PlainText } from '@wordpress/editor'; export default function edit( { attributes, setAttributes, className } ) { return ( diff --git a/core-blocks/code/edit.native.js b/core-blocks/code/edit.native.js index bde686ed7f700..f9e745e75a260 100644 --- a/core-blocks/code/edit.native.js +++ b/core-blocks/code/edit.native.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { PlainText } from '@wordpress/blocks'; +import { PlainText } from '@wordpress/editor'; // Note: styling is applied directly to the (nested) PlainText component. Web-side components // apply it to the container 'div' but we don't have a proper proposal for cascading styling yet. diff --git a/core-blocks/code/editor.scss b/core-blocks/code/editor.scss index d354bdb7e2912..f5d46e8c4e845 100644 --- a/core-blocks/code/editor.scss +++ b/core-blocks/code/editor.scss @@ -1,4 +1,4 @@ -.wp-block-code .blocks-plain-text { +.wp-block-code .editor-plain-text { font-family: $editor-html-font; font-size: $text-editor-font-size; color: $dark-gray-800; diff --git a/core-blocks/code/index.js b/core-blocks/code/index.js index 0b26512d61865..270ccb40aca46 100644 --- a/core-blocks/code/index.js +++ b/core-blocks/code/index.js @@ -2,9 +2,7 @@ * WordPress dependencies */ import { __ } from '@wordpress/i18n'; -import { - createBlock, -} from '@wordpress/blocks'; +import { createBlock } from '@wordpress/blocks'; /** * Internal dependencies diff --git a/core-blocks/code/test/__snapshots__/index.js.snap b/core-blocks/code/test/__snapshots__/index.js.snap index b5453f0faa1d4..4d44efaa90a74 100644 --- a/core-blocks/code/test/__snapshots__/index.js.snap +++ b/core-blocks/code/test/__snapshots__/index.js.snap @@ -6,7 +6,7 @@ exports[`core/code block edit matches snapshot 1`] = ` >