Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the block components to the block editor module #14112

Merged
merged 9 commits into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The `editor.Autocomplete.completers` filter is for extending and overriding the list of autocompleters used by blocks.

The `Autocomplete` component found in `@wordpress/editor` applies this filter. The `@wordpress/components` package provides the foundational `Autocomplete` component that does not apply such a filter, but blocks should generally use the component provided by `@wordpress/editor`.
The `Autocomplete` component found in `@wordpress/block-editor` applies this filter. The `@wordpress/components` package provides the foundational `Autocomplete` component that does not apply such a filter, but blocks should generally use the component provided by `@wordpress/block-editor`.

### Example

Expand Down
6 changes: 3 additions & 3 deletions docs/designers-developers/developers/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const { PlainText } = wp.editor;

All the packages are also available on [npm](https://www.npmjs.com/org/wordpress) if you want to bundle them in your code.

Using the same `PlainText` example, you would install the editor module with npm:
Using the same `PlainText` example, you would install the block editor module with npm:

```bash
npm install @wordpress/editor --save
npm install @wordpress/block-editor --save
```

Once installed, you can access the component in your code using:

```js
import { PlainText } from '@wordpress/editor';
import { PlainText } from '@wordpress/block-editor';
```

14 changes: 11 additions & 3 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,26 @@ function gutenberg_register_scripts_and_styles() {
// This empty stylesheet is defined to ensure backward compatibility.
gutenberg_override_style( 'wp-blocks', false );

gutenberg_override_style(
'wp-block-editor',
gutenberg_url( 'build/block-editor/style.css' ),
array( 'wp-components', 'wp-editor-font' ),
filemtime( gutenberg_dir_path() . 'build/editor/style.css' )
);
wp_style_add_data( 'wp-block-editor', 'rtl', 'replace' );

gutenberg_override_style(
'wp-editor',
gutenberg_url( 'build/editor/style.css' ),
array( 'wp-components', 'wp-editor-font', 'wp-nux' ),
array( 'wp-components', 'wp-block-editor', 'wp-nux' ),
filemtime( gutenberg_dir_path() . 'build/editor/style.css' )
);
wp_style_add_data( 'wp-editor', 'rtl', 'replace' );

gutenberg_override_style(
'wp-edit-post',
gutenberg_url( 'build/edit-post/style.css' ),
array( 'wp-components', 'wp-editor', 'wp-edit-blocks', 'wp-block-library', 'wp-nux' ),
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-block-library', 'wp-nux' ),
filemtime( gutenberg_dir_path() . 'build/edit-post/style.css' )
);
wp_style_add_data( 'wp-edit-post', 'rtl', 'replace' );
Expand All @@ -299,7 +307,7 @@ function gutenberg_register_scripts_and_styles() {
gutenberg_override_style(
'wp-format-library',
gutenberg_url( 'build/format-library/style.css' ),
array(),
array( 'wp-block-editor', 'wp-components' ),
filemtime( gutenberg_dir_path() . 'build/format-library/style.css' )
);
wp_style_add_data( 'wp-format-library', 'rtl', 'replace' );
Expand Down
14 changes: 14 additions & 0 deletions lib/packages-dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,25 @@
'wp-block-serialization-spec-parser' => array(),
'wp-block-editor' => array(
'lodash',
'wp-a11y',
'wp-blob',
'wp-blocks',
'wp-compose',
'wp-components',
'wp-core-data',
'wp-data',
'wp-dom',
'wp-element',
'wp-hooks',
'wp-html-entities',
'wp-i18n',
'wp-is-shallow-equal',
'wp-keycodes',
'wp-rich-text',
'wp-token-list',
'wp-url',
'wp-viewport',
'wp-wordcount',
),
'wp-blocks' => array(
'lodash',
Expand Down Expand Up @@ -180,6 +193,7 @@
),
'wp-escape-html' => array(),
'wp-format-library' => array(
'wp-block-editor',
'wp-components',
'wp-editor',
'wp-element',
Expand Down
26 changes: 19 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading