/dev/null
+ docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI db reset --yes --quiet
fi
# Install WordPress.
echo -e $(status_message "Installing WordPress...")
# The `-u 33` flag tells Docker to run the command as a particular user and
# prevents permissions errors. See: https://github.com/WordPress/gutenberg/pull/8427#issuecomment-410232369
-docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core install --title="$SITE_TITLE" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:$HOST_PORT >/dev/null
+docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core install --title="$SITE_TITLE" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:$HOST_PORT --quiet
if [ "$E2E_ROLE" = "author" ]; then
- # Create an additional author user for testsing.
- docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI user create author author@example.com --role=author --user_pass=authpass
+ echo -e $(status_message "Creating an additional author user for testing...")
+ # Create an additional author user for testing.
+ docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI user create author author@example.com --role=author --user_pass=authpass --quiet
# Assign the existing Hello World post to the author.
- docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI post update 1 --post_author=2
+ docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI post update 1 --post_author=2 --quiet
fi
+# Make sure the uploads and upgrade folders exist and we have permissions to add files.
+echo -e $(status_message "Ensuring that files can be uploaded...")
+docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CONTAINER chmod 767 /var/www/html/wp-content/plugins
+docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CONTAINER mkdir -p /var/www/html/wp-content/uploads
+docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CONTAINER chmod -v 767 /var/www/html/wp-content/uploads
+docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CONTAINER mkdir -p /var/www/html/wp-content/upgrade
+docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CONTAINER chmod 767 /var/www/html/wp-content/upgrade
+
+CURRENT_WP_VERSION=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm $CLI core version)
+echo -e $(status_message "Current WordPress version: $CURRENT_WP_VERSION...")
+
if [ "$WP_VERSION" == "latest" ]; then
# Check for WordPress updates, to make sure we're running the very latest version.
- docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core update >/dev/null
+ echo -e $(status_message "Updating WordPress to the latest version...")
+ docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core update --quiet
fi
# If the 'wordpress' volume wasn't during the down/up earlier, but the post port has changed, we need to update it.
+echo -e $(status_message "Checking the site's url...")
CURRENT_URL=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm $CLI option get siteurl)
if [ "$CURRENT_URL" != "http://localhost:$HOST_PORT" ]; then
- docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CLI option update home "http://localhost:$HOST_PORT" >/dev/null
- docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CLI option update siteurl "http://localhost:$HOST_PORT" >/dev/null
+ docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI option update home "http://localhost:$HOST_PORT" --quiet
+ docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI option update siteurl "http://localhost:$HOST_PORT" --quiet
fi
# Activate Gutenberg.
echo -e $(status_message "Activating Gutenberg...")
-docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CLI plugin activate gutenberg >/dev/null
+docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI plugin activate gutenberg --quiet
# Install a dummy favicon to avoid 404 errors.
+echo -e $(status_message "Installing a dummy favicon...")
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CONTAINER touch /var/www/html/favicon.ico
diff --git a/docs/reference/coding-guidelines.md b/docs/contributors/coding-guidelines.md
similarity index 93%
rename from docs/reference/coding-guidelines.md
rename to docs/contributors/coding-guidelines.md
index dcc943b3288ae6..c47fda1ab070a5 100644
--- a/docs/reference/coding-guidelines.md
+++ b/docs/contributors/coding-guidelines.md
@@ -93,9 +93,13 @@ Exposed APIs that are still being tested, discussed and are subject to change sh
Example:
```js
-export {
- internalApi as __experimentalExposedApi
-} from './internalApi.js';
+export { __experimentalDoAction } from './api';
+```
+
+If an API must be exposed but is clearly not intended to be supported into the future, you may also use `__unstable` as a prefix to differentiate it from an experimental API. Unstable APIs should serve an immediate and temporary purpose. They should _never_ be used by plugin developers as they can be removed at any point without notice, and thus should be omitted from public-facing documentation. The inline code documentation should clearly caution their use.
+
+```js
+export { __unstableDoAction } from './api';
```
### Variable Naming
@@ -166,7 +170,7 @@ function MyComponent() {}
An exception to camel case is made for constant values which are never intended to be reassigned or mutated. Such variables must use the [SCREAMING_SNAKE_CASE convention](https://en.wikipedia.org/wiki/Snake_case).
-In almost all cases, a constant should be defined in the top-most scope of a file. It is important to note that [JavaScript's `const` assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const) is conceptually more limited than what is implied here, where a value assigned by `const` in JavaScript can in-fact be mutated, and is only protected against reassignment. A constant as defined in these coding guidelines applies only to values which are expected to never change, and is a strategy for developers to communicate intent moreso than it is a technical restriction.
+In almost all cases, a constant should be defined in the top-most scope of a file. It is important to note that [JavaScript's `const` assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const) is conceptually more limited than what is implied here, where a value assigned by `const` in JavaScript can in-fact be mutated, and is only protected against reassignment. A constant as defined in these coding guidelines applies only to values which are expected to never change, and is a strategy for developers to communicate intent more so than it is a technical restriction.
### Strings
diff --git a/docs/reference/copy-guide.md b/docs/contributors/copy-guide.md
similarity index 100%
rename from docs/reference/copy-guide.md
rename to docs/contributors/copy-guide.md
diff --git a/docs/design.md b/docs/contributors/design.md
similarity index 99%
rename from docs/design.md
rename to docs/contributors/design.md
index aefba0d0eb3d4f..7b037fd3a4c946 100644
--- a/docs/design.md
+++ b/docs/contributors/design.md
@@ -46,7 +46,7 @@ Gutenberg wants to make it easier to author rich content. This means ensuring go
The initial phase of Gutenberg as described in the kickoff goal is primarily limited to the content area (specifically `post_content`) of posts and pages. Within those confines, we are embracing the web as a vertical river of content by appending blocks sequentially, then adding layout options to each block.
-That said, there isn’t any fixed limit to the kind of layouts Gutenberg will be able to create. It’s very possible for Gutenberg to grow beyond the confines of post and page content, to include the whole page — one could think of a theme template as a comma separated list of blocks, like this:
+That said, there isn’t any fixed limit to the kind of layouts Gutenberg will be able to create. It’s very possible for Gutenberg to grow beyond the confines of post and page content, to include the whole page — one could think of a theme template as a comma-separated list of blocks, like this:
```js
{
diff --git a/docs/grammar.md b/docs/contributors/grammar.md
similarity index 100%
rename from docs/grammar.md
rename to docs/contributors/grammar.md
diff --git a/docs/contributors/history.md b/docs/contributors/history.md
new file mode 100644
index 00000000000000..b38aacc43ecce9
--- /dev/null
+++ b/docs/contributors/history.md
@@ -0,0 +1,19 @@
+# History
+
+## Survey
+There was a survey done: [https://make.wordpress.org/core/2017/04/07/editor-experience-survey-results/](https://make.wordpress.org/core/2017/04/07/editor-experience-survey-results/)
+
+## Inspiration
+This includes a list of historical articles and influences on Gutenberg.
+
+- LivingDocs: [https://beta.livingdocs.io/articles](https://beta.livingdocs.io/articles)
+- Parrot: [https://intenseminimalism.com/2017/parrot-an-integrated-site-builder-and-editor-concept-for-wordpress/](https://intenseminimalism.com/2017/parrot-an-integrated-site-builder-and-editor-concept-for-wordpress/)
+- Apple Keynote
+- Slack
+- Google Sites v2
+
+## Blog posts by the team
+
+- Gutenberg tag on make/core: updates and much more: [https://make.wordpress.org/core/tag/gutenberg/](https://make.wordpress.org/core/tag/gutenberg/)
+- Suggested revised timeline: [https://make.wordpress.org/core/2017/08/11/revised-suggested-roadmap-for-gutenberg-and-customization/](https://make.wordpress.org/core/2017/08/11/revised-suggested-roadmap-for-gutenberg-and-customization/)
+- Discovering Gutenberg: [https://make.wordpress.org/core/2017/08/08/discovering-gutenberg-and-next-steps/](https://make.wordpress.org/core/2017/08/08/discovering-gutenberg-and-next-steps/)
diff --git a/docs/outreach.md b/docs/contributors/outreach.md
similarity index 100%
rename from docs/outreach.md
rename to docs/contributors/outreach.md
diff --git a/docs/outreach/articles.md b/docs/contributors/outreach/articles.md
similarity index 100%
rename from docs/outreach/articles.md
rename to docs/contributors/outreach/articles.md
diff --git a/docs/outreach/meetups.md b/docs/contributors/outreach/meetups.md
similarity index 100%
rename from docs/outreach/meetups.md
rename to docs/contributors/outreach/meetups.md
diff --git a/docs/outreach/resources.md b/docs/contributors/outreach/resources.md
similarity index 100%
rename from docs/outreach/resources.md
rename to docs/contributors/outreach/resources.md
diff --git a/docs/outreach/talks.md b/docs/contributors/outreach/talks.md
similarity index 100%
rename from docs/outreach/talks.md
rename to docs/contributors/outreach/talks.md
diff --git a/docs/principles.md b/docs/contributors/principles.md
similarity index 100%
rename from docs/principles.md
rename to docs/contributors/principles.md
diff --git a/docs/principles/the-block.md b/docs/contributors/principles/the-block.md
similarity index 100%
rename from docs/principles/the-block.md
rename to docs/contributors/principles/the-block.md
diff --git a/docs/contributors/readme.md b/docs/contributors/readme.md
new file mode 100644
index 00000000000000..1feaadfcbf5b9b
--- /dev/null
+++ b/docs/contributors/readme.md
@@ -0,0 +1,11 @@
+# Contributors Guide
+
+Welcome to the Gutenberg Project Contributors Guide.
+
+The following guidelines are in place to create consistency across the project and the numerous contributors. See also the [Contributing Documentation](https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md) for technical details around setup, and submitting your contributions.
+
+* [Coding Guidelines](../../docs/contributors/coding-guidelines.md) outline additional patterns and conventions used in the Gutenberg project.
+* [Copy Guidelines](../../docs/contributors/copy-guide.md)
+* [Design Principles & Vision](../../docs/contributors/design.md)
+
+Please see the table of contents on the left side of the Gutenberg Handbook for the full list of contributor resources.
diff --git a/docs/reference.md b/docs/contributors/reference.md
similarity index 67%
rename from docs/reference.md
rename to docs/contributors/reference.md
index 78ba03435973b2..2a4714d5e75a23 100644
--- a/docs/reference.md
+++ b/docs/contributors/reference.md
@@ -1,9 +1,9 @@
# Reference
-- [Glossary](../docs/reference/glossary.md)
-- [Coding Guidelines](../docs/reference/coding-guidelines.md)
-- [Testing Overview](../docs/reference/testing-overview.md)
-- [Frequently Asked Questions](../docs/reference/faq.md)
+- [Glossary](../../docs/designers-developers/glossary.md)
+- [Coding Guidelines](../../docs/contributors/coding-guidelines.md)
+- [Testing Overview](../../docs/contributors/testing-overview.md)
+- [Frequently Asked Questions](../../docs/designers-developers/faq.md)
## Logo
diff --git a/docs/reference/release-screenshot.png b/docs/contributors/release-screenshot.png
similarity index 100%
rename from docs/reference/release-screenshot.png
rename to docs/contributors/release-screenshot.png
diff --git a/docs/reference/release.md b/docs/contributors/release.md
similarity index 100%
rename from docs/reference/release.md
rename to docs/contributors/release.md
diff --git a/docs/reference/repository-management.md b/docs/contributors/repository-management.md
similarity index 100%
rename from docs/reference/repository-management.md
rename to docs/contributors/repository-management.md
diff --git a/docs/reference/scripts.md b/docs/contributors/scripts.md
similarity index 97%
rename from docs/reference/scripts.md
rename to docs/contributors/scripts.md
index 0bd0cf98927921..dd7e1d295d528c 100644
--- a/docs/reference/scripts.md
+++ b/docs/contributors/scripts.md
@@ -50,13 +50,12 @@ The editor also uses some popular third-party packages and scripts. Plugin devel
| [React](https://reactjs.org) | react | React is a JavaScript library for building user interfaces |
| [React Dom](https://reactjs.org/docs/react-dom.html) | react-dom | Serves as the entry point to the DOM and server renderers for React, intended to be paired with React |
| [Moment](https://momentjs.com/) | moment| Parse, validate, manipulate, and display dates and times in JavaScript |
-| [TinyMCE Lists](https://www.tiny.cloud/docs/plugins/lists/) | tinymce-latest-lists| The `lists` plugin allows you to add numbered and bulleted lists to TinyMCE |
| [Lodash](https://lodash.com) | lodash| Lodash is a JavaScript library which provides utility functions for common programming tasks |
## Polyfill Scripts
The editor also provides polyfills for certain features that may not be available in all modern browsers.
-It is recommened to use the main `wp-polyfill` script handle which takes care of loading all the below mentioned polyfills.
+It is recommened to use the main `wp-polyfill` script handle which takes care of loading all the below mentioned polyfills.
| Script Name | Handle | Description |
|-------------|--------|-------------|
diff --git a/docs/reference/testing-overview.md b/docs/contributors/testing-overview.md
similarity index 100%
rename from docs/reference/testing-overview.md
rename to docs/contributors/testing-overview.md
diff --git a/docs/data/README.md b/docs/data/README.md
deleted file mode 100644
index ac44230651976e..00000000000000
--- a/docs/data/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Data Module Reference
-
- - [**core**: WordPress Core Data](../../docs/data/data-core.md)
- - [**core/annotations**: Annotations](../../docs/data/data-core-annotations.md)
- - [**core/blocks**: Block Types Data](../../docs/data/data-core-blocks.md)
- - [**core/editor**: The Editor’s Data](../../docs/data/data-core-editor.md)
- - [**core/edit-post**: The Editor’s UI Data](../../docs/data/data-core-edit-post.md)
- - [**core/notices**: Notices Data](../../docs/data/data-core-notices.md)
- - [**core/nux**: The NUX (New User Experience) Data](../../docs/data/data-core-nux.md)
- - [**core/viewport**: The Viewport Data](../../docs/data/data-core-viewport.md)
\ No newline at end of file
diff --git a/docs/designers-developers/assets/fancy-quote-in-inspector.png b/docs/designers-developers/assets/fancy-quote-in-inspector.png
new file mode 100644
index 00000000000000..6bd8c06a9e3979
Binary files /dev/null and b/docs/designers-developers/assets/fancy-quote-in-inspector.png differ
diff --git a/docs/designers-developers/assets/fancy-quote-with-style.png b/docs/designers-developers/assets/fancy-quote-with-style.png
new file mode 100644
index 00000000000000..31f38063a1f1dd
Binary files /dev/null and b/docs/designers-developers/assets/fancy-quote-with-style.png differ
diff --git a/docs/blocks/inspector.png b/docs/designers-developers/assets/inspector.png
similarity index 100%
rename from docs/blocks/inspector.png
rename to docs/designers-developers/assets/inspector.png
diff --git a/docs/designers-developers/assets/js-tutorial-console-log-error.png b/docs/designers-developers/assets/js-tutorial-console-log-error.png
new file mode 100644
index 00000000000000..836a663484192f
Binary files /dev/null and b/docs/designers-developers/assets/js-tutorial-console-log-error.png differ
diff --git a/docs/designers-developers/assets/js-tutorial-console-log-success.png b/docs/designers-developers/assets/js-tutorial-console-log-success.png
new file mode 100644
index 00000000000000..7b42853fb40642
Binary files /dev/null and b/docs/designers-developers/assets/js-tutorial-console-log-success.png differ
diff --git a/docs/designers-developers/assets/js-tutorial-error-blocks-undefined.png b/docs/designers-developers/assets/js-tutorial-error-blocks-undefined.png
new file mode 100644
index 00000000000000..1f27c36ce75956
Binary files /dev/null and b/docs/designers-developers/assets/js-tutorial-error-blocks-undefined.png differ
diff --git a/docs/designers-developers/assets/toolbar-text.png b/docs/designers-developers/assets/toolbar-text.png
new file mode 100644
index 00000000000000..76b18c6b8f368f
Binary files /dev/null and b/docs/designers-developers/assets/toolbar-text.png differ
diff --git a/docs/designers-developers/designers/README.md b/docs/designers-developers/designers/README.md
new file mode 100644
index 00000000000000..362cf794885f20
--- /dev/null
+++ b/docs/designers-developers/designers/README.md
@@ -0,0 +1,3 @@
+# Designer Documentation
+
+For those designing blocks and other Block Editor integrations, this documentation will provide resources for creating beautiful and intuitive layouts.
diff --git a/docs/design/advanced-settings-do.png b/docs/designers-developers/designers/assets/advanced-settings-do.png
similarity index 100%
rename from docs/design/advanced-settings-do.png
rename to docs/designers-developers/designers/assets/advanced-settings-do.png
diff --git a/docs/design/block-controls-do.png b/docs/designers-developers/designers/assets/block-controls-do.png
similarity index 100%
rename from docs/design/block-controls-do.png
rename to docs/designers-developers/designers/assets/block-controls-do.png
diff --git a/docs/design/block-controls-dont.png b/docs/designers-developers/designers/assets/block-controls-dont.png
similarity index 100%
rename from docs/design/block-controls-dont.png
rename to docs/designers-developers/designers/assets/block-controls-dont.png
diff --git a/docs/design/block-descriptions-do.png b/docs/designers-developers/designers/assets/block-descriptions-do.png
similarity index 100%
rename from docs/design/block-descriptions-do.png
rename to docs/designers-developers/designers/assets/block-descriptions-do.png
diff --git a/docs/design/block-descriptions-dont.png b/docs/designers-developers/designers/assets/block-descriptions-dont.png
similarity index 100%
rename from docs/design/block-descriptions-dont.png
rename to docs/designers-developers/designers/assets/block-descriptions-dont.png
diff --git a/docs/design/blocks-do.png b/docs/designers-developers/designers/assets/blocks-do.png
similarity index 100%
rename from docs/design/blocks-do.png
rename to docs/designers-developers/designers/assets/blocks-do.png
diff --git a/docs/design/blocks-dont.png b/docs/designers-developers/designers/assets/blocks-dont.png
similarity index 100%
rename from docs/design/blocks-dont.png
rename to docs/designers-developers/designers/assets/blocks-dont.png
diff --git a/docs/design/placeholder-do.png b/docs/designers-developers/designers/assets/placeholder-do.png
similarity index 100%
rename from docs/design/placeholder-do.png
rename to docs/designers-developers/designers/assets/placeholder-do.png
diff --git a/docs/design/placeholder-dont.png b/docs/designers-developers/designers/assets/placeholder-dont.png
similarity index 100%
rename from docs/design/placeholder-dont.png
rename to docs/designers-developers/designers/assets/placeholder-dont.png
diff --git a/docs/design/block-design.md b/docs/designers-developers/designers/block-design.md
similarity index 74%
rename from docs/design/block-design.md
rename to docs/designers-developers/designers/block-design.md
index f73b61a72498e8..0d9d098c96229c 100644
--- a/docs/design/block-design.md
+++ b/docs/designers-developers/designers/block-design.md
@@ -19,6 +19,39 @@ Basic block settings won’t always make sense in the context of the placeholder
The sidebar is not visible by default on a small / mobile screen, and may also be collapsed in a desktop view. Therefore, it should not be relied on for anything that is necessary for the basic operation of the block. Pick good defaults, make important actions available in the block toolbar, and think of the sidebar as something that only power users may discover. In addition, use sections and headers in the block sidebar if there are more than a handful of options, in order to allow users to easily scan and understand the options available.
+## Setup state vs. live preview state
+
+Often a block will use the placeholder content to walk users through a setup process. The setup process gathers information from the user that is needed to render the block. A block’s setup state is indicated with a grey background to provide clear differentiation for the user. Not all blocks have setup states — for example, the paragraph block.
+
+
+
+
+
+A setup state is **not** necessary if:
+
+- You can provide good default content in the block that will meet most people’s needs.
+- That default content is easy to edit and customize.
+
+Use a setup state if:
+
+- There isn’t a clear default state that would work for most users.
+- You need to gather input from the user that doesn’t have a 1-1 relationship with the live preview of the block (for example, if you need the user to input an API key to render content).
+- You need more information from the user in order to render useful default content.
+
+For blocks that do have setup states, once the user has gone through the setup process, the placeholder is replaced with the live preview state of that block.
+
+
+
+
+
+When the block is selected, additional controls may be revealed to customize the block’s contents. For example, when the image gallery is selected, it reveals controls to remove or add images.
+
+
+
+
+
+In most cases, a block’s setup state is only shown once and then further customization is done via the live preview state. However, in some cases it might be desirable to allow the user to return to the setup state — for example, if all the block content has been deleted or via a link from the block’s toolbar or sidebar.
+
## Do's and Don'ts
### Blocks
@@ -27,13 +60,11 @@ A block should have a straightforward, short name so users can easily find it in
Blocks should have an identifying icon, ideally using a single color. Try to avoid using the same icon used by an existing block. The core block icons are based on [Material Design Icons](https://material.io/tools/icons/). Look to that icon set, or to [Dashicons](https://developer.wordpress.org/resource/dashicons/) for style inspiration.
-
-
+
**Do:**
Use concise block names.
-
-
+
**Don't:**
Avoid long, multi-line block names.
@@ -41,13 +72,11 @@ Avoid long, multi-line block names.
Every block should include a description in the “Block” tab of the Settings sidebar. This description should explain your block's function clearly. Keep it to a single sentence.
-
-
+
**Do:**
Use a short, simple, block description.
-
-
+
**Don't:**
Avoid long descriptions and branding.
@@ -55,11 +84,11 @@ Avoid long descriptions and branding.
If your block requires a user to configure some options before you can display it, you should provide an instructive placeholder state.
-
+
**Do:**
Provide an instructive placeholder state.
-
+
**Don't:**
Avoid branding and relying on the title alone to convey instructions.
@@ -69,11 +98,11 @@ When unselected, your block should preview its content as closely to the front-e
When selected, your block may surface additional options like input fields or buttons to configure the block directly, especially when they are necessary for basic operation.
-
+
**Do:**
For controls that are essential the the operation of the block, provide them directly in inside the block edit view.
-
+
**Don't:**
Do not put controls that are essential to the block in the sidebar, or the block will appear non-functional to mobile users, or desktop users who have dismissed the sidebar.
@@ -81,7 +110,7 @@ Do not put controls that are essential to the block in the sidebar, or the block
The “Block” tab of the Settings Sidebar can contain additional block options and configuration. Keep in mind that a user can dismiss the sidebar and never use it. You should not put critical options in the Sidebar.
-
+
**Do:**
Because the Drop Cap feature is not necessary for the basic operation of the block, you can put it ub the Block tab as optional configuration.
diff --git a/docs/design/design-patterns.md b/docs/designers-developers/designers/design-patterns.md
similarity index 100%
rename from docs/design/design-patterns.md
rename to docs/designers-developers/designers/design-patterns.md
diff --git a/docs/design/design-resources.md b/docs/designers-developers/designers/design-resources.md
similarity index 100%
rename from docs/design/design-resources.md
rename to docs/designers-developers/designers/design-resources.md
diff --git a/docs/designers-developers/developers/README.md b/docs/designers-developers/developers/README.md
new file mode 100644
index 00000000000000..8dbc72195d05cf
--- /dev/null
+++ b/docs/designers-developers/developers/README.md
@@ -0,0 +1,45 @@
+# Developer Documentation
+
+Gutenberg is highly flexible, like most of WordPress. You can build custom blocks, modify the editor's appearance, add special plugins, and much more.
+
+## Creating Blocks
+
+Gutenberg is about blocks, and the main extensibility API of Gutenberg is the Block API. It allows you to create your own static blocks, dynamic blocks rendered on the server and also blocks capable of saving data to Post Meta for more structured content.
+
+If you want to learn more about block creation, the [Blocks Tutorial](../../../docs/designers-developers/developers/tutorials/block-tutorial/readme.md) is the best place to start.
+
+## Extending Blocks
+
+It is also possible to modify the behavior of existing blocks or even remove them completely using filters.
+
+Learn more in the [Block Filters](../../../docs/designers-developers/developers/reference/hooks/block-filters.md) section.
+
+## Extending the Editor UI
+
+Extending the editor UI can be accomplished with the `registerPlugin` API, allowing you to define all your plugin's UI elements in one place.
+
+Refer to the [Plugins](https://github.com/WordPress/gutenberg/blob/master/packages/plugins/README.md) and [Edit Post](https://github.com/WordPress/gutenberg/blob/master/packages/edit-post/README.md) section for more information.
+
+You can also filter certain aspects of the editor; this is documented on the [Editor Filters](../../../docs/designers-developers/developers/reference/hooks/editor-filters.md) page.
+
+## Meta Boxes
+
+**Porting PHP meta boxes to blocks and Gutenberg plugins is highly encouraged!**
+
+Discover how [Meta Box](../../../docs/designers-developers/developers/backward-compatibility/meta-box.md) support works in Gutenberg.
+
+## Theme Support
+
+By default, blocks provide their styles to enable basic support for blocks in themes without any change. Themes can add/override these styles, or rely on defaults.
+
+There are some advanced block features which require opt-in support in the theme. See [theme support](../../../docs/designers-developers/developers/themes/theme-support.md).
+
+## Autocomplete
+
+Autocompleters within blocks may be extended and overridden. Learn more about the [autocomplete](../../../docs/designers-developers/developers/filters/autocomplete-filters.md) filters.
+
+## Block Parsing and Serialization
+
+Posts in the editor move through a couple of different stages between being stored in `post_content` and appearing in the editor. Since the blocks themselves are data structures that live in memory it takes a parsing and serialization step to transform out from and into the stored format in the database.
+
+Customizing the parser is an advanced topic that you can learn more about in the [Extending the Parser](../../../docs/designers-developers/developers/filters/parser-filters.md) section.
diff --git a/docs/designers-developers/developers/backward-compatibility/README.md b/docs/designers-developers/developers/backward-compatibility/README.md
new file mode 100644
index 00000000000000..bd559617c5b17f
--- /dev/null
+++ b/docs/designers-developers/developers/backward-compatibility/README.md
@@ -0,0 +1 @@
+# Backward Compatibility
diff --git a/docs/reference/deprecated.md b/docs/designers-developers/developers/backward-compatibility/deprecations.md
similarity index 97%
rename from docs/reference/deprecated.md
rename to docs/designers-developers/developers/backward-compatibility/deprecations.md
index 13efe9f8940bdf..7b690e995c5169 100644
--- a/docs/reference/deprecated.md
+++ b/docs/designers-developers/developers/backward-compatibility/deprecations.md
@@ -1,4 +1,6 @@
-Gutenberg's deprecation policy is intended to support backwards-compatibility for releases, when possible. The current deprecations are listed below and are grouped by _the version at which they will be removed completely_. If your plugin depends on these behaviors, you must update to the recommended alternative before the noted version.
+# Deprecations
+
+Gutenberg's deprecation policy is intended to support backward compatibility for releases, when possible. The current deprecations are listed below and are grouped by _the version at which they will be removed completely_. If your plugin depends on these behaviors, you must update to the recommended alternative before the noted version.
## 4.5.0
- `Dropdown.refresh()` has been deprecated as the contained `Popover` is now automatically refreshed.
diff --git a/docs/extensibility/meta-box.md b/docs/designers-developers/developers/backward-compatibility/meta-box.md
similarity index 84%
rename from docs/extensibility/meta-box.md
rename to docs/designers-developers/developers/backward-compatibility/meta-box.md
index eb96bfc38e0ffb..5403ebf674ac31 100644
--- a/docs/extensibility/meta-box.md
+++ b/docs/designers-developers/developers/backward-compatibility/meta-box.md
@@ -21,18 +21,18 @@ WordPress will fall back to the Classic editor, where the meta box will continue
Explicitly setting `__block_editor_compatible_meta_box` to `true` will cause WordPress to stay in Gutenberg (assuming another meta box doesn't cause a fallback).
-After a meta box is converted to a block, it can be declared as existing for backwards compatibility:
+After a meta box is converted to a block, it can be declared as existing for backward compatibility:
```php
add_meta_box( 'my-meta-box', 'My Meta Box', 'my_meta_box_callback',
null, 'normal', 'high',
array(
- '__back_compat_meta_box' => false,
+ '__back_compat_meta_box' => true,
)
);
```
-When Gutenberg is used, this meta box will no longer be displayed in the meta box area, as it now only exists for backwards compatibility purposes. It will continue to display correctly in the Classic editor, should some other meta box cause a fallback.
+When Gutenberg is used, this meta box will no longer be displayed in the meta box area, as it now only exists for backward compatibility purposes. It will continue to display correctly in the Classic editor, should some other meta box cause a fallback.
### Meta Box Data Collection
@@ -42,7 +42,7 @@ See `lib/register.php gutenberg_trick_plugins_into_registering_meta_boxes()`
`gutenberg_collect_meta_box_data()` is hooked in later on `admin_head`. It will run through the functions and hooks that `post.php` runs to register meta boxes; namely `add_meta_boxes`, `add_meta_boxes_{$post->post_type}`, and `do_meta_boxes`.
-A copy of the global `$wp_meta_boxes` is made then filtered through `apply_filters( 'filter_gutenberg_meta_boxes', $_meta_boxes_copy );`, which will strip out any core meta boxes, standard custom taxonomy meta boxes, and any meta boxes that have declared themselves as only existing for backwards compatibility purposes.
+A copy of the global `$wp_meta_boxes` is made then filtered through `apply_filters( 'filter_gutenberg_meta_boxes', $_meta_boxes_copy );`, which will strip out any core meta boxes, standard custom taxonomy meta boxes, and any meta boxes that have declared themselves as only existing for backward compatibility purposes.
Then each location for this particular type of meta box is checked for whether it is active. If it is not empty a value of true is stored, if it is empty a value of false is stored. This meta box location data is then dispatched by the editor Redux store in `INITIALIZE_META_BOX_STATE`.
@@ -82,3 +82,5 @@ Most PHP meta boxes should continue to work in Gutenberg, but some meta boxes th
- Plugins relying on selectors that target the post title, post content fields, and other metaboxes (of the old editor).
- Plugins relying on TinyMCE's API because there's no longer a single TinyMCE instance to talk to in Gutenberg.
- Plugins making updates to their DOM on "submit" or on "save".
+
+Please also note that if your plugin triggers a PHP warning or notice to be output on the page, this will cause the HTML document type (``) to be output incorrectly. This will cause the browser to render using "Quirks Mode", which is a compatibility layer that gets enabled when the browser doesn't know what type of document it is parsing. The block editor is not meant to work in this mode, but it can _appear_ to be working just fine. If you encounter issues such as *meta boxes overlaying the editor* or other layout issues, please check the raw page source of your document to see that the document type definition is the first thing output on the page. There will also be a warning in the JavaScript console, noting the issue.
diff --git a/docs/designers-developers/developers/block-api/README.md b/docs/designers-developers/developers/block-api/README.md
new file mode 100644
index 00000000000000..2c18a261d8fc5c
--- /dev/null
+++ b/docs/designers-developers/developers/block-api/README.md
@@ -0,0 +1,11 @@
+# Block API Reference
+
+Blocks are the fundamental element of the Gutenberg editor. They are the primary way in which plugins and themes can register their own functionality and extend the capabilities of the editor.
+
+## Registering a block
+
+All blocks must be registered before they can be used in the editor. You can learn about block registration, and the available options, in the [block registration](../../../../docs/designers-developers/developers/block-api/block-registration.md) documentation.
+
+## Block `edit` and `save`
+
+The `edit` and `save` functions define the editor interface with which a user would interact, and the markup to be serialized back when a post is saved. They are the heart of how a block operates, so they are [covered separately](../../../../docs/designers-developers/developers/block-api/block-edit-save.md).
diff --git a/docs/extensibility/annotations.md b/docs/designers-developers/developers/block-api/block-annotations.md
similarity index 100%
rename from docs/extensibility/annotations.md
rename to docs/designers-developers/developers/block-api/block-annotations.md
diff --git a/docs/block-api/attributes.md b/docs/designers-developers/developers/block-api/block-attributes.md
similarity index 100%
rename from docs/block-api/attributes.md
rename to docs/designers-developers/developers/block-api/block-attributes.md
diff --git a/docs/block-api/deprecated-blocks.md b/docs/designers-developers/developers/block-api/block-deprecation.md
similarity index 92%
rename from docs/block-api/deprecated-blocks.md
rename to docs/designers-developers/developers/block-api/block-deprecation.md
index 9f1e368aed6826..3fd500c1645417 100644
--- a/docs/block-api/deprecated-blocks.md
+++ b/docs/designers-developers/developers/block-api/block-deprecation.md
@@ -9,9 +9,9 @@ A block can have several deprecated versions. A deprecation will be tried if a p
Deprecations are defined on a block type as its `deprecated` property, an array of deprecation objects where each object takes the form:
-- `attributes` (Object): The [attributes definition](../docs/block-api/attributes.md) of the deprecated form of the block.
-- `support` (Object): The [supports definition](../docs/block-api.md) of the deprecated form of the block.
-- `save` (Function): The [save implementation](../docs/block-api/block-edit-save.md) of the deprecated form of the block.
+- `attributes` (Object): The [attributes definition](../../../../docs/designers-developers/developers/block-api/block-attributes.md) of the deprecated form of the block.
+- `support` (Object): The [supports definition](../../../../docs/designers-developers/developers/block-api/block-registration.md) of the deprecated form of the block.
+- `save` (Function): The [save implementation](../../../../docs/designers-developers/developers/block-api/block-edit-save.md) of the deprecated form of the block.
- `migrate` (Function, Optional): A function which, given the attributes and inner blocks of the parsed block, is expected to return either the attributes compatible with the deprecated block, or a tuple array of `[ attributes, innerBlocks ]`.
- `isEligible` (Function, Optional): A function which, given the attributes and inner blocks of the parsed block, returns true if the deprecation can handle the block migration. This is particularly useful in cases where a block is technically valid even once deprecated, and requires updates to its attributes or inner blocks.
diff --git a/docs/block-api/block-edit-save.md b/docs/designers-developers/developers/block-api/block-edit-save.md
similarity index 77%
rename from docs/block-api/block-edit-save.md
rename to docs/designers-developers/developers/block-api/block-edit-save.md
index 4d4ee948e3ba4e..f72baac90858d8 100644
--- a/docs/block-api/block-edit-save.md
+++ b/docs/designers-developers/developers/block-api/block-edit-save.md
@@ -80,6 +80,24 @@ edit( { attributes, setAttributes, className, isSelected } ) {
}
```
+When using attributes that are objects or arrays it's a good idea to copy or clone the attribute prior to updating it:
+
+```js
+// Good - here a new array is created from the old list attribute and a new list item:
+const { list } = attributes;
+const addListItem = ( newListItem ) => setAttributes( { list: [ ...list, newListItem ] } );
+
+// Bad - here the list from the existing attribute is modified directly to add the new list item:
+const { list } = attributes;
+const addListItem = ( newListItem ) => {
+ list.push( newListItem );
+ setAttributes( { list } );
+};
+
+```
+
+Why do this? In JavaScript, arrays and objects are passed by reference, so this practice ensures changes won't affect other code that might hold references to the same data. Furthermore, Gutenberg follows the philosophy of the Redux library that [state should be immutable](https://redux.js.org/faq/immutable-data#what-are-the-benefits-of-immutability)—data should not be changed directly, but instead a new version of the data created containing the changes.
+
## Save
The `save` function defines the way in which the different attributes should be combined into the final markup, which is then serialized by Gutenberg into `post_content`.
@@ -103,7 +121,7 @@ For most blocks, the return value of `save` should be an [instance of WordPress
_Note:_ While it is possible to return a string value from `save`, it _will be escaped_. If the string includes HTML markup, the markup will be shown on the front of the site verbatim, not as the equivalent HTML node content. If you must return raw HTML from `save`, use `wp.element.RawHTML`. As the name implies, this is prone to [cross-site scripting](https://en.wikipedia.org/wiki/Cross-site_scripting) and therefore is discouraged in favor of a WordPress Element hierarchy whenever possible.
-For [dynamic blocks](../../docs/blocks/creating-dynamic-blocks.md), the return value of `save` could either represent a cached copy of the block's content to be shown only in case the plugin implementing the block is ever disabled. Alternatively, return a `null` (empty) value to save no markup in post content for the dynamic block, instead deferring this to always be calculated when the block is shown on the front of the site.
+For [dynamic blocks](../../../../docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md), the return value of `save` could either represent a cached copy of the block's content to be shown only in case the plugin implementing the block is ever disabled. Alternatively, return a `null` (empty) value to save no markup in post content for the dynamic block, instead deferring this to always be calculated when the block is shown on the front of the site.
### attributes
@@ -153,10 +171,10 @@ The two most common sources of block invalidations are:
Before starting to debug, be sure to familiarize yourself with the validation step described above documenting the process for detecting whether a block is invalid. A block is invalid if its regenerated markup does not match what is saved in post content, so often this can be caused by the attributes of a block being parsed incorrectly from the saved content.
-If you're using [attribute sources](../../docs/block-api/attributes.md), be sure that attributes sourced from markup are saved exactly as you expect, and in the correct type (usually a `'string'` or `'number'`).
+If you're using [attribute sources](../../../../docs/designers-developers/developers/block-api/block-attributes.md), be sure that attributes sourced from markup are saved exactly as you expect, and in the correct type (usually a `'string'` or `'number'`).
When a block is detected as invalid, a warning will be logged into your browser's developer tools console. The warning will include specific details about the exact point at which a difference in markup occurred. Be sure to look closely at any differences in the expected and actual markups to see where problems are occurring.
**I've changed my block's `save` behavior and old content now includes invalid blocks. How can I fix this?**
-Refer to the guide on [Deprecated Blocks](../../docs/block-api/deprecated-blocks.md) to learn more about how to accommodate legacy content in intentional markup changes.
+Refer to the guide on [Deprecated Blocks](../../../../docs/designers-developers/developers/block-api/block-deprecations.md) to learn more about how to accommodate legacy content in intentional markup changes.
diff --git a/docs/block-api.md b/docs/designers-developers/developers/block-api/block-registration.md
similarity index 93%
rename from docs/block-api.md
rename to docs/designers-developers/developers/block-api/block-registration.md
index 01b2295b46de0b..af8aaa36a75ed2 100644
--- a/docs/block-api.md
+++ b/docs/designers-developers/developers/block-api/block-registration.md
@@ -1,8 +1,6 @@
-# Block API
+# Block Registration
-Blocks are the fundamental element of the Gutenberg editor. They are the primary way in which plugins and themes can register their own functionality and extend the capabilities of the editor. This document covers the main properties of block registration.
-
-## Register Block Type
+## `register_block_type`
* **Type:** `Function`
@@ -124,18 +122,18 @@ Block styles can be used to provide alternative styles to block. It works by add
// Register block styles.
styles: [
// Mark style as default.
- {
- name: 'default',
- label: __( 'Rounded' ),
- isDefault: true
+ {
+ name: 'default',
+ label: __( 'Rounded' ),
+ isDefault: true
},
- {
- name: 'outline',
- label: __( 'Outline' )
+ {
+ name: 'outline',
+ label: __( 'Outline' )
},
- {
- name: 'squared',
- label: __( 'Squared' )
+ {
+ name: 'squared',
+ label: __( 'Squared' )
},
],
```
@@ -235,8 +233,8 @@ transforms: {
// An attribute can be source from the shortcode attributes
align: {
type: 'string',
- shortcode: function( named ) {
- var align = named.align ? named.align : 'alignnone';
+ shortcode: function( attributes ) {
+ var align = attributes.named.align ? attributes.named.align : 'alignnone';
return align.replace( 'align', '' );
},
},
@@ -413,6 +411,43 @@ transforms: {
```
{% end %}
+A prefix transform is a transform that will be applied if the user prefixes some text in e.g. the paragraph block with a given pattern and a trailing space.
+
+{% codetabs %}
+{% ES5 %}
+```js
+transforms: {
+ from: [
+ {
+ type: 'prefix',
+ prefix: '?',
+ transform: function( content ) {
+ return createBlock( 'my-plugin/question', {
+ content,
+ } );
+ },
+ },
+ ]
+}
+```
+{% ESNext %}
+```js
+transforms: {
+ from: [
+ {
+ type: 'prefix',
+ prefix: '?',
+ transform( content ) {
+ return createBlock( 'my-plugin/question', {
+ content,
+ } );
+ },
+ },
+ ]
+}
+```
+{% end %}
+
#### parent (optional)
@@ -429,6 +464,8 @@ parent: [ 'core/columns' ],
#### supports (optional)
+*Some [block supports](#supports-optional) — for example, `anchor` or `className` — apply their attributes by adding additional props on the element returned by `save`. This will work automatically for default HTML tag elements (`div`, etc). However, if the return value of your `save` is a custom component element, you will need to ensure that your custom component handles these props in order for the attributes to be persisted.*
+
* **Type:** `Object`
Optional block extended support features. The following options are supported:
@@ -511,8 +548,4 @@ By default all blocks can be converted to a reusable block. If supports reusable
// Don't allow the block to be converted into a reusable block.
reusable: false,
```
-## Edit and Save
-The `edit` and `save` functions define the editor interface with which a user would interact, and the markup to be serialized back when a post is saved. They are the heart of how a block operates, so they are [covered separately](../docs/block-api/block-edit-save.md).
-
-*Some [block supports](#supports-optional) — for example, `anchor` or `className` — apply their attributes by adding additional props on the element returned by `save`. This will work automatically for default HTML tag elements (`div`, etc). However, if the return value of your `save` is a custom component element, you will need to ensure that your custom component handles these props in order for the attributes to be persisted.*
diff --git a/docs/templates.md b/docs/designers-developers/developers/block-api/block-templates.md
similarity index 100%
rename from docs/templates.md
rename to docs/designers-developers/developers/block-api/block-templates.md
diff --git a/docs/designers-developers/developers/data/README.md b/docs/designers-developers/developers/data/README.md
new file mode 100644
index 00000000000000..5233753c1445e5
--- /dev/null
+++ b/docs/designers-developers/developers/data/README.md
@@ -0,0 +1,10 @@
+# Data Module Reference
+
+ - [**core**: WordPress Core Data](../../docs/designers-developers/developers/data/data-core.md)
+ - [**core/annotations**: Annotations](../../docs/designers-developers/developers/data/data-core-annotations.md)
+ - [**core/blocks**: Block Types Data](../../docs/designers-developers/developers/data/data-core-blocks.md)
+ - [**core/editor**: The Editor’s Data](../../docs/designers-developers/developers/data/data-core-editor.md)
+ - [**core/edit-post**: The Editor’s UI Data](../../docs/designers-developers/developers/data/data-core-edit-post.md)
+ - [**core/notices**: Notices Data](../../docs/designers-developers/developers/data/data-core-notices.md)
+ - [**core/nux**: The NUX (New User Experience) Data](../../docs/designers-developers/developers/data/data-core-nux.md)
+ - [**core/viewport**: The Viewport Data](../../docs/designers-developers/developers/data/data-core-viewport.md)
\ No newline at end of file
diff --git a/docs/data/data-core-annotations.md b/docs/designers-developers/developers/data/data-core-annotations.md
similarity index 91%
rename from docs/data/data-core-annotations.md
rename to docs/designers-developers/developers/data/data-core-annotations.md
index f4f7d8cb5ff072..6600938219e0e9 100644
--- a/docs/data/data-core-annotations.md
+++ b/docs/designers-developers/developers/data/data-core-annotations.md
@@ -75,6 +75,16 @@ Removes an annotation with a specific ID.
* annotationId: The annotation to remove.
+### __experimentalUpdateAnnotationRange
+
+Updates the range of an annotation.
+
+*Parameters*
+
+ * annotationId: ID of the annotation to update.
+ * start: The start of the new range.
+ * end: The end of the new range.
+
### __experimentalRemoveAnnotationsBySource
Removes all annotations of a specific source.
diff --git a/docs/data/data-core-blocks.md b/docs/designers-developers/developers/data/data-core-blocks.md
similarity index 94%
rename from docs/data/data-core-blocks.md
rename to docs/designers-developers/developers/data/data-core-blocks.md
index aea753fad47576..abdb30b903773c 100644
--- a/docs/data/data-core-blocks.md
+++ b/docs/designers-developers/developers/data/data-core-blocks.md
@@ -224,4 +224,13 @@ Returns an action object used to set block categories.
*Parameters*
- * categories: Block categories.
\ No newline at end of file
+ * categories: Block categories.
+
+### updateCategory
+
+Returns an action object used to update a category.
+
+*Parameters*
+
+ * slug: Block category slug.
+ * category: Object containing the category properties that should be updated.
\ No newline at end of file
diff --git a/docs/data/data-core-edit-post.md b/docs/designers-developers/developers/data/data-core-edit-post.md
similarity index 100%
rename from docs/data/data-core-edit-post.md
rename to docs/designers-developers/developers/data/data-core-edit-post.md
diff --git a/docs/data/data-core-editor.md b/docs/designers-developers/developers/data/data-core-editor.md
similarity index 97%
rename from docs/data/data-core-editor.md
rename to docs/designers-developers/developers/data/data-core-editor.md
index d4c7b602001943..800537ba65d225 100644
--- a/docs/data/data-core-editor.md
+++ b/docs/designers-developers/developers/data/data-core-editor.md
@@ -411,6 +411,20 @@ Returns whether a block is valid or not.
Is Valid.
+### getBlockAttributes
+
+Returns a block's attributes given its client ID, or null if no block exists with
+the client ID.
+
+*Parameters*
+
+ * state: Editor state.
+ * clientId: Block client ID.
+
+*Returns*
+
+Block attributes.
+
### getBlock
Returns a block given its client ID. This is a parsed copy of the block,
@@ -1071,6 +1085,30 @@ Returns true if the post is autosaving, or false otherwise.
Whether the post is autosaving.
+### isPreviewingPost
+
+Returns true if the post is being previewed, or false otherwise.
+
+*Parameters*
+
+ * state: Global application state.
+
+*Returns*
+
+Whether the post is being previewed.
+
+### getEditedPostPreviewLink
+
+Returns the post preview link
+
+*Parameters*
+
+ * state: Global application state.
+
+*Returns*
+
+Preview Link.
+
### getSuggestedPostFormat
Returns a suggested post format for the current post, inferred only if there
@@ -1268,11 +1306,12 @@ Returns the permalink for the post.
*Returns*
-The permalink.
+The permalink, or null if the post is not viewable.
### getPermalinkParts
-Returns the permalink for a post, split into it's three parts: the prefix, the postName, and the suffix.
+Returns the permalink for a post, split into it's three parts: the prefix,
+the postName, and the suffix.
*Parameters*
@@ -1280,7 +1319,8 @@ Returns the permalink for a post, split into it's three parts: the prefix, the p
*Returns*
-The prefix, postName, and suffix for the permalink.
+An object containing the prefix, postName, and suffix for
+ the permalink, or null if the post is not viewable.
### inSomeHistory
@@ -1628,7 +1668,7 @@ Returns an action object to save the post.
*Parameters*
* options: Options for the save.
- * options.autosave: Perform an autosave if true.
+ * options.isAutosave: Perform an autosave if true.
### mergeBlocks
@@ -1643,6 +1683,10 @@ Returns an action object used in signalling that two blocks should be merged
Returns an action object used in signalling that the post should autosave.
+*Parameters*
+
+ * options: Extra flags to identify the autosave.
+
### redo
Returns an action object used in signalling that undo history should
diff --git a/docs/data/data-core-notices.md b/docs/designers-developers/developers/data/data-core-notices.md
similarity index 88%
rename from docs/data/data-core-notices.md
rename to docs/designers-developers/developers/data/data-core-notices.md
index b7ea283f02687f..5ae7f1fb000679 100644
--- a/docs/data/data-core-notices.md
+++ b/docs/designers-developers/developers/data/data-core-notices.md
@@ -32,6 +32,11 @@ Yields action objects used in signalling that a notice is to be created.
* options.isDismissible: Whether the notice can
be dismissed by user.
Defaults to `true`.
+ * options.speak: Whether the notice
+ content should be
+ announced to screen
+ readers. Defaults to
+ `true`.
* options.actions: User actions to be
presented with notice.
diff --git a/docs/data/data-core-nux.md b/docs/designers-developers/developers/data/data-core-nux.md
similarity index 100%
rename from docs/data/data-core-nux.md
rename to docs/designers-developers/developers/data/data-core-nux.md
diff --git a/docs/data/data-core-viewport.md b/docs/designers-developers/developers/data/data-core-viewport.md
similarity index 100%
rename from docs/data/data-core-viewport.md
rename to docs/designers-developers/developers/data/data-core-viewport.md
diff --git a/docs/data/data-core.md b/docs/designers-developers/developers/data/data-core.md
similarity index 100%
rename from docs/data/data-core.md
rename to docs/designers-developers/developers/data/data-core.md
diff --git a/docs/designers-developers/developers/filters/README.md b/docs/designers-developers/developers/filters/README.md
new file mode 100644
index 00000000000000..9715e15885935c
--- /dev/null
+++ b/docs/designers-developers/developers/filters/README.md
@@ -0,0 +1,7 @@
+# Filter Reference
+
+[Hooks](https://developer.wordpress.org/plugins/hooks/) are a way for one piece of code to interact/modify another piece of code. They provide one way for plugins and themes interact with Gutenberg, but they’re also used extensively by WordPress Core itself.
+
+There are two types of hooks: [Actions](https://developer.wordpress.org/plugins/hooks/actions/) and [Filters](https://developer.wordpress.org/plugins/hooks/filters/). In addition to PHP actions and filters, Gutenberg also provides a mechanism for registering and executing hooks in JavaScript. This functionality is also available on npm as the [@wordpress/hooks](https://www.npmjs.com/package/@wordpress/hooks) package, for general purpose use.
+
+You can also learn more about both APIs: [PHP](https://codex.wordpress.org/Plugin_API/) and [JavaScript](https://github.com/WordPress/packages/tree/master/packages/hooks).
diff --git a/docs/extensibility/autocomplete.md b/docs/designers-developers/developers/filters/autocomplete-filters.md
similarity index 93%
rename from docs/extensibility/autocomplete.md
rename to docs/designers-developers/developers/filters/autocomplete-filters.md
index ee1f2bc945852e..2b9d60476de80a 100644
--- a/docs/extensibility/autocomplete.md
+++ b/docs/designers-developers/developers/filters/autocomplete-filters.md
@@ -1,7 +1,6 @@
-Autocomplete
-============
+# Autocomplete
-Gutenberg provides a `editor.Autocomplete.completers` filter for extending and overriding the list of autocompleters used by blocks.
+Gutenberg provides an `editor.Autocomplete.completers` filter 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`.
diff --git a/docs/extensibility/extending-blocks.md b/docs/designers-developers/developers/filters/block-filters.md
similarity index 76%
rename from docs/extensibility/extending-blocks.md
rename to docs/designers-developers/developers/filters/block-filters.md
index d00282e6b4665a..3214fa1ba2da51 100644
--- a/docs/extensibility/extending-blocks.md
+++ b/docs/designers-developers/developers/filters/block-filters.md
@@ -1,8 +1,4 @@
-# Extending Blocks (Experimental)
-
-[Hooks](https://developer.wordpress.org/plugins/hooks/) are a way for one piece of code to interact/modify another piece of code. They make up the foundation for how plugins and themes interact with Gutenberg, but they’re also used extensively by WordPress Core itself. There are two types of hooks: [Actions](https://developer.wordpress.org/plugins/hooks/actions/) and [Filters](https://developer.wordpress.org/plugins/hooks/filters/). They were initially implemented in PHP, but for the purpose of Gutenberg they were ported to JavaScript and published to npm as [@wordpress/hooks](https://www.npmjs.com/package/@wordpress/hooks) package for general purpose use. You can also learn more about both APIs: [PHP](https://codex.wordpress.org/Plugin_API/) and [JavaScript](https://github.com/WordPress/packages/tree/master/packages/hooks).
-
-## Modifying Blocks
+# Block Filters
To modify the behavior of existing blocks, Gutenberg exposes several APIs:
@@ -93,7 +89,7 @@ wp.hooks.addFilter(
);
```
-_Note:_ This filter must always be run on every page load, and not in your browser's developer tools console. Otherwise, a [block validation](../../docs/block-api/block-edit-save.md#validation) error will occur the next time the post is edited. This is due to the fact that block validation occurs by verifying that the saved output matches what is stored in the post's content during editor initialization. So, if this filter does not exist when the editor loads, the block will be marked as invalid.
+_Note:_ This filter must always be run on every page load, and not in your browser's developer tools console. Otherwise, a [block validation](../../../../docs/designers-developers/developers/block-api/block-edit-save.md#validation) error will occur the next time the post is edited. This is due to the fact that block validation occurs by verifying that the saved output matches what is stored in the post's content during editor initialization. So, if this filter does not exist when the editor loads, the block will be marked as invalid.
#### `blocks.getBlockDefaultClassName`
@@ -117,13 +113,9 @@ wp.hooks.addFilter(
);
```
-#### `blocks.isUnmodifiedDefaultBlock.attributes`
-
-Used internally by the default block (paragraph) to exclude the attributes from the check if the block was modified.
-
#### `blocks.switchToBlockType.transformedBlock`
-Used to filters an individual transform result from block transformation. All of the original blocks are passed, since transformations are many-to-many, not one-to-one.
+Used to filter an individual transform result from block transformation. All of the original blocks are passed since transformations are many-to-many, not one-to-one.
#### `blocks.getBlockAttributes`
@@ -202,19 +194,13 @@ _Example:_
```js
var el = wp.element.createElement;
-var withDataAlign = wp.compose.createHigherOrderComponent( function( BlockListBlock ) {
+var withClientIdClassName = wp.compose.createHigherOrderComponent( function( BlockListBlock ) {
return function( props ) {
var newProps = lodash.assign(
{},
props,
{
- wrapperProps: lodash.assign(
- {},
- props.wrapperProps,
- {
- 'data-align': props.block.attributes.align
- }
- )
+ className: "block-" + props.clientId,
}
);
@@ -223,27 +209,22 @@ var withDataAlign = wp.compose.createHigherOrderComponent( function( BlockListBl
newProps
);
};
-}, 'withAlign' );
+}, 'withClientIdClassName' );
-wp.hooks.addFilter( 'editor.BlockListBlock', 'my-plugin/with-data-align', withDataAlign );
+wp.hooks.addFilter( 'editor.BlockListBlock', 'my-plugin/with-client-id-class-name', withClientIdClassName );
```
{% ESNext %}
```js
const { createHigherOrderComponent } = wp.compose;
-const withDataAlign = createHigherOrderComponent( ( BlockListBlock ) => {
+const withClientIdClassName = createHigherOrderComponent( ( BlockListBlock ) => {
return ( props ) => {
- const { align } = props.block.attributes;
-
- let wrapperProps = props.wrapperProps;
- wrapperProps = { ...wrapperProps, 'data-align': align };
-
- return ;
+ return ;
};
-}, 'withDataAlign' );
+}, 'withClientIdClassName' );
-wp.hooks.addFilter( 'editor.BlockListBlock', 'my-plugin/with-data-align', withDataAlign );
+wp.hooks.addFilter( 'editor.BlockListBlock', 'my-plugin/with-client-id-class-name', withClientIdClassName );
```
{% end %}
@@ -333,7 +314,7 @@ function my_plugin_block_categories( $categories, $post ) {
array(
'slug' => 'my-category',
'title' => __( 'My category', 'my-plugin' ),
- 'icon' => ' ',
+ 'icon' => 'wordpress',
),
)
);
@@ -341,5 +322,18 @@ function my_plugin_block_categories( $categories, $post ) {
add_filter( 'block_categories', 'my_plugin_block_categories', 10, 2 );
```
-You can also display an icon with your block category by setting an `icon` attribute. The value can be the slug of a [WordPress Dashicon](https://developer.wordpress.org/resource/dashicons/), or a custom `svg` element.
+You can also display an icon with your block category by setting an `icon` attribute. The value can be the slug of a [WordPress Dashicon](https://developer.wordpress.org/resource/dashicons/).
+
+It is possible to set an SVG as the icon of the category if a custom icon is needed. To do so, the icon should be rendered and set on the frontend, so it can make use of WordPress SVG, allowing mobile compatibility and making the icon more accessible.
+
+To set an SVG icon for the category shown in the previous example, add the following example JavaScript code to the editor calling `wp.blocks.updateCategory` e.g:
+```js
+( function() {
+ var el = wp.element.createElement;
+ var SVG = wp.components.SVG;
+ var circle = el( 'circle', { cx: 10, cy: 10, r: 10, fill: 'red', stroke: 'blue', strokeWidth: '10' } );
+ var svgIcon = el( SVG, { width: 20, height: 20, viewBox: '0 0 20 20'}, circle);
+ wp.blocks.updateCategory( 'my-category', { icon: svgIcon } );
+} )();
+```
diff --git a/docs/designers-developers/developers/filters/editor-filters.md b/docs/designers-developers/developers/filters/editor-filters.md
new file mode 100644
index 00000000000000..1289b8241936ba
--- /dev/null
+++ b/docs/designers-developers/developers/filters/editor-filters.md
@@ -0,0 +1,18 @@
+# Editor Filters (Experimental)
+
+To modify the behavior of the editor experience, Gutenberg exposes the following Filters:
+
+### `editor.PostFeaturedImage.imageSize`
+
+Used to modify the image size displayed in the Post Featured Image component. It defaults to `'post-thumbnail'`, and will fail back to the `full` image size when the specified image size doesn't exist in the media object. It's modeled after the `admin_post_thumbnail_size` filter in the Classic Editor.
+
+_Example:_
+
+```js
+var withImageSize = function( size, mediaId, postId ) {
+ return 'large';
+};
+
+wp.hooks.addFilter( 'editor.PostFeaturedImage.imageSize', 'my-plugin/with-image-size', withImageSize );
+```
+
diff --git a/docs/extensibility/parser.md b/docs/designers-developers/developers/filters/parser-filters.md
similarity index 98%
rename from docs/extensibility/parser.md
rename to docs/designers-developers/developers/filters/parser-filters.md
index 7c1e5bc1be7c21..3acfb2489182db 100644
--- a/docs/extensibility/parser.md
+++ b/docs/designers-developers/developers/filters/parser-filters.md
@@ -1,4 +1,4 @@
-# Extending the Parser
+# Parser Filters
When the editor is interacting with blocks, these are stored in memory as data structures comprising a few basic properties and attributes. Upon saving a working post we serialize these data structures into a specific HTML structure and save the resultant string into the `post_content` property of the post in the WordPress database. When we load that post back into the editor we have to make the reverse transformation to build those data structures from the serialized format in HTML.
diff --git a/docs/designers-developers/developers/internationalization.md b/docs/designers-developers/developers/internationalization.md
new file mode 100644
index 00000000000000..68cafea0e4257f
--- /dev/null
+++ b/docs/designers-developers/developers/internationalization.md
@@ -0,0 +1,47 @@
+# Internationalization
+
+This document aims to give an overview of the possibilities for both internationalization and localization when developing with Gutenberg.
+
+## PHP
+
+For years, WordPress has been providing the necessary tools and functions to internationalize plugins and themes. This includes helper functions like `__()` and similar.
+
+### Common Methods
+
+- `__( 'Hello World', 'my-text-domain' )`: Translate a certain string.
+- `_x( 'Block', 'noun', 'my-text-domain' )`: Translate a certain string with some additional context.
+- `_e( 'Hello World', 'my-text-domain' )`: Translate and print a certain string.
+- `esc_html__( 'Hello World', 'my-text-domain' )`: Translate a certain string and escape it for safe use in HTML output.
+- `esc_html_e( 'Hello World', 'my-text-domain' )`: Translate a certain string, escape it for safe use in HTML output, and print it.
+- `_n( '%s Comment', '%s Comments', $number, 'my-text-domain' )`: Translate and retrieve the singular or plural form based on the supplied number.
+ Usually used in combination with `sprintf()` and `number_format_i18n()`.
+
+## JavaScript
+
+Historically, `wp_localize_script()` has been used to put server-side PHP data into a properly-escaped native JavaScript object.
+
+The new editor introduces a new approach to translating strings for the editor through a new package called `@wordpress/i18n`.
+
+The new script package is registered with WordPress as `wp-i18n` and should be declared as a dependency during `wp_register_script()` and imported as a global off the Window object as `wp.i18n`.
+
+Depending on your developer workflow, you might want to use WP-CLI's `wp i18n make-pot` command or a build tool for Babel called `@wordpress/babel-plugin-makepot` to create the necessary translation file. The latter approach integrates with Babel to extract the I18N methods.
+
+### Common methods in wp.i18n (may look similar)
+
+- `setLocaleData( data: Object, domain: string )`: Creates a new I18N instance providing translation data for a domain.
+- `__( 'Hello World', 'my-text-domain' )`: Translate a certain string.
+- `_n( '%s Comment', '%s Comments', numberOfComments, 'my-text-domain' )`: Translate and retrieve the singular or plural form based on the supplied number.
+- `_x( 'Default', 'block style', 'my-text-domain' )`: Translate a certain string with some additional context.
+- `sprintf()`: JavaScript port of the PHP function with the same name.
+
+### Loading Translations
+
+WordPress 5.0 introduces a new function called `wp_set_script_translations( 'my-script-handle', 'my-text-domain' )` to load translation files for a given script handle.
+
+You can learn more about it in [the JavaScript I18N dev note](https://make.wordpress.org/core/2018/11/09/new-javascript-i18n-support-in-wordpress/).
+
+## More Resources
+
+- [WP-CLI I18N command to generate translation catalogues](https://github.com/wp-cli/i18n-command)
+- [Plugin Developer Handbook](https://developer.wordpress.org/plugins/internationalization/)
+- [Theme Developer Handbook](https://developer.wordpress.org/themes/internationalization/)
diff --git a/docs/designers-developers/developers/packages.md b/docs/designers-developers/developers/packages.md
new file mode 100644
index 00000000000000..7096f67115a28e
--- /dev/null
+++ b/docs/designers-developers/developers/packages.md
@@ -0,0 +1,40 @@
+# Packages
+
+Gutenberg exposes a list of JavaScript packages and tools for WordPress development.
+
+## Using the packages via WordPress global
+
+JavaScript packages are available as a registered script in WordPress and can be accessed using the `wp` global variable.
+
+If you wanted to use the `PlainText` component from the editor module, first you would specify `wp-editor` as a dependency when you enqueue your script:
+
+```php
+wp_enqueue_script(
+ 'my-custom-block',
+ plugins_url( $block_path, __FILE__ ),
+ array( 'wp-blocks', 'wp-editor', 'wp-element', 'wp-i18n' )
+);
+```
+
+After the dependency is declared, you can access the module in your JavaScript code using the global `wp` like so:
+```js
+const { PlainText } = wp.editor;
+
+```
+
+## Using the packages via npm
+
+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:
+
+```bash
+npm install @wordpress/editor --save
+```
+
+Once installed, you can access the component in your code using:
+
+```js
+import { PlainText } from '@wordpress/editor';
+```
+
diff --git a/docs/designers-developers/developers/themes/README.md b/docs/designers-developers/developers/themes/README.md
new file mode 100644
index 00000000000000..e2bc67c0599eaa
--- /dev/null
+++ b/docs/designers-developers/developers/themes/README.md
@@ -0,0 +1,5 @@
+# Theming for Gutenberg
+
+The new editor provides a number of options for theme designers and developers, including theme-defined color settings, font size control, and much more.
+
+In this section, you'll learn about the ways that themes can customise the editor.
diff --git a/docs/extensibility/theme-support.md b/docs/designers-developers/developers/themes/theme-support.md
similarity index 83%
rename from docs/extensibility/theme-support.md
rename to docs/designers-developers/developers/themes/theme-support.md
index db0b129608eca2..a5da2c7199e97b 100644
--- a/docs/extensibility/theme-support.md
+++ b/docs/designers-developers/developers/themes/theme-support.md
@@ -1,5 +1,15 @@
# Theme Support
+The new Blocks include baseline support in all themes, enhancements to opt-in to and the ability to extend and customize.
+
+There are a few new concepts to consider when building themes:
+
+- **Editor Color Palette** - A default set of colors is provided, but themes can register their own and optionally lock users into picking from the defined palette.
+- **Editor Text Size Palette** - A default set of sizes is provided, but themes and register their own and optionally lock users into picking from preselected sizes.
+- **Responsive Embeds** - Themes must opt-in to responsive embeds.
+- **Frontend & Editor Styles** - To get the most out of blocks, theme authors will want to make sure Core styles look good and opt-in, or write their own styles to best fit their theme.
+- **Dark Mode** - If a Theme is a Dark Theme with a dark background containing light text, the theme author can opt-in to the Dark Mode.
+
By default, blocks provide their styles to enable basic support for blocks in themes without any change. Themes can add/override these styles, or they can provide no styles at all, and rely fully on what the blocks provide.
Some advanced block features require opt-in support in the theme itself as it's difficult for the block to provide these styles, they may require some architecting of the theme itself, in order to work well.
@@ -57,7 +67,7 @@ Here's the markup for an `Image` with a caption:
```html
-
+
Short image caption.
```
@@ -67,7 +77,7 @@ Here's the markup for a left-floated image:
```html
-
+
Short image caption.
@@ -118,13 +128,12 @@ Themes are responsible for creating the classes that apply the colors in differe
}
```
-The class name is built appending 'has-', followed by the class name *using* kebab case and ending with the context name.
+The class name is built appending 'has-', followed by the class name _using_ kebab case and ending with the context name.
### Block Font Sizes:
Blocks may allow the user to configure the font sizes they use, e.g., the paragraph block. Gutenberg provides a default set of font sizes, but a theme can overwrite it and provide its own:
-
```php
add_theme_support( 'editor-font-sizes', array(
array(
@@ -157,13 +166,13 @@ add_theme_support( 'editor-font-sizes', array(
The font sizes are rendered on the font size picker in the order themes provide them.
Themes are responsible for creating the classes that apply the correct font size styles.
-The class name is built appending 'has-', followed by the font size name *using* kebab case and ending with `-font-size`.
+The class name is built appending 'has-', followed by the font size name _using_ kebab case and ending with `-font-size`.
As an example for the regular font size, a theme may provide the following class.
```css
.has-regular-font-size {
- font-size: 16px;
+ font-size: 16px;
}
```
@@ -193,7 +202,9 @@ This flag will make sure users are only able to choose colors from the `editor-c
Gutenberg supports the theme's [editor styles](https://codex.wordpress.org/Editor_Style), however it works a little differently than in the classic editor.
-In the classic editor, the editor stylesheet is loaded directly into the iframe of the WYSIWYG editor, with no changes. Gutenberg, however, doesn't use iframes. To make sure your styles are applied only to the content of the editor, we automatically transform your editor styles by selectively rewriting or adjusting certain CSS selectors.
+In the classic editor, the editor stylesheet is loaded directly into the iframe of the WYSIWYG editor, with no changes. Gutenberg, however, doesn't use iframes. To make sure your styles are applied only to the content of the editor, we automatically transform your editor styles by selectively rewriting or adjusting certain CSS selectors. This also allows Gutenberg to leverage your editor style in block variation previews.
+
+For example, if you write `body { ... }` in your editor style, this is rewritten to `.editor-styles-wrapper { ... }`. This also means that you should _not_ target any of the editor class names directly.
Because it works a little differently, you need to opt-in to this by adding an extra snippet to your theme, in addition to the add_editor_style function:
@@ -203,6 +214,8 @@ add_theme_support('editor-styles');
You shouldn't need to change your editor styles too much; most themes can add the snippet above and get similar results in the classic editor and inside Gutenberg.
+### Dark backgrounds
+
If your editor style relies on a dark background, you can add the following to adjust the color of the UI to work on dark backgrounds:
```php
@@ -212,6 +225,16 @@ add_theme_support( 'dark-editor-style' );
Note you don't need to add `add_theme_support( 'editor-styles' );` twice, but that rule does need to be present for the `dark-editor-style` rule to work.
+### Enqueuing the editor style
+
+To make sure your editor style is loaded and parsed correctly, enqueue it using the following method:
+
+```php
+add_editor_style( 'style-editor.css' );
+```
+
+It is enough to paste that in your `functions.php` file, for the style to be loaded and parsed.
+
### Basic colors
You can style the editor like any other webpage. Here's how to change the background color and the font color to blue:
@@ -262,9 +285,7 @@ add_theme_support( 'wp-block-styles' );
The embed blocks automatically apply styles to embedded content to reflect the aspect ratio of content that is embedded in an iFrame. A block styled with the aspect ratio responsive styles would look like:
```html
-
- ...
-
+...
```
To make the content resize and keep its aspect ratio, the `` element needs the `wp-embed-responsive` class. This is not set by default, and requires the theme to opt in to the `responsive-embeds` feature:
diff --git a/docs/blocks/applying-styles-with-stylesheets.md b/docs/designers-developers/developers/tutorials/block-tutorial/applying-styles-with-stylesheets.md
similarity index 100%
rename from docs/blocks/applying-styles-with-stylesheets.md
rename to docs/designers-developers/developers/tutorials/block-tutorial/applying-styles-with-stylesheets.md
diff --git a/docs/blocks/block-controls-toolbars-and-inspector.md b/docs/designers-developers/developers/tutorials/block-tutorial/block-controls-toolbars-and-inspector.md
similarity index 92%
rename from docs/blocks/block-controls-toolbars-and-inspector.md
rename to docs/designers-developers/developers/tutorials/block-tutorial/block-controls-toolbars-and-inspector.md
index 236e9856197696..1bad64b3d95329 100644
--- a/docs/blocks/block-controls-toolbars-and-inspector.md
+++ b/docs/designers-developers/developers/tutorials/block-tutorial/block-controls-toolbars-and-inspector.md
@@ -4,7 +4,7 @@ To simplify block customization and ensure a consistent experience for users, th
## Toolbar
-
+
When the user selects a block, a number of control buttons may be shown in a toolbar above the selected block. Some of these block-level controls are included automatically if the editor is able to transform the block to another type, or if the focused element is an RichText component.
@@ -171,7 +171,7 @@ Note that `BlockControls` is only visible when the block is currently selected a
## Inspector
-
+
The inspector is used to display less-often-used settings or settings that require more screen space. The inspector should be used for **block-level settings only**.
diff --git a/docs/blocks/creating-dynamic-blocks.md b/docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md
similarity index 100%
rename from docs/blocks/creating-dynamic-blocks.md
rename to docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md
diff --git a/docs/blocks/generate-blocks-with-wp-cli.md b/docs/designers-developers/developers/tutorials/block-tutorial/generate-blocks-with-wp-cli.md
similarity index 100%
rename from docs/blocks/generate-blocks-with-wp-cli.md
rename to docs/designers-developers/developers/tutorials/block-tutorial/generate-blocks-with-wp-cli.md
diff --git a/docs/blocks/introducing-attributes-and-editable-fields.md b/docs/designers-developers/developers/tutorials/block-tutorial/introducing-attributes-and-editable-fields.md
similarity index 96%
rename from docs/blocks/introducing-attributes-and-editable-fields.md
rename to docs/designers-developers/developers/tutorials/block-tutorial/introducing-attributes-and-editable-fields.md
index 7f96bd78986798..3a993ce1c2b71a 100644
--- a/docs/blocks/introducing-attributes-and-editable-fields.md
+++ b/docs/designers-developers/developers/tutorials/block-tutorial/introducing-attributes-and-editable-fields.md
@@ -110,7 +110,7 @@ registerBlockType( 'gutenberg-boilerplate-esnext/hello-world-step-03', {
```
{% end %}
-When registering a new block type, the `attributes` property describes the shape of the attributes object you'd like to receive in the `edit` and `save` functions. Each value is a [source function](../../docs/block-api/attributes.md) to find the desired value from the markup of the block.
+When registering a new block type, the `attributes` property describes the shape of the attributes object you'd like to receive in the `edit` and `save` functions. Each value is a [source function](../../../../../docs/designers-developers/developers/block-api/block-attributes.md) to find the desired value from the markup of the block.
In the code snippet above, when loading the editor, we will extract the `content` value as the HTML of the paragraph element in the saved post's markup.
diff --git a/docs/blocks.md b/docs/designers-developers/developers/tutorials/block-tutorial/readme.md
similarity index 100%
rename from docs/blocks.md
rename to docs/designers-developers/developers/tutorials/block-tutorial/readme.md
diff --git a/docs/blocks/writing-your-first-block-type.md b/docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md
similarity index 96%
rename from docs/blocks/writing-your-first-block-type.md
rename to docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md
index 91680bbf7d6556..e696b73e4e911d 100644
--- a/docs/blocks/writing-your-first-block-type.md
+++ b/docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md
@@ -30,6 +30,8 @@ Note the two script dependencies:
- __`wp-blocks`__ includes block type registration and related functions
- __`wp-element`__ includes the [WordPress Element abstraction](https://github.com/WordPress/gutenberg/tree/master/packages/element) for describing the structure of your blocks
+If you were to use a component from the `wp-editor` package, for example the RichText component, you would also need to add `wp-editor` to the dependency list.
+
## Registering the Block
With the script enqueued, let's look at the implementation of the block itself:
diff --git a/docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md b/docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md
new file mode 100644
index 00000000000000..67d703cb37310f
--- /dev/null
+++ b/docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md
@@ -0,0 +1,66 @@
+# Extending the Block Editor
+
+Let's look at using the [Block Style Variation example](../../../../../docs/designers-developers/developers/filters/block-filters.md#block-style-variations) to extend the editor. This example allows you to add your own custom CSS class name to any core block type.
+
+Replace the existing `console.log()` code in your `myguten.js` file with:
+
+```js
+wp.blocks.registerBlockStyle( 'core/quote', {
+ name: 'fancy-quote',
+ label: 'Fancy Quote'
+} );
+```
+
+**Important:** Notice that you are using a function from `wp.blocks` package. This means you must specify it as a dependency when you enqueue the script. Update the `myguten-plugin.php` file to:
+
+```php
+` tag that loads your file. In our example, you would search for `myguten.js` and confirm it is being loaded.
+
+If you do not see the file being loaded, doublecheck the enqueue function is correct. You can also check your server logs to see if there is an error messages.
+
+## Confirm all dependencies are loaded
+
+The console log will show an error if a dependency your JavaScript code uses has not been declared and loaded in the browser. In the example, if `myguten.js` script is enqueued without declaring the `wp-blocks` dependency, the console log will show:
+
+
+
+You can correct by checking your `wp_enqueue_script` function includes all packages listed that are used:
+
+```js
+wp_enqueue_script(
+ 'myguten-script',
+ plugins_url( 'myguten.js', __FILE__ ),
+ array( 'wp-blocks' )
+);
+```
+
diff --git a/docs/designers-developers/developers/tutorials/javascript/versions-and-building.md b/docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
new file mode 100644
index 00000000000000..c7de41efd4d0a8
--- /dev/null
+++ b/docs/designers-developers/developers/tutorials/javascript/versions-and-building.md
@@ -0,0 +1,11 @@
+# JavaScript versions and build step
+
+The Gutenberg Handbook shows JavaScript examples in two syntaxes: ES5 and ESNext. These are version names for the JavaScript language standard definitions. You may also see elsewhere the names ES6, or ECMAScript 2015 mentioned. See the [ECMAScript](https://en.wikipedia.org/wiki/ECMAScript) Wikipedia article for all the details.
+
+ES5 code is compatible with WordPress's minimum [target for browser support](https://make.wordpress.org/core/handbook/best-practices/browser-support/).
+
+"ESNext" doesn't refer to a specific version of JavaScript, but is "dynamic" and refers to the next language definitions, whatever they might be. Because some browsers won't support these features yet (because they're new or proposed), an extra build step is required to transform the code to a syntax that works in all browsers. Webpack and babel are the tools that perform this transformation step.
+
+Additionally, the ESNext code examples in the Gutenberg handbook include [JSX syntax](https://reactjs.org/docs/introducing-jsx.html), a syntax that blends HTML and JavaScript. It makes it easier to read and write markup code, but likewise requires the build step using webpack and babel to transform into compatible code.
+
+For simplicity, this tutorial uses the ES5 definition of JavaScript, without JSX. This code can run straight in your browser and does not require an additional build step.
diff --git a/docs/designers-developers/developers/tutorials/readme.md b/docs/designers-developers/developers/tutorials/readme.md
new file mode 100644
index 00000000000000..543f560c8d81c1
--- /dev/null
+++ b/docs/designers-developers/developers/tutorials/readme.md
@@ -0,0 +1,6 @@
+# Tutorials
+
+* If you want to learn more about block creation, the [Blocks Tutorial](../../../../docs/designers-developers/developers/tutorials/block-tutorial/readme.md) is the best place to start.
+
+* See the [Getting Started with JavaScript Tutorial](../../../../docs/designers-developers/developers/tutorials/javascript/readme.md) to learn about how to use JavaScript within WordPress.
+
diff --git a/docs/reference/faq.md b/docs/designers-developers/faq.md
similarity index 89%
rename from docs/reference/faq.md
rename to docs/designers-developers/faq.md
index 740c641f7914e5..fb2d16dfe68fce 100644
--- a/docs/reference/faq.md
+++ b/docs/designers-developers/faq.md
@@ -1,5 +1,7 @@
# Frequently Asked Questions
+This initial set of questions were created when the Gutenberg project was relatively new, for a more recent set of questions, please see Matt's November 2018 post [WordPress 5.0: A Gutenberg FAQ](https://ma.tt/2018/11/a-gutenberg-faq/).
+
## What is Gutenberg?
“Gutenberg” is the name of the project to create a new editor experience for WordPress. The goal is to create a new post and page editing experience that makes it easy for anyone to create rich post layouts. This was the kickoff goal:
@@ -12,16 +14,14 @@ Key takeaways include the following points:
- By embracing blocks as an interaction paradigm, we can unify multiple different interfaces into one. Instead of learning how to write shortcodes and custom HTML, or pasting URLs to embed media, there's a common, reliable flow for inserting any kind of content.
- “Mystery meat” refers to hidden features in software, features that you have to discover. WordPress already supports a large number of blocks and 30+ embeds, so let's surface them.
-Gutenberg is being developed on [GitHub](https://github.com/WordPress/gutenberg) under the WordPress organization, and you can try [a beta version today—it's available in the plugin repository](https://wordpress.org/plugins/gutenberg/). It's important to keep in mind that Gutenberg is not yet fully functional, feature complete, or production ready. But we'd love your help to make that a reality.
+Gutenberg is being developed on [GitHub](https://github.com/WordPress/gutenberg) under the WordPress organization, and you can use it today — [available in the plugin repository](https://wordpress.org/plugins/gutenberg/).
## When will Gutenberg be merged into WordPress?
-We are hoping that Gutenberg will be sufficiently polished, tested, iterated, and proven enough to be [merged into WordPress 5.0](https://ma.tt/2017/06/4-8-and-whats-coming/), with an estimated release date of 2018.
+Gutenberg will be merged into WordPress 5.0, and will be released at the end of 2018, or early 2019. Please follow [WordPress.org News](https://wordpress.org/news/) for the latest information.
The editor focus started in early 2017 with the first three months spent designing, planning, prototyping, and testing prototypes, to help us inform how to approach this project. The actual plugin, which you can install from the repository, was launched during WordCamp Europe in June.
-There is still plenty of work to do, but we are moving fast. New updates tend to be released on a weekly basis. Please help us by giving feedback, surfacing issues, testing, or even contributing, so we can be ready in time for WordPress 5.0.
-
## What are “blocks” and why are we using them?
The current WordPress editor is an open text window—it’s always been a wonderful blank canvas for writing, but when it comes to building posts and pages with images, multimedia, embedded content from social media, polls, and other elements, it required a mix of different approaches that were not always intuitive:
@@ -251,7 +251,7 @@ Our [list of supported browsers can be found in the Make WordPress handbook](htt
## How do I make my own block?
-The API for creating blocks is a crucial aspect of the project. We are working on improved documentation and tutorials. Check out the [Creating Block Types](../../docs/blocks.md) section to get started.
+The API for creating blocks is a crucial aspect of the project. We are working on improved documentation and tutorials. Check out the [Creating Block Types](../../docs/designers-developers/developers/tutorials/block-tutorial/readme.md) section to get started.
## Does Gutenberg involve editing posts/pages in the front-end?
@@ -273,9 +273,7 @@ Indeed. There are multiple ways in which custom post types can leverage Gutenber
## Will there be columns?
-Our primary goal is on a solid block foundation before exploring column support.
-
-*See:* [Issue #219](https://github.com/WordPress/gutenberg/issues/219)
+Yes, a columns block is available in Gutenberg.
## Will there be nested blocks?
@@ -285,7 +283,7 @@ See also [Issue #428](https://github.com/WordPress/gutenberg/issues/428)
## Will drag and drop be used for rearranging blocks?
-A key value for Gutenberg has been to see drag and drop as an _additive enhancement_. When explicit actions (_click_ or _tab_ + _space_) exist can we add drag and drop as an enhancement on top of it. So yes, we expect drag and drop to be part of Gutenberg, even if it isn't today.
+Yes, you can drag and drop blocks to rearrange their order.
## Can themes _style_ blocks?
@@ -297,7 +295,7 @@ Blocks will be able to provide base structural CSS styles, and themes can add st
Other features, like the new _wide_ and _full-wide_ alignment options, will simply be CSS classes applied to blocks that offer this alignment. We are looking at how a theme can opt in to this feature, for example using `add_theme_support`.
-*See:* [Theme Support](../../docs/extensibility/theme-support.md)
+*See:* [Theme Support](../../docs/designers-developers/developers/themes/theme-support.md)
## How will editor styles work?
@@ -310,7 +308,7 @@ function gutenbergtheme_editor_styles() {
add_action( 'enqueue_block_editor_assets', 'gutenbergtheme_editor_styles' );
```
-*Details:* [Editor Styles](../../docs/extensibility/theme-support.md#editor-styles)
+*See:* [Editor Styles](../../docs/designers-developers/developers/themes/theme-support.md#editor-styles)
## Should I be concerned that Gutenberg will make my plugin obsolete?
@@ -322,9 +320,10 @@ We realize it's a big change. We also think there will be many new opportunities
## Will I be able to opt out of Gutenberg for my site?
-We are looking at ways to make Gutenberg configurable for many use cases, including disabling different aspects (like blocks, panels, etc.).
+There is a “Classic” block, which is virtually the same as the current editor, except in block form.
+
+There is also the [Classic Editor Plugin](https://wordpress.org/plugins/classic-editor/) which restores the previous editor, see the plugin for more information. The WordPress Core team has committed to supporting the Classic Editor Plugin [until December 2021](https://make.wordpress.org/core/2018/11/07/classic-editor-plugin-support-window/).
-There is also be a “Classic” block, which is virtually the same as the current editor, except in block form. There’s also likely to be a very popular plugin in the repository to replace Gutenberg with the classic editor.
## How will custom TinyMCE buttons work in Gutenberg?
@@ -333,11 +332,13 @@ Custom TinyMCE buttons will still work in the “Classic” block, which is a bl
(Gutenberg comes with a new universal inserter tool, which gives you access to every block available, searchable, sorted by recency and categories. This inserter tool levels the playing field for every plugin that adds content to the editor, and provides a single interface to learn how to use.)
## How will shortcodes work in Gutenberg?
+
Shortcodes will continue to work as they do now.
However we see the block as an evolution of the `[shortcode]`. Instead of having to type out code, you can use the universal inserter tray to pick a block and get a richer interface for both configuring the block and previewing it. We would recommend people eventually upgrade their shortcodes to be blocks.
## Should I move shortcodes to content blocks?
+
We think so. Blocks are designed to be visually representative of the final look, and they will likely become the expected way in which users will discover and insert content in WordPress.
## Will Gutenberg be made properly accessible?
@@ -346,19 +347,13 @@ Accessibility is not an afterthought. Not every aspect of Gutenberg is accessibl
If you would like to contribute to the accessibility of Gutenberg, we can always use more people to test and contribute.
-## Are there any design resources for Gutenberg?
-
-Yes, primarily in [design principles](../../docs/reference/design-principles.md)
-
-We are still adding more documentation.
-
## How is data stored? I've seen HTML comments, what is their purpose?
Our approach—as outlined in [the technical overview introduction](https://make.wordpress.org/core/2017/01/17/editor-technical-overview/)—is to augment the existing data format in a way that doesn’t break the decade-and-a-half-fabric of content WordPress provides. In other terms, this optimizes for a format that prioritizes human readability (the HTML document of the web) and easy-to-render-anywhere over a machine convenient file (JSON in post-meta) that benefits the editing context primarily.
This also [gives us the flexibility](https://github.com/WordPress/gutenberg/issues/1516) to store those blocks that are inherently separate from the content stream (reusable pieces like widgets or small post type elements) elsewhere, and just keep token references for their placement.
-We suggest you look at the [language of Gutenberg](../../docs/language.md) to learn more about how this aspect of the project works.
+We suggest you look at the [Gutenberg key concepts](../../docs/designers-developers/key-concepts.md) to learn more about how this aspect of the project works.
## How can I parse the post content back out into blocks in PHP or JS?
In JS:
@@ -370,7 +365,8 @@ var blocks = wp.blocks.parse( postContent );
In PHP:
```php
-$blocks = gutenberg_parse_blocks( $post_content );
+$blocks = gutenberg_parse_blocks( $post_content ); // plugin
+$blocks = parse_blocks( $post_content ); // WordPress 5.0
```
## Why should I start using this once released?
diff --git a/docs/designers-developers/glossary.md b/docs/designers-developers/glossary.md
new file mode 100644
index 00000000000000..f51c0d16d5dbab
--- /dev/null
+++ b/docs/designers-developers/glossary.md
@@ -0,0 +1,61 @@
+# Glossary
+
+
+Attribute sources
+An object describing the attributes shape of a block. The keys can be named as most appropriate to describe the state of a block type. The value for each key is a function which describes the strategy by which the attribute value should be extracted from the content of a saved post's content. When processed, a new object is created, taking the form of the keys defined in the attribute sources, where each value is the result of the attribute source function.
+
+Attributes
+The object representation of the current state of a block in post content. When loading a saved post, this is determined by the attribute sources for the block type. These values can change over time during an editing session when the user modifies a block, and are used when determining how to serialize the block.
+
+Block
+The abstract term used to describe units of markup that, composed together, form the content or layout of a webpage. The idea combines concepts of what in WordPress today we achieve with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience.
+
+Block Categories
+These are not a WordPress taxonomy, but instead used internally to sort blocks in the Block Inserter.
+
+Block Inserter
+Primary interface for selecting from the available blocks, triggered by plus icon buttons on Blocks or in the top-left of the editor interface.
+
+Block name
+A unique identifier for a block type, consisting of a plugin-specific namespace and a short label describing the block's intent. e.g. core/image
+
+Block type
+In contrast with the blocks composing a particular post, a block type describes the blueprint by which any block of that type should behave. So while there may be many images within a post, each behaves consistent with a unified image block type definition.
+
+Classic block
+A block which embeds the TinyMCE editor as a block, TinyMCE was the base of the previous core editor. Older content created prior to the block editor will be loaded in to a single Classic block.
+
+Dynamic block
+A type of block where the content of which may change and cannot be determined at the time of saving a post, instead calculated any time the post is shown on the front of a site. These blocks may save fallback content or no content at all in their JavaScript implementation, instead deferring to a PHP block implementation for runtime rendering.
+
+Inspector
+A block settings region shown in place of the post settings when a block is selected. Fields may be shown here to allow the user to customize the selected block.
+
+Post settings
+A sidebar region containing metadata fields for the post, including scheduling, visibility, terms, and featured image.
+
+RichText
+A common component enabling rich content editing including bold, italics, hyperlinks, etc. It is not too much unlike the single editor region of the legacy post editor, and is in fact powered by the same TinyMCE library.
+
+Reusable block
+A block that is saved and then can be shared as a reusable, repeatable piece of content.
+
+Sidebar
+The panel on the right which contains the document and block settings. The sidebar is toggled using the Settings gear icon.
+
+Serialization
+The process of converting a block's attributes object into HTML markup, which occurs each time a block is edited.
+
+Static block
+A type of block where the content of which is known at the time of saving a post. A static block will be saved with HTML markup directly in post content.
+
+TinyMCE
+TinyMCE is a web-based JavaScript WYSIWYG (What You See Is What You Get) editor.
+
+Toolbar
+A set of button controls. In the context of a block, usually referring to the toolbar of block controls shown above the selected block.
+
+Template
+ A template is a pre-defined arrangement of blocks, possibly with predefined attributes or placeholder content. You can provide a template for a post type, to give users a starting point when creating a new piece of content, or inside a custom block with the InnerBlocks component. See the templates documentation for more information. See templates documentation for more information.
+
+
diff --git a/docs/language.md b/docs/designers-developers/key-concepts.md
similarity index 73%
rename from docs/language.md
rename to docs/designers-developers/key-concepts.md
index 8a71e707619fbc..ff9007185fe0e7 100644
--- a/docs/language.md
+++ b/docs/designers-developers/key-concepts.md
@@ -1,4 +1,52 @@
-# The Language of Gutenberg
+# Key Concepts
+
+## Blocks
+
+Blocks are an abstract unit for organizing and composing content, strung together to create content for a webpage.
+
+Blocks are hierarchical, in that a block can be a child or parent to another block. One example is a two-column Columns block can be the parent block to multiple child blocks in each column.
+
+If it helps, you can think of blocks as a more graceful shortcode, with rich formatting tools for users to compose content. To this point, there is a new Block Grammar. Distilled, the block grammar is an HTML comment, either a self-closing tag or with a beginning tag and ending tag. In the main tag, depending on the block type and user customizations, there can be a JSON object. This raw form of the block is referred to as serialized.
+
+```html
+
+Welcome to the world of blocks.
+
+```
+
+Blocks can be static or dynamic. Static blocks contain rendered content and an object of Attributes used to re-render based on changes. Dynamic blocks require server-side data and rendering while the post content is being generated (rendering).
+
+Each block contains Attributes or configuration settings, which can be sourced from raw HTML in the content, via meta or other customizable origins.
+
+The Paragraph is the default Block. Instead of a new line upon typing return on a keyboard, try to think of it as an empty paragraph block (type / to trigger an autocompleting Slash Inserter -- /image will pull up Images as well as Instagram embeds).
+
+Users insert new blocks by clicking the plus button for the Block Inserter, typing / for the Slash Inserter or typing return for a blank Paragraph block.
+
+Blocks can be duplicated within content using the menu from the block's toolbar or via keyboard shortcut.
+
+Blocks can be made repeatable, shared across posts and post types and used multiple times in the same post. Changes in one place reflect everywhere that reusable block is used.
+
+Blocks can be limited or locked-in-place by Templates and custom code.
+
+#### More on Blocks
+
+- **Block API**
+- **Block Styles**
+- **Tutorial: Building A Custom Block**
+
+## Block Categories
+
+In the Block Inserter, the accordion-sorted, popup modal that shows a site's available blocks to users, each accordion title is a Block Category, which are either the defaults or customized by developers through Plugins or code.
+
+## Reusable Blocks
+
+Reusable Blocks are a way to share a block (or multiple blocks) as a reusable, repeatable piece of content.
+
+Any edits to a reusable block are made to every usage of a repeatable block.
+
+Reusable Blocks are stored as a hidden post type, and are dynamic blocks that "ref" or reference the post_id and return the post_content for that wp_block.
+
+## Templates
At the core of Gutenberg lies the concept of the block. From a technical point of view, blocks both raise the level of abstraction from a single document to a collection of meaningful elements, and they replace ambiguity—inherent in HTML—with explicit structure. A post in Gutenberg is then a _collection of blocks_.
@@ -8,7 +56,7 @@ This is true for content blocks. They are the way in which the user creates thei
Content in WordPress is stored as HTML-like text in `post_content`. HTML is a robust document markup format and has been used to describe content as simple as unformatted paragraphs of text and as complex as entire application interfaces. Understanding HTML is not trivial; a significant number of existing documents and tools deal with technically invalid or ambiguous code. This code, even when valid, can be incredibly tricky and complicated to parse – and to understand.
-The main point is to let the machines work at what they are good at, and optimize for the user and the document. The analogy with the printing press can be taken further in that what matters is the printed page, not the arrangement of metal type that originated it. As a matter of fact, the arrangement of type is a pretty inconvenient storage mechanism. The page is both the result _and_ the proper way to store the data. The metal type is just an instrument for publication and editing, but more ephemeral in nature. Exactly as our use of an object tree (e.g. JSON) in the editor. We have the ability to rebuild this structure from the printed page, as if we printed notations in the margins that allows a machine to know which [sorts](https://en.wikipedia.org/wiki/Sort_(typesetting)) (metal type) to assemble to recreate the page.
+The main point is to let the machines work at what they are good at, and optimize for the user and the document. The analogy with the printing press can be taken further in that what matters is the printed page, not the arrangement of metal type that originated it. As a matter of fact, the arrangement of type is a pretty inconvenient storage mechanism. The page is both the result _and_ the proper way to store the data. The metal type is just an instrument for publication and editing, but more ephemeral in nature. Exactly as our use of an object tree (e.g. JSON) in the editor. We have the ability to rebuild this structure from the printed page, as if we printed notations in the margins that allows a machine to know which [sorts]() (metal type) to assemble to recreate the page.
## Blocks are higher-level than HTML
@@ -20,7 +68,7 @@ Additionally, how do we even know this came from our editor? Maybe someone snuck
## The post dichotomy
-A Gutenberg post is the proper block-aware representation of a post, a collection of semantically consistent descriptions of what each block is and what its essential data is. This representation only ever exists in memory. It is the [chase](https://en.wikipedia.org/wiki/Chase_(printing)) in the typesetter's workshop, ever-shifting as sorts are attached and repositioned.
+A Gutenberg post is the proper block-aware representation of a post, a collection of semantically consistent descriptions of what each block is and what its essential data is. This representation only ever exists in memory. It is the [chase]() in the typesetter's workshop, ever-shifting as sorts are attached and repositioned.
A Gutenberg post is not the artifact it produces, namely the `post_content`. The latter is the printed page, optimized for the reader, but retaining its invisible markings for later editing.
@@ -34,25 +82,21 @@ The tree of objects describes the list of blocks that compose a post.
```js
[
- {
- type: 'core/cover-image',
- attributes: {
- url: 'my-hero.jpg',
- align: 'full',
- hasParallax: false,
- hasBackgroundDim: true
- },
- children: [
- "Gutenberg posts aren't HTML"
- ]
- },
- {
- type: 'core/paragraph',
- children: [
- "Lately I've been hearing plen…"
- ]
- }
-]
+ {
+ type: "core/cover-image",
+ attributes: {
+ url: "my-hero.jpg",
+ align: "full",
+ hasParallax: false,
+ hasBackgroundDim: true
+ },
+ children: ["Gutenberg posts aren't HTML"]
+ },
+ {
+ type: "core/paragraph",
+ children: ["Lately I've been hearing plen…"]
+ }
+];
```
## Serialization and the Purpose of HTML Comments
@@ -73,13 +117,13 @@ We chose instead to try and find a way to keep the formality and explicitness an
Of these options a novel approach was suggested that by storing data in HTML comments we would know that we wouldn't break the rest of the HTML in the document, that browsers should ignore it, and that we could simplify our approach to parsing the document.
-Unique to comments is that they cannot legitimately exist in ambiguous places, such as inside of HTML attributes like ` `. Comments are also quite permissive. Whereas HTML attributes are complicated to parse properly, comments are quite easily described by a leading ``. This simplicity and permisiveness means that the parser can be implemented in several ways without needing to understand HTML properly and we have the liberty to use more convenient syntax inside of the comment—we only need to escape double-hyphen sequences. We take advantage of this in how we store block attributes: JSON literals inside the comment.
+Unique to comments is that they cannot legitimately exist in ambiguous places, such as inside of HTML attributes like ` `. Comments are also quite permissive. Whereas HTML attributes are complicated to parse properly, comments are quite easily described by a leading ``. This simplicity and permissiveness means that the parser can be implemented in several ways without needing to understand HTML properly and we have the liberty to use more convenient syntax inside of the comment—we only need to escape double-hyphen sequences. We take advantage of this in how we store block attributes: JSON literals inside the comment.
After running this through the parser we're left with a simple object we can manipulate idiomatically and we don't have to worry about escaping or unescaping the data. It's handled for us through the serialization process. Because the comments are so different from other HTML tags and because we can perform a first-pass to extract the top-level blocks, we don't actually depend on having fully valid HTML!
This has dramatic implications for how simple and performant we can make our parser. These explicit boundaries also protect damage in a single block from bleeding into other blocks or tarnishing the entire document. It also allows the system to identify unrecognized blocks before rendering them.
-_N.B.:_ The defining aspect of blocks are their semantics and the isolation mechanism they provide; in other words, their identity. On the other hand, where their data is stored is a more liberal aspect. Blocks support more than just static local data (via JSON literals inside the HTML comment or within the block's HTML), and more mechanisms (_e.g._, global blocks or otherwise resorting to storage in complementary `WP_Post` objects) are expected. See [attributes](../docs/block-api/attributes.md) for details.
+_N.B.:_ The defining aspect of blocks are their semantics and the isolation mechanism they provide; in other words, their identity. On the other hand, where their data is stored is a more liberal aspect. Blocks support more than just static local data (via JSON literals inside the HTML comment or within the block's HTML), and more mechanisms (_e.g._, global blocks or otherwise resorting to storage in complementary `WP_Post` objects) are expected. See [attributes](../../docs/designers-developers/developers/block-api/block-attributes.md) for details.
## The Anatomy of a Serialized Block
@@ -87,9 +131,7 @@ When blocks are saved to the content, after the editing session, its attributes
```html
-
-
-
+
```
diff --git a/docs/designers-developers/readme.md b/docs/designers-developers/readme.md
new file mode 100644
index 00000000000000..107bad052f309b
--- /dev/null
+++ b/docs/designers-developers/readme.md
@@ -0,0 +1,11 @@
+# Designer & Developer Handbook
+
+Gutenberg is a transformation of the WordPress editor for working with content.
+
+
+
+Using a system of Blocks to compose and format content, the new block-based editor is designed to create rich, flexible layouts for websites and digital products. Content is created in the unit of blocks instead of freeform text with inserted media, embeds and Shortcodes (there's a Shortcode block though).
+
+Blocks treat Paragraphs, Headings, Media, Embeds all as components that strung together make up the content stored in the WordPress database, replacing the traditional concept of freeform text with embedded media and shortcodes. The new editor is designed with progressive enhancement, meaning it is back-compatible with all legacy content, offers a process to try to convert and split a Classic block into block equivalents using client-side parsing and finally the blocks offer enhanced editing and format controls.
+
+The Editor offers rich new value to users with visual, drag-and-drop creation tools and powerful developer enhancements with modern vendor packages, reusable components, rich APIs and hooks to modify and extend the editor through Custom Blocks, Custom Block Styles and Plugins.
diff --git a/docs/extensibility.md b/docs/extensibility.md
deleted file mode 100644
index ab6f8c8db6361b..00000000000000
--- a/docs/extensibility.md
+++ /dev/null
@@ -1,82 +0,0 @@
-# Extensibility
-
-Extensibility is key for WordPress and, like the rest of WordPress components, Gutenberg is highly extensible.
-
-
-## Creating Blocks
-
-Gutenberg is about blocks, and the main extensibility API of Gutenberg is the Block API. It allows you to create your own static blocks, dynamic blocks rendered on the server and also blocks capable of saving data to Post Meta for more structured content.
-
-Here is a small example of a static custom block type (you can try it in your browser's console):
-
-{% codetabs %}
-{% ES5 %}
-```js
-var el = wp.element.createElement;
-
-wp.blocks.registerBlockType( 'mytheme/red-block', {
- title: 'Red Block',
- icon: 'universal-access-alt',
- category: 'layout',
- edit: function() {
- return el( 'div', { style: { backgroundColor: '#900', color: '#fff', padding: '20px' } }, 'I am a red block.' );
- },
- save: function() {
- return el( 'div', { style: { backgroundColor: '#900', color: '#fff', padding: '20px' } }, 'I am a red block.' );
- }
-} );
-```
-{% ESNext %}
-```js
-const { registerBlockType } = wp.blocks;
-const blockStyle = { backgroundColor: '#900', color: '#fff', padding: '20px' };
-
-registerBlockType( 'mytheme/red-block', {
- title: 'Red Block',
- icon: 'universal-access-alt',
- category: 'layout',
- edit: function() {
- return I am a red block
- },
- save: function() {
- return I am a red block
- }
-} );
-```
-{% end %}
-
-If you want to learn more about block creation, the [Blocks Tutorial](../docs/blocks.md) is the best place to start.
-
-## Extending Blocks
-
-It is also possible to modify the behavior of existing blocks or even remove them completely using filters.
-
-Learn more in the [Extending Blocks](../docs/extensibility/extending-blocks.md) section.
-
-## Extending the Editor UI
-
-Extending the editor UI can be accomplished with the `registerPlugin` API, allowing you to define all your plugin's UI elements in one place.
-
-Refer to the [Plugins](https://github.com/WordPress/gutenberg/blob/master/packages/plugins/README.md) and [Edit Post](https://github.com/WordPress/gutenberg/blob/master/packages/edit-post/README.md) section for more information.
-
-## Meta Boxes
-
-**Porting PHP meta boxes to blocks is highly encouraged!**
-
-Discover how [Meta Box](../docs/extensibility/meta-box.md) support works in Gutenberg.
-
-## Theme Support
-
-By default, blocks provide their styles to enable basic support for blocks in themes without any change. Themes can add/override these styles, or rely on defaults.
-
-There are some advanced block features which require opt-in support in the theme. See [theme support](../docs/extensibility/theme-support.md).
-
-## Autocomplete
-
-Autocompleters within blocks may be extended and overridden. See [autocomplete](../docs/extensibility/autocomplete.md).
-
-## Block Parsing and Serialization
-
-Posts in the editor move through a couple of different stages between being stored in `post_content` and appearing in the editor. Since the blocks themselves are data structures that live in memory it takes a parsing and serialization step to transform out from and into the stored format in the database.
-
-Customizing the parser is an advanced topic that you can learn more about in the [Extending the Parser](../docs/extensibility/parser.md) section.
diff --git a/docs/extensibility/extending-editor.md b/docs/extensibility/extending-editor.md
deleted file mode 100644
index ddb874682ab168..00000000000000
--- a/docs/extensibility/extending-editor.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Extending Editor (Experimental)
-
-[Hooks](https://developer.wordpress.org/plugins/hooks/) are a way for one piece of code to interact/modify another piece of code. They make up the foundation for how plugins and themes interact with Gutenberg, but they’re also used extensively by WordPress Core itself. There are two types of hooks: [Actions](https://developer.wordpress.org/plugins/hooks/actions/) and [Filters](https://developer.wordpress.org/plugins/hooks/filters/). They were initially implemented in PHP, but for the purpose of Gutenberg they were ported to JavaScript and published to npm as [@wordpress/hooks](https://www.npmjs.com/package/@wordpress/hooks) package for general purpose use. You can also learn more about both APIs: [PHP](https://codex.wordpress.org/Plugin_API/) and [JavaScript](https://github.com/WordPress/packages/tree/master/packages/hooks).
-
-## Modifying Editor
-
-To modify the behavior of the editor experience, Gutenberg exposes the following Filters:
-
-### `editor.PostFeaturedImage.imageSize`
-
-Used to modify the image size displayed in the Post Featured Image component. It defaults to `'post-thumbnail'`, and will fail back to the `full` image size when the specified image size doesn't exist in the media object. It's modeled after the `admin_post_thumbnail_size` filter in the Classic Editor.
-
-_Example:_
-
-```js
-var withImageSize = function( size, mediaId, postId ) {
- return 'large';
-};
-
-wp.hooks.addFilter( 'editor.PostFeaturedImage.imageSize', 'my-plugin/with-image-size', withImageSize );
-```
diff --git a/docs/manifest.json b/docs/manifest.json
index 21c5a5c12d6592..4dc762893f571b 100644
--- a/docs/manifest.json
+++ b/docs/manifest.json
@@ -1,261 +1,381 @@
[
{
- "title": "Introduction",
+ "title": "Gutenberg Handbook",
"slug": "handbook",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/readme.md",
"parent": null
},
{
- "title": "The Language of Gutenberg",
- "slug": "language",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/language.md",
+ "title": "Designer & Developer Handbook",
+ "slug": "designers-developers",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/readme.md",
"parent": null
},
{
- "title": "The Gutenberg block grammar",
- "slug": "grammar",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/grammar.md",
- "parent": "language"
+ "title": "Key Concepts",
+ "slug": "key-concepts",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/key-concepts.md",
+ "parent": "designers-developers"
},
{
- "title": "Block API",
+ "title": "Developer Documentation",
+ "slug": "developers",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/README.md",
+ "parent": "designers-developers"
+ },
+ {
+ "title": "Block API Reference",
"slug": "block-api",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/block-api.md",
- "parent": null
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/block-api/README.md",
+ "parent": "developers"
},
{
- "title": "Attributes",
- "slug": "attributes",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/block-api/attributes.md",
+ "title": "Block Registration ",
+ "slug": "block-registration",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/block-api/block-registration.md",
"parent": "block-api"
},
{
"title": "Edit and Save",
"slug": "block-edit-save",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/block-api/block-edit-save.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/block-api/block-edit-save.md",
"parent": "block-api"
},
{
- "title": "RichText API",
- "slug": "rich-text-api",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/editor/src/components/rich-text/README.md",
+ "title": "Attributes",
+ "slug": "block-attributes",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/block-api/block-attributes.md",
"parent": "block-api"
},
{
"title": "Deprecated Blocks",
- "slug": "deprecated-blocks",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/block-api/deprecated-blocks.md",
+ "slug": "block-deprecation",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/block-api/block-deprecation.md",
"parent": "block-api"
},
{
"title": "Templates",
- "slug": "templates",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/templates.md",
- "parent": null
+ "slug": "block-templates",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/block-api/block-templates.md",
+ "parent": "block-api"
},
{
- "title": "Extensibility",
- "slug": "extensibility",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/extensibility.md",
- "parent": null
+ "title": "Annotations",
+ "slug": "block-annotations",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/block-api/block-annotations.md",
+ "parent": "block-api"
},
{
- "title": "Extending Blocks",
- "slug": "extending-blocks",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/extensibility/extending-blocks.md",
- "parent": "extensibility"
+ "title": "Filter Reference",
+ "slug": "filters",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/filters/README.md",
+ "parent": "developers"
},
{
- "title": "Extending Editor",
- "slug": "extending-editor",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/extensibility/extending-editor.md",
- "parent": "extensibility"
+ "title": "Block Filters",
+ "slug": "block-filters",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/filters/block-filters.md",
+ "parent": "filters"
},
{
- "title": "Meta Boxes",
- "slug": "meta-box",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/extensibility/meta-box.md",
- "parent": "extensibility"
+ "title": "Editor Filters (Experimental)",
+ "slug": "editor-filters",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/filters/editor-filters.md",
+ "parent": "filters"
},
{
- "title": "Theme Support",
- "slug": "theme-support",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/extensibility/theme-support.md",
- "parent": "extensibility"
+ "title": "Parser Filters",
+ "slug": "parser-filters",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/filters/parser-filters.md",
+ "parent": "filters"
},
{
"title": "Autocomplete",
- "slug": "autocomplete",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/extensibility/autocomplete.md",
- "parent": "extensibility"
+ "slug": "autocomplete-filters",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/filters/autocomplete-filters.md",
+ "parent": "filters"
},
{
- "title": "Annotations",
- "slug": "annotations",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/extensibility/annotations.md",
- "parent": "extensibility"
+ "title": "Internationalization",
+ "slug": "internationalization",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/internationalization.md",
+ "parent": "developers"
},
{
- "title": "Design",
- "slug": "design",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/design.md",
- "parent": null
+ "title": "Data Module Reference",
+ "slug": "data",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/README.md",
+ "parent": "developers"
},
{
- "title": "Patterns",
- "slug": "design-patterns",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/design/design-patterns.md",
- "parent": "design"
+ "title": "Packages",
+ "slug": "packages",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/packages.md",
+ "parent": "developers"
},
{
- "title": "Block Design",
- "slug": "block-design",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/design/block-design.md",
- "parent": "design"
+ "title": "Components",
+ "slug": "components",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/components/README.md",
+ "parent": "developers"
},
{
- "title": "Resources",
- "slug": "design-resources",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/design/design-resources.md",
- "parent": "design"
+ "title": "Theming for Gutenberg",
+ "slug": "themes",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/themes/README.md",
+ "parent": "developers"
},
{
- "title": "Creating Block Types",
- "slug": "blocks",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/blocks.md",
- "parent": null
+ "title": "Theme Support",
+ "slug": "theme-support",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/themes/theme-support.md",
+ "parent": "themes"
+ },
+ {
+ "title": "Backward Compatibility",
+ "slug": "backward-compatibility",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/backward-compatibility/README.md",
+ "parent": "developers"
+ },
+ {
+ "title": "Deprecations",
+ "slug": "deprecations",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/backward-compatibility/deprecations.md",
+ "parent": "backward-compatibility"
+ },
+ {
+ "title": "Meta Boxes",
+ "slug": "meta-box",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/backward-compatibility/meta-box.md",
+ "parent": "backward-compatibility"
+ },
+ {
+ "title": "Tutorials",
+ "slug": "tutorials",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/readme.md",
+ "parent": "developers"
+ },
+ {
+ "title": "Blocks",
+ "slug": "block-tutorial",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/block-tutorial/readme.md",
+ "parent": "tutorials"
},
{
"title": "Writing Your First Block Type",
"slug": "writing-your-first-block-type",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/blocks/writing-your-first-block-type.md",
- "parent": "blocks"
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md",
+ "parent": "block-tutorial"
},
{
- "title": "Applying Styles With Stylesheets",
+ "title": "Applying Styles From a Stylesheet",
"slug": "applying-styles-with-stylesheets",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/blocks/applying-styles-with-stylesheets.md",
- "parent": "blocks"
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/block-tutorial/applying-styles-with-stylesheets.md",
+ "parent": "block-tutorial"
},
{
"title": "Introducing Attributes and Editable Fields",
"slug": "introducing-attributes-and-editable-fields",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/blocks/introducing-attributes-and-editable-fields.md",
- "parent": "blocks"
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/block-tutorial/introducing-attributes-and-editable-fields.md",
+ "parent": "block-tutorial"
},
{
"title": "Block Controls: Toolbars and Inspector",
"slug": "block-controls-toolbars-and-inspector",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/blocks/block-controls-toolbars-and-inspector.md",
- "parent": "blocks"
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/block-tutorial/block-controls-toolbars-and-inspector.md",
+ "parent": "block-tutorial"
},
{
"title": "Creating dynamic blocks",
"slug": "creating-dynamic-blocks",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/blocks/creating-dynamic-blocks.md",
- "parent": "blocks"
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md",
+ "parent": "block-tutorial"
},
{
"title": "Generate Blocks with WP-CLI",
"slug": "generate-blocks-with-wp-cli",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/blocks/generate-blocks-with-wp-cli.md",
- "parent": "blocks"
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/block-tutorial/generate-blocks-with-wp-cli.md",
+ "parent": "block-tutorial"
},
{
- "title": "Reference",
- "slug": "reference",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference.md",
- "parent": null
+ "title": "Getting Started with JavaScript",
+ "slug": "javascript",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/javascript/readme.md",
+ "parent": "tutorials"
},
{
- "title": "Glossary",
- "slug": "glossary",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/glossary.md",
- "parent": "reference"
+ "title": "Plugins Background",
+ "slug": "plugins-background",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/javascript/plugins-background.md",
+ "parent": "javascript"
},
{
- "title": "History",
- "slug": "history",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/history.md",
- "parent": "reference"
+ "title": "Loading JavaScript",
+ "slug": "loading-javascript",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/javascript/loading-javascript.md",
+ "parent": "javascript"
},
{
- "title": "Coding Guidelines",
- "slug": "coding-guidelines",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/coding-guidelines.md",
- "parent": "reference"
+ "title": "Extending the Block Editor",
+ "slug": "extending-the-block-editor",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md",
+ "parent": "javascript"
},
{
- "title": "Testing Overview",
- "slug": "testing-overview",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/testing-overview.md",
- "parent": "reference"
+ "title": "Troubleshooting",
+ "slug": "troubleshooting",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/javascript/troubleshooting.md",
+ "parent": "javascript"
+ },
+ {
+ "title": "JavaScript versions and build step",
+ "slug": "versions-and-building",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/javascript/versions-and-building.md",
+ "parent": "javascript"
+ },
+ {
+ "title": "Designer Documentation",
+ "slug": "designers",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/designers/README.md",
+ "parent": "designers-developers"
+ },
+ {
+ "title": "Block Design",
+ "slug": "block-design",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/designers/block-design.md",
+ "parent": "designers"
+ },
+ {
+ "title": "Patterns",
+ "slug": "design-patterns",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/designers/design-patterns.md",
+ "parent": "designers"
+ },
+ {
+ "title": "Resources",
+ "slug": "design-resources",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/designers/design-resources.md",
+ "parent": "designers"
+ },
+ {
+ "title": "Glossary",
+ "slug": "glossary",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/glossary.md",
+ "parent": "designers-developers"
},
{
"title": "Frequently Asked Questions",
"slug": "faq",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/faq.md",
- "parent": "reference"
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/faq.md",
+ "parent": "designers-developers"
},
{
- "title": "Release Process",
- "slug": "release",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/release.md",
- "parent": "reference"
+ "title": "Contributors Guide",
+ "slug": "contributors",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/readme.md",
+ "parent": null
},
{
- "title": "Scripts",
- "slug": "scripts",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/scripts.md",
- "parent": "reference"
+ "title": "Coding Guidelines",
+ "slug": "coding-guidelines",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/coding-guidelines.md",
+ "parent": "contributors"
},
{
- "title": "Deprecated Features",
- "slug": "deprecated",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/deprecated.md",
- "parent": "reference"
+ "title": "Gutencopy Guidelines",
+ "slug": "copy-guide",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/copy-guide.md",
+ "parent": "contributors"
},
{
- "title": "Repository Management",
- "slug": "repository-management",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/reference/repository-management.md",
- "parent": "reference"
+ "title": "Gutenberg Design Principles & Vision",
+ "slug": "design",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/design.md",
+ "parent": "contributors"
+ },
+ {
+ "title": "The Gutenberg block grammar",
+ "slug": "grammar",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/grammar.md",
+ "parent": "contributors"
+ },
+ {
+ "title": "History",
+ "slug": "history",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/history.md",
+ "parent": "contributors"
},
{
"title": "Outreach",
"slug": "outreach",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/outreach.md",
- "parent": null
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/outreach.md",
+ "parent": "contributors"
},
{
"title": "Articles",
"slug": "articles",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/outreach/docs/articles.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/outreach/articles.md",
"parent": "outreach"
},
{
"title": "Meetups",
"slug": "meetups",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/outreach/meetups.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/outreach/meetups.md",
+ "parent": "outreach"
+ },
+ {
+ "title": "Resources",
+ "slug": "resources",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/outreach/resources.md",
"parent": "outreach"
},
{
"title": "Talks",
"slug": "talks",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/outreach/talks.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/outreach/talks.md",
"parent": "outreach"
},
{
- "title": "Resources",
- "slug": "resources",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/outreach/resources.md",
- "parent": "outreach"
+ "title": "Principles",
+ "slug": "principles",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/principles.md",
+ "parent": "contributors"
},
{
- "title": "Packages",
- "slug": "packages",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/packages.md",
- "parent": null
+ "title": "Blocks are the Interface",
+ "slug": "the-block",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/principles/the-block.md",
+ "parent": "principles"
+ },
+ {
+ "title": "Reference",
+ "slug": "reference",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/reference.md",
+ "parent": "contributors"
+ },
+ {
+ "title": "Gutenberg Release Process",
+ "slug": "release",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/release.md",
+ "parent": "contributors"
+ },
+ {
+ "title": "Repository Management",
+ "slug": "repository-management",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/repository-management.md",
+ "parent": "contributors"
+ },
+ {
+ "title": "Scripts",
+ "slug": "scripts",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/scripts.md",
+ "parent": "contributors"
+ },
+ {
+ "title": "Testing Overview",
+ "slug": "testing-overview",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/testing-overview.md",
+ "parent": "contributors"
},
{
"title": "@wordpress/a11y",
@@ -413,6 +533,12 @@
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/escape-html/README.md",
"parent": "packages"
},
+ {
+ "title": "@wordpress/eslint-plugin",
+ "slug": "packages-eslint-plugin",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/eslint-plugin/README.md",
+ "parent": "packages"
+ },
{
"title": "@wordpress/format-library",
"slug": "packages-format-library",
@@ -551,12 +677,6 @@
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/wordcount/README.md",
"parent": "packages"
},
- {
- "title": "Components Package Reference",
- "slug": "components",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/components.md",
- "parent": null
- },
{
"title": "Autocomplete",
"slug": "autocomplete",
@@ -935,58 +1055,52 @@
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/packages/components/src/tree-select/README.md",
"parent": "components"
},
- {
- "title": "Data Package Reference",
- "slug": "data",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/README.md",
- "parent": null
- },
{
"title": "WordPress Core Data",
"slug": "data-core",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/data-core.md",
"parent": "data"
},
{
"title": "Annotations",
"slug": "data-core-annotations",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-annotations.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/data-core-annotations.md",
"parent": "data"
},
{
"title": "Block Types Data",
"slug": "data-core-blocks",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-blocks.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/data-core-blocks.md",
"parent": "data"
},
{
"title": "The Editor’s Data",
"slug": "data-core-editor",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-editor.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/data-core-editor.md",
"parent": "data"
},
{
"title": "The Editor’s UI Data",
"slug": "data-core-edit-post",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-edit-post.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/data-core-edit-post.md",
"parent": "data"
},
{
"title": "Notices Data",
"slug": "data-core-notices",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-notices.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/data-core-notices.md",
"parent": "data"
},
{
"title": "The NUX (New User Experience) Data",
"slug": "data-core-nux",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-nux.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/data-core-nux.md",
"parent": "data"
},
{
"title": "The Viewport Data",
"slug": "data-core-viewport",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/data/data-core-viewport.md",
+ "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/data/data-core-viewport.md",
"parent": "data"
}
]
\ No newline at end of file
diff --git a/docs/packages.md b/docs/packages.md
deleted file mode 100644
index ac767e389d18c9..00000000000000
--- a/docs/packages.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# packages
-
-Gutenberg exposes a list of JavaScript packages and tools for WordPress development.
-
-## Using the packages
-
-JavaScript packages are available as a registered script in WordPress and can be accessed using the `wp` global variable.
-
-All the packages are also available on [npm](https://www.npmjs.com/org/wordpress) if you want to bundle them in your code.
-
-
\ No newline at end of file
diff --git a/docs/readme.md b/docs/readme.md
index 4d1c74172ec236..5164003a654a87 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -1,11 +1,20 @@
-# Introduction
+# Gutenberg Handbook
-Gutenberg began as a transformation of the WordPress editor — a new interface for adding, editing, and manipulating content. It seeks to make it easy for anyone to create rich, flexible content layouts with a block-based UI. All types of page components are represented as modular blocks, which means they can be accessed from a unified block menu, dropped anywhere on a page, and directly edited to create the custom presentation the user wants.
+The Gutenberg project provides three sources of documentation:
-It is a fundamental modernization and transformation of how the WordPress experience works, creating new opportunities for both users and developers. Gutenberg introduces new frameworks, interaction patterns, functionality, and user experiences for WordPress. And similar to a new macOS version, we will talk about “Gutenberg”, and all the new possibilities it enables, until eventually the idea of Gutenberg as a separate entity will fade and it will simply be WordPress.
+## Designer & Developer Handbook
-
+Learn how to build blocks and extend the editor, best practices for designing block interfaces, and how to create themes that make the most of the new features Gutenberg provides.
-Gutenberg brings many changes to WordPress, but the biggest impact comes from the way it can enable a much clearer product architecture — one which enables modularity, consistency, and interoperability — and the positive impact that can have on the end user experience of WordPress. This handbook will describe the scope of those architectural and user experience (UX) changes, including the central “block as the interface” principle — the most crucial conceptual change to understand about Gutenberg.
+[Visit the Designer & Developer Handbook](../docs/designers-developers/readme.md)
-Here you can also find design guidelines, API documentation, and tutorials about getting started with Gutenberg development.
+## User Handbook
+
+Discover the new features Gutenberg offers, learn how your site will be affected by the new editor and how to keep using the old interface, and tips for creating beautiful posts and pages.
+
+
+## Contributor Handbook
+
+Help make Gutenberg better by contributing ideas, code, testing, and more.
+
+[Visit the Contributor Handbook](../docs/contributors/readme.md)
diff --git a/docs/reference/glossary.md b/docs/reference/glossary.md
deleted file mode 100644
index f7818d9a785c23..00000000000000
--- a/docs/reference/glossary.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Glossary
-
-- __Attribute sources__: An object describing the attributes shape of a block. The keys can be named as most appropriate to describe the state of a block type. The value for each key is a function which describes the strategy by which the attribute value should be extracted from the content of a saved post's content. When processed, a new object is created, taking the form of the keys defined in the attribute sources, where each value is the result of the attribute source function.
-- __Attributes__: The object representation of the current state of a block in post content. When loading a saved post, this is determined by the attribute sources for the block type. These values can change over time during an editing session when the user modifies a block, and are used when determining how to serialize the block.
-- __Block__: The abstract term used to describe units of markup that, composed together, form the content or layout of a webpage. The idea combines concepts of what in WordPress today we achieve with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience.
-- __Block name__: A unique identifier for a block type, consisting of a plugin-specific namespace and a short label describing the block's intent. e.g. `core/image`
-- __Block type__: In contrast with the blocks composing a particular post, a block type describes the blueprint by which any block of that type should behave. So while there may be many images within a post, each behaves consistent with a unified image block type definition.
-- __Dynamic block__: A type of block where the content of which may change and cannot be determined at the time of saving a post, instead calculated any time the post is shown on the front of a site. These blocks may save fallback content or no content at all in their JavaScript implementation, instead deferring to a PHP block implementation for runtime rendering.
-- __RichText__: A common component enabling rich content editing including bold, italics, hyperlinks, etc. It is not too much unlike the single editor region of the legacy post editor, and is in fact powered by the same TinyMCE library.
-- __Inspector__: A block settings region shown in place of the post settings when a block is selected. Fields may be shown here to allow the user to customize the selected block.
-- __Post settings__: A sidebar region containing metadata fields for the post, including scheduling, visibility, terms, and featured image.
-- __Serialization__: The process of converting a block's attributes object into HTML markup, typically occurring when saving the post.
-- __Static block__: A type of block where the content of which is known at the time of saving a post. A static block will be saved with HTML markup directly in post content.
-- __TinyMCE__: [TinyMCE](https://www.tinymce.com/) is a web-based JavaScript WYSIWYG (What You See Is What You Get) editor.
-- __Toolbar__: A set of button controls. In the context of a block, usually referring to the toolbar of block controls shown above the selected block.
diff --git a/docs/reference/history.md b/docs/reference/history.md
deleted file mode 100644
index a1d755e2994db8..00000000000000
--- a/docs/reference/history.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# History
-
-## Survey
-There was a survey done: https://make.wordpress.org/core/2017/04/07/editor-experience-survey-results/
-
-## Inspiration
-This includes a list of historical articles and influences on Gutenberg.
-
-- LivingDocs: https://beta.livingdocs.io/articles
-- Parrot: https://intenseminimalism.com/2017/parrot-an-integrated-site-builder-and-editor-concept-for-wordpress/
-- Apple Keynote
-- Slack
-- Google Sites v2
-
-## Blog posts by the team
-
-- Gutenberg tag on make/core: updates and much more: https://make.wordpress.org/core/tag/gutenberg/
-- Suggested revised timeline: https://make.wordpress.org/core/2017/08/11/revised-suggested-roadmap-for-gutenberg-and-customization/
-- Discovering Gutenberg: https://make.wordpress.org/core/2017/08/08/discovering-gutenberg-and-next-steps/
diff --git a/docs/root-manifest.json b/docs/root-manifest.json
deleted file mode 100644
index 1202ab14eacb4a..00000000000000
--- a/docs/root-manifest.json
+++ /dev/null
@@ -1,254 +0,0 @@
-[
- {
- "title": "Introduction",
- "slug": "handbook",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/readme.md",
- "parent": null
- },
- {
- "title": "The Language of Gutenberg",
- "slug": "language",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/language.md",
- "parent": null
- },
- {
- "title": "The Gutenberg block grammar",
- "slug": "grammar",
- "markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/grammar.md",
- "parent": "language"
- },
- {
- "title": "Block API",
- "slug": "block-api",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/block-api.md",
- "parent": null
- },
- {
- "title": "Attributes",
- "slug": "attributes",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/block-api\/attributes.md",
- "parent": "block-api"
- },
- {
- "title": "Edit and Save",
- "slug": "block-edit-save",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/block-api\/block-edit-save.md",
- "parent": "block-api"
- },
- {
- "title": "RichText API",
- "slug": "rich-text-api",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/packages\/editor\/src\/components\/rich-text\/README.md",
- "parent": "block-api"
- },
- {
- "title": "Deprecated Blocks",
- "slug": "deprecated-blocks",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/block-api\/deprecated-blocks.md",
- "parent": "block-api"
- },
- {
- "title": "Templates",
- "slug": "templates",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/templates.md",
- "parent": null
- },
- {
- "title": "Extensibility",
- "slug": "extensibility",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/extensibility.md",
- "parent": null
- },
- {
- "title": "Extending Blocks",
- "slug": "extending-blocks",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/extensibility/extending-blocks.md",
- "parent": "extensibility"
- },
- {
- "title": "Extending Editor",
- "slug": "extending-editor",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/extensibility/extending-editor.md",
- "parent": "extensibility"
- },
- {
- "title": "Meta Boxes",
- "slug": "meta-box",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/extensibility/meta-box.md",
- "parent": "extensibility"
- },
- {
- "title": "Theme Support",
- "slug": "theme-support",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/extensibility/theme-support.md",
- "parent": "extensibility"
- },
- {
- "title": "Autocomplete",
- "slug": "autocomplete",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/extensibility/autocomplete.md",
- "parent": "extensibility"
- },
- {
- "title": "Annotations",
- "slug": "annotations",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/extensibility/annotations.md",
- "parent": "extensibility"
- },
- {
- "title": "Design",
- "slug": "design",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/design.md",
- "parent": null
- },
- {
- "title": "Patterns",
- "slug": "design-patterns",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/design\/design-patterns.md",
- "parent": "design"
- },
- {
- "title": "Block Design",
- "slug": "block-design",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/design\/block-design.md",
- "parent": "design"
- },
- {
- "title": "Resources",
- "slug": "design-resources",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/design\/design-resources.md",
- "parent": "design"
- },
- {
- "title": "Creating Block Types",
- "slug": "blocks",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/blocks.md",
- "parent": null
- },
- {
- "title": "Writing Your First Block Type",
- "slug": "writing-your-first-block-type",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/blocks\/writing-your-first-block-type.md",
- "parent": "blocks"
- },
- {
- "title": "Applying Styles With Stylesheets",
- "slug": "applying-styles-with-stylesheets",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/blocks\/applying-styles-with-stylesheets.md",
- "parent": "blocks"
- },
- {
- "title": "Introducing Attributes and Editable Fields",
- "slug": "introducing-attributes-and-editable-fields",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/blocks\/introducing-attributes-and-editable-fields.md",
- "parent": "blocks"
- },
- {
- "title": "Block Controls: Toolbars and Inspector",
- "slug": "block-controls-toolbars-and-inspector",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/blocks\/block-controls-toolbars-and-inspector.md",
- "parent": "blocks"
- },
- {
- "title": "Creating dynamic blocks",
- "slug": "creating-dynamic-blocks",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/blocks\/creating-dynamic-blocks.md",
- "parent": "blocks"
- },
- {
- "title": "Generate Blocks with WP-CLI",
- "slug": "generate-blocks-with-wp-cli",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/blocks\/generate-blocks-with-wp-cli.md",
- "parent": "blocks"
- },
- {
- "title": "Reference",
- "slug": "reference",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference.md",
- "parent": null
- },
- {
- "title": "Glossary",
- "slug": "glossary",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/glossary.md",
- "parent": "reference"
- },
- {
- "title": "History",
- "slug": "history",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/history.md",
- "parent": "reference"
- },
- {
- "title": "Coding Guidelines",
- "slug": "coding-guidelines",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/coding-guidelines.md",
- "parent": "reference"
- },
- {
- "title": "Testing Overview",
- "slug": "testing-overview",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/testing-overview.md",
- "parent": "reference"
- },
- {
- "title": "Frequently Asked Questions",
- "slug": "faq",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/faq.md",
- "parent": "reference"
- },
- {
- "title": "Release Process",
- "slug": "release",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/release.md",
- "parent": "reference"
- },
- {
- "title": "Scripts",
- "slug": "scripts",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/scripts.md",
- "parent": "reference"
- },
- {
- "title": "Deprecated Features",
- "slug": "deprecated",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/deprecated.md",
- "parent": "reference"
- },
- {
- "title": "Repository Management",
- "slug": "repository-management",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/reference\/repository-management.md",
- "parent": "reference"
- },
- {
- "title": "Outreach",
- "slug": "outreach",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/outreach.md",
- "parent": null
- },
- {
- "title": "Articles",
- "slug": "articles",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/outreach\/docs\/articles.md",
- "parent": "outreach"
- },
- {
- "title": "Meetups",
- "slug": "meetups",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/outreach\/meetups.md",
- "parent": "outreach"
- },
- {
- "title": "Talks",
- "slug": "talks",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/outreach\/talks.md",
- "parent": "outreach"
- },
- {
- "title": "Resources",
- "slug": "resources",
- "markdown_source": "https:\/\/raw.githubusercontent.com\/WordPress\/gutenberg\/master\/docs\/outreach\/resources.md",
- "parent": "outreach"
- }
-]
diff --git a/docs/toc.json b/docs/toc.json
new file mode 100644
index 00000000000000..c106d9a499ca69
--- /dev/null
+++ b/docs/toc.json
@@ -0,0 +1,78 @@
+[
+ {"docs/readme.md": []},
+ {"docs/designers-developers/readme.md": [
+ {"docs/designers-developers/key-concepts.md": []},
+ {"docs/designers-developers/developers/README.md": [
+ {"docs/designers-developers/developers/block-api/README.md": [
+ {"docs/designers-developers/developers/block-api/block-registration.md": []},
+ {"docs/designers-developers/developers/block-api/block-edit-save.md": []},
+ {"docs/designers-developers/developers/block-api/block-attributes.md": []},
+ {"docs/designers-developers/developers/block-api/block-deprecation.md": []},
+ {"docs/designers-developers/developers/block-api/block-templates.md": []},
+ {"docs/designers-developers/developers/block-api/block-annotations.md": []}
+ ]},
+ {"docs/designers-developers/developers/filters/README.md": [
+ {"docs/designers-developers/developers/filters/block-filters.md": []},
+ {"docs/designers-developers/developers/filters/editor-filters.md": []},
+ {"docs/designers-developers/developers/filters/parser-filters.md": []},
+ {"docs/designers-developers/developers/filters/autocomplete-filters.md": []}
+ ]},
+ {"docs/designers-developers/developers/internationalization.md": []},
+ {"docs/designers-developers/developers/data/README.md": "{{data}}"},
+ {"docs/designers-developers/developers/packages.md": "{{packages}}"},
+ {"packages/components/README.md": "{{components}}"},
+ {"docs/designers-developers/developers/themes/README.md": [
+ {"docs/designers-developers/developers/themes/theme-support.md": []}
+ ]},
+ {"docs/designers-developers/developers/backward-compatibility/README.md": [
+ {"docs/designers-developers/developers/backward-compatibility/deprecations.md": []},
+ {"docs/designers-developers/developers/backward-compatibility/meta-box.md": []}
+ ]},
+ {"docs/designers-developers/developers/tutorials/readme.md": [
+ {"docs/designers-developers/developers/tutorials/block-tutorial/readme.md" :[
+ {"docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md" :[]},
+ {"docs/designers-developers/developers/tutorials/block-tutorial/applying-styles-with-stylesheets.md" :[]},
+ {"docs/designers-developers/developers/tutorials/block-tutorial/introducing-attributes-and-editable-fields.md" :[]},
+ {"docs/designers-developers/developers/tutorials/block-tutorial/block-controls-toolbars-and-inspector.md" :[]},
+ {"docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md" :[]},
+ {"docs/designers-developers/developers/tutorials/block-tutorial/generate-blocks-with-wp-cli.md" :[]}
+ ]},
+ { "docs/designers-developers/developers/tutorials/javascript/readme.md": [
+ {"docs/designers-developers/developers/tutorials/javascript/plugins-background.md": []},
+ { "docs/designers-developers/developers/tutorials/javascript/loading-javascript.md": []},
+ { "docs/designers-developers/developers/tutorials/javascript/extending-the-block-editor.md": []},
+ { "docs/designers-developers/developers/tutorials/javascript/troubleshooting.md": []},
+ { "docs/designers-developers/developers/tutorials/javascript/versions-and-building.md": []}
+ ]}
+ ]}
+ ]},
+ {"docs/designers-developers/designers/README.md": [
+ {"docs/designers-developers/designers/block-design.md": []},
+ {"docs/designers-developers/designers/design-patterns.md": []},
+ {"docs/designers-developers/designers/design-resources.md": []}
+ ]},
+ {"docs/designers-developers/glossary.md": []},
+ {"docs/designers-developers/faq.md": []}
+ ]},
+ {"docs/contributors/readme.md": [
+ {"docs/contributors/coding-guidelines.md": []},
+ {"docs/contributors/copy-guide.md": []},
+ {"docs/contributors/design.md": []},
+ {"docs/contributors/grammar.md": []},
+ {"docs/contributors/history.md": []},
+ {"docs/contributors/outreach.md": [
+ {"docs/contributors/outreach/articles.md": []},
+ {"docs/contributors/outreach/meetups.md": []},
+ {"docs/contributors/outreach/resources.md": []},
+ {"docs/contributors/outreach/talks.md": []}
+ ]},
+ {"docs/contributors/principles.md": [
+ {"docs/contributors/principles/the-block.md": []}
+ ]},
+ {"docs/contributors/reference.md": []},
+ {"docs/contributors/release.md": []},
+ {"docs/contributors/repository-management.md": []},
+ {"docs/contributors/scripts.md": []},
+ {"docs/contributors/testing-overview.md": []}
+ ]}
+]
diff --git a/docs/tool/config.js b/docs/tool/config.js
index 6758ac592a72f7..87900c4c624fa7 100644
--- a/docs/tool/config.js
+++ b/docs/tool/config.js
@@ -51,11 +51,11 @@ module.exports = {
actions: [ path.resolve( root, 'packages/viewport/src/store/actions.js' ) ],
},
},
- dataDocsOutput: path.resolve( __dirname, '../data' ),
+ dataDocsOutput: path.resolve( __dirname, '../designers-developers/developers/data' ),
packageFileNames: glob( 'packages/*/package.json' )
.map( ( fileName ) => fileName.split( '/' )[ 1 ] ),
- rootManifest: path.resolve( __dirname, '../root-manifest.json' ),
+ tocFileName: path.resolve( __dirname, '../toc.json' ),
manifestOutput: path.resolve( __dirname, '../manifest.json' ),
};
diff --git a/docs/tool/generator.js b/docs/tool/generator.js
index 401ea43f33fa0f..1f7a0744dbf3e3 100644
--- a/docs/tool/generator.js
+++ b/docs/tool/generator.js
@@ -17,7 +17,7 @@ function generateTableOfContent( parsedNamespaces ) {
'# Data Module Reference',
'',
Object.values( parsedNamespaces ).map( ( parsedNamespace ) => {
- return ` - [**${ parsedNamespace.name }**: ${ parsedNamespace.title }](../../docs/data/data-${ kebabCase( parsedNamespace.name ) }.md)`;
+ return ` - [**${ parsedNamespace.name }**: ${ parsedNamespace.title }](../../docs/designers-developers/developers/data/data-${ kebabCase( parsedNamespace.name ) }.md)`;
} ).join( '\n' ),
].join( '\n' );
}
diff --git a/docs/tool/index.js b/docs/tool/index.js
index 5b901a0fb8efe6..c0bb2c1101c7e8 100644
--- a/docs/tool/index.js
+++ b/docs/tool/index.js
@@ -9,12 +9,12 @@ const fs = require( 'fs' );
const config = require( './config' );
const parser = require( './parser' );
const generator = require( './generator' );
-const { getPackageManifest, getComponentManifest, getDataManifest } = require( './manifest' );
+const { getPackageManifest, getComponentManifest, getDataManifest, getRootManifest } = require( './manifest' );
const parsedModules = parser( config.dataNamespaces );
generator( parsedModules, config.dataDocsOutput );
-const rootManifest = require( config.rootManifest );
+const rootManifest = getRootManifest( config.tocFileName );
const packageManifest = getPackageManifest( config.packageFileNames );
const componentManifest = getComponentManifest( config.componentPaths );
const dataManifest = getDataManifest( parsedModules );
diff --git a/docs/tool/manifest.js b/docs/tool/manifest.js
index 5b5a4bd5ea4021..06732edc108dc9 100644
--- a/docs/tool/manifest.js
+++ b/docs/tool/manifest.js
@@ -3,6 +3,8 @@
*/
const { camelCase, kebabCase, nth, upperFirst } = require( 'lodash' );
+const fs = require( 'fs' );
+
const baseRepoUrl = `https://raw.githubusercontent.com/WordPress/gutenberg/master`;
/**
@@ -13,24 +15,15 @@ const baseRepoUrl = `https://raw.githubusercontent.com/WordPress/gutenberg/maste
* @return {Array} Manifest
*/
function getPackageManifest( packageFolderNames ) {
- return [
- {
- title: 'Packages',
- slug: 'packages',
- markdown_source: `${ baseRepoUrl }/docs/packages.md`,
- parent: null,
- },
- ].concat(
- packageFolderNames.map( ( folderName ) => {
- const path = `${ baseRepoUrl }/packages/${ folderName }/README.md`;
- return {
- title: `@wordpress/${ folderName }`,
- slug: `packages-${ folderName }`,
- markdown_source: path,
- parent: 'packages',
- };
- } )
- );
+ return packageFolderNames.map( ( folderName ) => {
+ const path = `${ baseRepoUrl }/packages/${ folderName }/README.md`;
+ return {
+ title: `@wordpress/${ folderName }`,
+ slug: `packages-${ folderName }`,
+ markdown_source: path,
+ parent: 'packages',
+ };
+ } );
}
/**
@@ -41,24 +34,15 @@ function getPackageManifest( packageFolderNames ) {
* @return {Array} Manifest
*/
function getComponentManifest( componentPaths ) {
- return [
- {
- title: 'Components Package Reference',
- slug: 'components',
- markdown_source: `${ baseRepoUrl }/packages/components.md`,
- parent: null,
- },
- ...componentPaths
- .map( ( filePath ) => {
- const slug = nth( filePath.split( '/' ), -2 );
- return {
- title: upperFirst( camelCase( slug ) ),
- slug,
- markdown_source: `${ baseRepoUrl }/${ filePath }`,
- parent: 'components',
- };
- } ),
- ];
+ return componentPaths.map( ( filePath ) => {
+ const slug = nth( filePath.split( '/' ), -2 );
+ return {
+ title: upperFirst( camelCase( slug ) ),
+ slug,
+ markdown_source: `${ baseRepoUrl }/${ filePath }`,
+ parent: 'components',
+ };
+ } );
}
/**
@@ -69,26 +53,59 @@ function getComponentManifest( componentPaths ) {
* @return {Array} Manifest
*/
function getDataManifest( parsedNamespaces ) {
- return [ {
- title: 'Data Package Reference',
- slug: 'data',
- markdown_source: `${ baseRepoUrl }/docs/data/README.md`,
- parent: null,
- } ].concat(
- Object.values( parsedNamespaces ).map( ( parsedNamespace ) => {
- const slug = `data-${ kebabCase( parsedNamespace.name ) }`;
- return {
- title: parsedNamespace.title,
- slug,
- markdown_source: `${ baseRepoUrl }/docs/data/${ slug }.md`,
- parent: 'data',
- };
- } )
- );
+ return Object.values( parsedNamespaces ).map( ( parsedNamespace ) => {
+ const slug = `data-${ kebabCase( parsedNamespace.name ) }`;
+ return {
+ title: parsedNamespace.title,
+ slug,
+ markdown_source: `${ baseRepoUrl }/docs/designers-developers/developers/data/${ slug }.md`,
+ parent: 'data',
+ };
+ } );
+}
+
+function getRootManifest( tocFileName ) {
+ return generateRootManifestFromTOCItems( require( tocFileName ) );
+}
+
+function generateRootManifestFromTOCItems( items, parent = null ) {
+ let pageItems = [];
+ items.map( ( obj ) => {
+ const fileName = Object.keys( obj )[ 0 ];
+ const children = obj[ fileName ];
+
+ let slug = nth( fileName.split( '/' ), -1 ).replace( '.md', '' );
+ if ( 'readme' === slug.toLowerCase() ) {
+ slug = nth( fileName.split( '/' ), -2 );
+
+ // Special case - the root 'docs' readme needs the 'handbook' slug.
+ if ( parent === null && 'docs' === slug ) {
+ slug = 'handbook';
+ }
+ }
+ let title = upperFirst( camelCase( slug ) );
+ const markdownSource = fs.readFileSync( fileName, 'utf8' );
+ const titleMarkdown = markdownSource.match( /^#\s(.+)$/m );
+ if ( titleMarkdown ) {
+ title = titleMarkdown[ 1 ];
+ }
+
+ pageItems.push( {
+ title: title,
+ slug: slug,
+ markdown_source: `${ baseRepoUrl }\/${ fileName }`,
+ parent: parent,
+ } );
+ if ( Array.isArray( children ) && children.length ) {
+ pageItems = pageItems.concat( generateRootManifestFromTOCItems( children, slug ) );
+ }
+ } );
+ return pageItems;
}
module.exports = {
getPackageManifest,
getComponentManifest,
getDataManifest,
+ getRootManifest,
};
diff --git a/docs/users/readme.md b/docs/users/readme.md
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/gutenberg.php b/gutenberg.php
index 762707d1755746..62215b96d48d18 100644
--- a/gutenberg.php
+++ b/gutenberg.php
@@ -3,7 +3,7 @@
* Plugin Name: Gutenberg
* Plugin URI: https://github.com/WordPress/gutenberg
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
- * Version: 4.4.0
+ * Version: 4.7.0
* Author: Gutenberg Team
*
* @package gutenberg
@@ -41,9 +41,9 @@ function the_gutenberg_project() {
);
} else { // Using Gutenberg in Core.
printf(
- // Translators: link is for Classic Editor plugin.
+ /* translators: %s: https://wordpress.org/plugins/classic-editor/ */
__( 'The Block Editor requires JavaScript. Please try the Classic Editor plugin .', 'gutenberg' ),
- 'https://wordpress.org/plugins/classic-editor/'
+ __( 'https://wordpress.org/plugins/classic-editor/', 'gutenberg' )
);
}
?>
diff --git a/lib/blocks.php b/lib/blocks.php
index a8083466a04053..0b11041d0576de 100644
--- a/lib/blocks.php
+++ b/lib/blocks.php
@@ -174,6 +174,13 @@ function gutenberg_render_block( $block ) {
* @return string Updated post content.
*/
function do_blocks( $content ) {
+ // If there are blocks in this content, we shouldn't run wpautop() on it later.
+ $priority = has_filter( 'the_content', 'wpautop' );
+ if ( false !== $priority && doing_filter( 'the_content' ) && has_blocks( $content ) ) {
+ remove_filter( 'the_content', 'wpautop', $priority );
+ add_filter( 'the_content', '_restore_wpautop_hook', $priority + 1 );
+ }
+
$blocks = gutenberg_parse_blocks( $content );
$output = '';
@@ -187,6 +194,28 @@ function do_blocks( $content ) {
add_filter( 'the_content', 'do_blocks', 7 ); // BEFORE do_shortcode() and oembed.
}
+if ( ! function_exists( '_restore_wpautop_hook' ) ) {
+ /**
+ * If do_blocks() needs to remove wpautop() from the `the_content` filter,
+ * this re-adds it afterwards, for subsequent `the_content` usage.
+ *
+ * @access private
+ *
+ * @since 4.6.0
+ *
+ * @param string $content The post content running through this filter.
+ * @return string The unmodified content.
+ */
+ function _restore_wpautop_hook( $content ) {
+ $current_priority = has_filter( 'the_content', '_restore_wpautop_hook' );
+
+ add_filter( 'the_content', 'wpautop', $current_priority - 1 );
+ remove_filter( 'the_content', '_restore_wpautop_hook', $current_priority );
+
+ return $content;
+ }
+}
+
if ( ! function_exists( 'strip_dynamic_blocks' ) ) {
/**
* Remove all dynamic blocks from the given content.
diff --git a/lib/class-wp-block-type.php b/lib/class-wp-block-type.php
index 0c18bb6efa4682..c186eec88a0a3b 100644
--- a/lib/class-wp-block-type.php
+++ b/lib/class-wp-block-type.php
@@ -120,36 +120,47 @@ public function is_dynamic() {
/**
* Validates attributes against the current block schema, populating
- * defaulted and missing values, and omitting unknown attributes.
+ * defaulted and missing values.
*
* @param array $attributes Original block attributes.
* @return array Prepared block attributes.
*/
public function prepare_attributes_for_render( $attributes ) {
+ // If there are no attribute definitions for the block type, skip
+ // processing and return vebatim.
if ( ! isset( $this->attributes ) ) {
return $attributes;
}
- $prepared_attributes = array();
+ foreach ( $attributes as $attribute_name => $value ) {
+ // If the attribute is not defined by the block type, it cannot be
+ // validated.
+ if ( ! isset( $this->attributes[ $attribute_name ] ) ) {
+ continue;
+ }
- foreach ( $this->attributes as $attribute_name => $schema ) {
- $value = null;
+ $schema = $this->attributes[ $attribute_name ];
- if ( isset( $attributes[ $attribute_name ] ) ) {
- $is_valid = rest_validate_value_from_schema( $attributes[ $attribute_name ], $schema );
- if ( ! is_wp_error( $is_valid ) ) {
- $value = rest_sanitize_value_from_schema( $attributes[ $attribute_name ], $schema );
- }
+ // Validate value by JSON schema. An invalid value should revert to
+ // its default, if one exists. This occurs by virtue of the missing
+ // attributes loop immediately following. If there is not a default
+ // assigned, the attribute value should remain unset.
+ $is_valid = rest_validate_value_from_schema( $value, $schema );
+ if ( is_wp_error( $is_valid ) ) {
+ unset( $attributes[ $attribute_name ] );
}
+ }
- if ( is_null( $value ) && isset( $schema['default'] ) ) {
- $value = $schema['default'];
+ // Populate values of any missing attributes for which the block type
+ // defines a default.
+ $missing_schema_attributes = array_diff_key( $this->attributes, $attributes );
+ foreach ( $missing_schema_attributes as $attribute_name => $schema ) {
+ if ( isset( $schema['default'] ) ) {
+ $attributes[ $attribute_name ] = $schema['default'];
}
-
- $prepared_attributes[ $attribute_name ] = $value;
}
- return $prepared_attributes;
+ return $attributes;
}
/**
diff --git a/lib/class-wp-rest-block-renderer-controller.php b/lib/class-wp-rest-block-renderer-controller.php
index 3ecf25de449301..b9839f080376a2 100644
--- a/lib/class-wp-rest-block-renderer-controller.php
+++ b/lib/class-wp-rest-block-renderer-controller.php
@@ -59,6 +59,7 @@ public function register_routes() {
'type' => 'object',
'additionalProperties' => false,
'properties' => $block_type->get_attributes(),
+ 'default' => array(),
),
'post_id' => array(
'description' => __( 'ID of the post context.', 'gutenberg' ),
diff --git a/lib/class-wp-rest-blocks-controller.php b/lib/class-wp-rest-blocks-controller.php
index 9689820c7494be..47882fafbff042 100644
--- a/lib/class-wp-rest-blocks-controller.php
+++ b/lib/class-wp-rest-blocks-controller.php
@@ -33,4 +33,57 @@ public function check_read_permission( $post ) {
return parent::check_read_permission( $post );
}
+
+ /**
+ * Filters a response based on the context defined in the schema.
+ *
+ * @since 4.4.0
+ *
+ * @param array $data Response data to fiter.
+ * @param string $context Context defined in the schema.
+ * @return array Filtered response.
+ */
+ public function filter_response_by_context( $data, $context ) {
+ $data = parent::filter_response_by_context( $data, $context );
+
+ /*
+ * Remove `title.rendered` and `content.rendered` from the response. It
+ * doesn't make sense for a reusable block to have rendered content on its
+ * own, since rendering a block requires it to be inside a post or a page.
+ */
+ unset( $data['title']['rendered'] );
+ unset( $data['content']['rendered'] );
+
+ return $data;
+ }
+
+ /**
+ * Retrieves the block's schema, conforming to JSON Schema.
+ *
+ * @since 4.4.0
+ *
+ * @return array Item schema data.
+ */
+ public function get_item_schema() {
+ $schema = parent::get_item_schema();
+
+ /*
+ * Allow all contexts to access `title.raw` and `content.raw`. Clients always
+ * need the raw markup of a reusable block to do anything useful, e.g. parse
+ * it or display it in an editor.
+ */
+ $schema['properties']['title']['properties']['raw']['context'] = array( 'view', 'edit' );
+ $schema['properties']['content']['properties']['raw']['context'] = array( 'view', 'edit' );
+
+ /*
+ * Remove `title.rendered` and `content.rendered` from the schema. It doesn’t
+ * make sense for a reusable block to have rendered content on its own, since
+ * rendering a block requires it to be inside a post or a page.
+ */
+ unset( $schema['properties']['title']['properties']['rendered'] );
+ unset( $schema['properties']['content']['properties']['rendered'] );
+
+ return $schema;
+ }
+
}
diff --git a/lib/client-assets.php b/lib/client-assets.php
index 7f4acff26619e4..c1a6e847bba5e9 100644
--- a/lib/client-assets.php
+++ b/lib/client-assets.php
@@ -87,6 +87,8 @@ function register_tinymce_scripts() {
gutenberg_override_script( 'wp-tinymce-root', includes_url( 'js/tinymce/' ) . "tinymce{$mce_suffix}.js", array(), $tinymce_version );
gutenberg_override_script( 'wp-tinymce', includes_url( 'js/tinymce/' ) . "plugins/compat3x/plugin{$suffix}.js", array( 'wp-tinymce-root' ), $tinymce_version );
}
+
+ gutenberg_override_script( 'wp-tinymce-lists', includes_url( 'js/tinymce/' ) . "plugins/lists/plugin{$suffix}.js", array( 'wp-tinymce' ), $tinymce_version );
}
}
@@ -133,6 +135,29 @@ function gutenberg_override_style( $handle, $src, $deps = array(), $ver = false,
wp_register_style( $handle, $src, $deps, $ver, $media );
}
+/**
+ * Registers all the WordPress packages scripts that are in the standardized
+ * `build/` location.
+ *
+ * @since 4.5.0
+ */
+function gutenberg_register_packages_scripts() {
+ $packages_dependencies = include dirname( __FILE__ ) . '/packages-dependencies.php';
+
+ foreach ( $packages_dependencies as $handle => $dependencies ) {
+ // Remove `wp-` prefix from the handle to get the package's name.
+ $package_name = strpos( $handle, 'wp-' ) === 0 ? substr( $handle, 3 ) : $handle;
+ $path = "build/$package_name/index.js";
+ gutenberg_override_script(
+ $handle,
+ gutenberg_url( $path ),
+ array_merge( $dependencies, array( 'wp-polyfill' ) ),
+ filemtime( gutenberg_dir_path() . $path ),
+ true
+ );
+ }
+}
+
/**
* Registers common scripts and styles to be used as dependencies of the editor
* and plugins.
@@ -144,90 +169,22 @@ function gutenberg_register_scripts_and_styles() {
register_tinymce_scripts();
- wp_script_add_data(
+ wp_add_inline_script(
'wp-polyfill',
- 'data',
gutenberg_get_script_polyfill(
array(
'\'fetch\' in window' => 'wp-polyfill-fetch',
'document.contains' => 'wp-polyfill-node-contains',
'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',
'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',
- )
+ ),
+ 'after'
)
);
- gutenberg_override_script(
- 'wp-url',
- gutenberg_url( 'build/url/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/url/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-autop',
- gutenberg_url( 'build/autop/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/autop/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-wordcount',
- gutenberg_url( 'build/wordcount/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/wordcount/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-dom-ready',
- gutenberg_url( 'build/dom-ready/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/dom-ready/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-a11y',
- gutenberg_url( 'build/a11y/index.js' ),
- array( 'wp-dom-ready', 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/a11y/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-hooks',
- gutenberg_url( 'build/hooks/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/hooks/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-i18n',
- gutenberg_url( 'build/i18n/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/i18n/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-is-shallow-equal',
- gutenberg_url( 'build/is-shallow-equal/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/is-shallow-equal/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-token-list',
- gutenberg_url( 'build/token-list/index.js' ),
- array( 'lodash', 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/token-list/index.js' ),
- true
- );
- // Editor Scripts.
- gutenberg_override_script(
- 'wp-api-fetch',
- gutenberg_url( 'build/api-fetch/index.js' ),
- array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ),
- filemtime( gutenberg_dir_path() . 'build/api-fetch/index.js' ),
- true
- );
+ gutenberg_register_packages_scripts();
+
+ // Inline scripts.
wp_add_inline_script(
'wp-api-fetch',
sprintf(
@@ -244,61 +201,6 @@ function gutenberg_register_scripts_and_styles() {
),
'after'
);
-
- gutenberg_override_script(
- 'wp-deprecated',
- gutenberg_url( 'build/deprecated/index.js' ),
- array( 'wp-polyfill', 'wp-hooks' ),
- filemtime( gutenberg_dir_path() . 'build/deprecated/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-blob',
- gutenberg_url( 'build/blob/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/blob/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-compose',
- gutenberg_url( 'build/compose/index.js' ),
- array(
- 'lodash',
- 'wp-element',
- 'wp-is-shallow-equal',
- 'wp-polyfill',
- ),
- filemtime( gutenberg_dir_path() . 'build/compose/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-keycodes',
- gutenberg_url( 'build/keycodes/index.js' ),
- array( 'lodash', 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/keycodes/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-html-entities',
- gutenberg_url( 'build/html-entities/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/html-entities/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-data',
- gutenberg_url( 'build/data/index.js' ),
- array(
- 'lodash',
- 'wp-compose',
- 'wp-element',
- 'wp-is-shallow-equal',
- 'wp-polyfill',
- 'wp-redux-routine',
- ),
- filemtime( gutenberg_dir_path() . 'build/data/index.js' ),
- true
- );
wp_add_inline_script(
'wp-data',
implode(
@@ -314,62 +216,6 @@ function gutenberg_register_scripts_and_styles() {
)
)
);
- gutenberg_override_script(
- 'wp-annotations',
- gutenberg_url( 'build/annotations/index.js' ),
- array( 'wp-polyfill', 'wp-data', 'wp-rich-text', 'wp-hooks', 'wp-i18n' ),
- filemtime( gutenberg_dir_path() . 'build/annotations/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-core-data',
- gutenberg_url( 'build/core-data/index.js' ),
- array( 'wp-data', 'wp-api-fetch', 'wp-polyfill', 'wp-url', 'lodash' ),
- filemtime( gutenberg_dir_path() . 'build/core-data/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-dom',
- gutenberg_url( 'build/dom/index.js' ),
- array( 'lodash', 'wp-polyfill', 'wp-tinymce' ),
- filemtime( gutenberg_dir_path() . 'build/dom/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-block-serialization-default-parser',
- gutenberg_url( 'build/block-serialization-default-parser/index.js' ),
- array(),
- filemtime( gutenberg_dir_path() . 'build/block-serialization-default-parser/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-block-serialization-spec-parser',
- gutenberg_url( 'build/block-serialization-spec-parser/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/block-serialization-spec-parser/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-shortcode',
- gutenberg_url( 'build/shortcode/index.js' ),
- array( 'wp-polyfill', 'lodash' ),
- filemtime( gutenberg_dir_path() . 'build/shortcode/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-redux-routine',
- gutenberg_url( 'build/redux-routine/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/redux-routine/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-date',
- gutenberg_url( 'build/date/index.js' ),
- array( 'moment', 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/date/index.js' ),
- true
- );
global $wp_locale;
wp_add_inline_script(
'wp-date',
@@ -406,162 +252,32 @@ function gutenberg_register_scripts_and_styles() {
),
'after'
);
- gutenberg_override_script(
- 'wp-element',
- gutenberg_url( 'build/element/index.js' ),
- array( 'wp-polyfill', 'react', 'react-dom', 'lodash', 'wp-escape-html' ),
- filemtime( gutenberg_dir_path() . 'build/element/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-escape-html',
- gutenberg_url( 'build/escape-html/index.js' ),
- array( 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/element/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-rich-text',
- gutenberg_url( 'build/rich-text/index.js' ),
- array(
- 'lodash',
- 'wp-polyfill',
- 'wp-data',
- 'wp-escape-html',
- ),
- filemtime( gutenberg_dir_path() . 'build/rich-text/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-components',
- gutenberg_url( 'build/components/index.js' ),
- array(
- 'lodash',
- 'moment',
- 'wp-a11y',
- 'wp-api-fetch',
- 'wp-compose',
- 'wp-deprecated',
- 'wp-dom',
- 'wp-element',
- 'wp-hooks',
- 'wp-html-entities',
- 'wp-i18n',
- 'wp-is-shallow-equal',
- 'wp-keycodes',
- 'wp-polyfill',
- 'wp-rich-text',
- 'wp-url',
- ),
- filemtime( gutenberg_dir_path() . 'build/components/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-blocks',
- gutenberg_url( 'build/blocks/index.js' ),
- array(
- 'wp-autop',
- 'wp-blob',
- 'wp-block-serialization-default-parser',
- 'wp-data',
- 'wp-dom',
- 'wp-element',
- 'wp-hooks',
- 'wp-html-entities',
- 'wp-i18n',
- 'wp-is-shallow-equal',
- 'wp-polyfill',
- 'wp-shortcode',
- 'lodash',
- ),
- filemtime( gutenberg_dir_path() . 'build/blocks/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-notices',
- gutenberg_url( 'build/notices/index.js' ),
- array(
- 'lodash',
- 'wp-a11y',
- 'wp-data',
- 'wp-polyfill',
- ),
- filemtime( gutenberg_dir_path() . 'build/notices/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-viewport',
- gutenberg_url( 'build/viewport/index.js' ),
- array( 'wp-polyfill', 'wp-element', 'wp-data', 'wp-compose', 'lodash' ),
- filemtime( gutenberg_dir_path() . 'build/viewport/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-block-library',
- gutenberg_url( 'build/block-library/index.js' ),
- array(
- 'editor',
- 'lodash',
- 'moment',
- 'wp-api-fetch',
- 'wp-autop',
- 'wp-blob',
- 'wp-blocks',
- 'wp-components',
- 'wp-compose',
- 'wp-core-data',
- 'wp-data',
- 'wp-date',
- 'wp-editor',
- 'wp-element',
- 'wp-html-entities',
- 'wp-i18n',
- 'wp-keycodes',
- 'wp-polyfill',
- 'wp-url',
- 'wp-viewport',
- 'wp-rich-text',
- ),
- filemtime( gutenberg_dir_path() . 'build/block-library/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-format-library',
- gutenberg_url( 'build/format-library/index.js' ),
- array(
- 'wp-components',
- 'wp-dom',
- 'wp-editor',
- 'wp-element',
- 'wp-i18n',
- 'wp-keycodes',
- 'wp-polyfill',
- 'wp-rich-text',
- 'wp-url',
- ),
- filemtime( gutenberg_dir_path() . 'build/format-library/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-nux',
- gutenberg_url( 'build/nux/index.js' ),
- array(
- 'wp-element',
- 'wp-components',
- 'wp-compose',
- 'wp-data',
- 'wp-i18n',
- 'wp-polyfill',
- 'lodash',
+ wp_add_inline_script(
+ 'moment',
+ sprintf(
+ "moment.locale( '%s', %s );",
+ get_user_locale(),
+ wp_json_encode(
+ array(
+ 'months' => array_values( $wp_locale->month ),
+ 'monthsShort' => array_values( $wp_locale->month_abbrev ),
+ 'weekdays' => array_values( $wp_locale->weekday ),
+ 'weekdaysShort' => array_values( $wp_locale->weekday_abbrev ),
+ 'week' => array(
+ 'dow' => (int) get_option( 'start_of_week', 0 ),
+ ),
+ 'longDateFormat' => array(
+ 'LT' => get_option( 'time_format', __( 'g:i a', 'default' ) ),
+ 'LTS' => null,
+ 'L' => null,
+ 'LL' => get_option( 'date_format', __( 'F j, Y', 'default' ) ),
+ 'LLL' => __( 'F j, Y g:i a', 'default' ),
+ 'LLLL' => null,
+ ),
+ )
+ )
),
- filemtime( gutenberg_dir_path() . 'build/nux/index.js' ),
- true
- );
- gutenberg_override_script(
- 'wp-plugins',
- gutenberg_url( 'build/plugins/index.js' ),
- array( 'lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill' ),
- filemtime( gutenberg_dir_path() . 'build/plugins/index.js' )
+ 'after'
);
// Loading the old editor and its config to ensure the classic block works as expected.
wp_add_inline_script(
@@ -569,205 +285,127 @@ function gutenberg_register_scripts_and_styles() {
'window.wp.oldEditor = window.wp.editor;',
'after'
);
- $tinymce_settings = apply_filters(
- 'tiny_mce_before_init',
- array(
- 'plugins' => implode(
- ',',
- array_unique(
- apply_filters(
- 'tiny_mce_plugins',
- array(
- 'charmap',
- 'colorpicker',
- 'hr',
- 'lists',
- 'media',
- 'paste',
- 'tabfocus',
- 'textcolor',
- 'fullscreen',
- 'wordpress',
- 'wpautoresize',
- 'wpeditimage',
- 'wpemoji',
- 'wpgallery',
- 'wplink',
- 'wpdialogs',
- 'wptextpattern',
- 'wpview',
- )
- )
- )
- ),
- 'toolbar1' => implode(
- ',',
- apply_filters(
- 'mce_buttons',
- array(
- 'formatselect',
- 'bold',
- 'italic',
- 'bullist',
- 'numlist',
- 'blockquote',
- 'alignleft',
- 'aligncenter',
- 'alignright',
- 'link',
- 'unlink',
- 'wp_more',
- 'spellchecker',
- 'wp_add_media',
- 'kitchensink',
- ),
- 'editor'
- )
- ),
- 'toolbar2' => implode(
- ',',
- apply_filters(
- 'mce_buttons_2',
- array(
- 'strikethrough',
- 'hr',
- 'forecolor',
- 'pastetext',
- 'removeformat',
- 'charmap',
- 'outdent',
- 'indent',
- 'undo',
- 'redo',
- 'wp_help',
- ),
- 'editor'
- )
- ),
- 'toolbar3' => implode( ',', apply_filters( 'mce_buttons_3', array(), 'editor' ) ),
- 'toolbar4' => implode( ',', apply_filters( 'mce_buttons_4', array(), 'editor' ) ),
- 'external_plugins' => apply_filters( 'mce_external_plugins', array() ),
- ),
- 'editor'
- );
- if ( isset( $tinymce_settings['style_formats'] ) && is_string( $tinymce_settings['style_formats'] ) ) {
- // Decode the options as we used to recommende json_encoding the TinyMCE settings.
- $tinymce_settings['style_formats'] = json_decode( $tinymce_settings['style_formats'] );
+
+ $tinymce_plugins = array(
+ 'charmap',
+ 'colorpicker',
+ 'hr',
+ 'lists',
+ 'media',
+ 'paste',
+ 'tabfocus',
+ 'textcolor',
+ 'fullscreen',
+ 'wordpress',
+ 'wpautoresize',
+ 'wpeditimage',
+ 'wpemoji',
+ 'wpgallery',
+ 'wplink',
+ 'wpdialogs',
+ 'wptextpattern',
+ 'wpview',
+ );
+ $tinymce_plugins = apply_filters( 'tiny_mce_plugins', $tinymce_plugins, 'classic-block' );
+ $tinymce_plugins = array_unique( $tinymce_plugins );
+
+ $toolbar1 = array(
+ 'formatselect',
+ 'bold',
+ 'italic',
+ 'bullist',
+ 'numlist',
+ 'blockquote',
+ 'alignleft',
+ 'aligncenter',
+ 'alignright',
+ 'link',
+ 'unlink',
+ 'wp_more',
+ 'spellchecker',
+ 'wp_add_media',
+ 'kitchensink',
+ );
+ $toolbar1 = apply_filters( 'mce_buttons', $toolbar1, 'classic-block' );
+
+ $toolbar2 = array(
+ 'strikethrough',
+ 'hr',
+ 'forecolor',
+ 'pastetext',
+ 'removeformat',
+ 'charmap',
+ 'outdent',
+ 'indent',
+ 'undo',
+ 'redo',
+ 'wp_help',
+ );
+ $toolbar2 = apply_filters( 'mce_buttons_2', $toolbar2, 'classic-block' );
+
+ $toolbar3 = apply_filters( 'mce_buttons_3', array(), 'classic-block' );
+ $toolbar4 = apply_filters( 'mce_buttons_4', array(), 'classic-block' );
+
+ $external_plugins = apply_filters( 'mce_external_plugins', array(), 'classic-block' );
+
+ $tinymce_settings = array(
+ 'plugins' => implode( ',', $tinymce_plugins ),
+ 'toolbar1' => implode( ',', $toolbar1 ),
+ 'toolbar2' => implode( ',', $toolbar2 ),
+ 'toolbar3' => implode( ',', $toolbar3 ),
+ 'toolbar4' => implode( ',', $toolbar4 ),
+ 'external_plugins' => wp_json_encode( $external_plugins ),
+ 'classic_block_editor' => true,
+ );
+ $tinymce_settings = apply_filters( 'tiny_mce_before_init', $tinymce_settings, 'classic-block' );
+
+ // Do "by hand" translation from PHP array to js object.
+ // Prevents breakage in some custom settings.
+ $init_obj = '';
+ foreach ( $tinymce_settings as $key => $value ) {
+ if ( is_bool( $value ) ) {
+ $val = $value ? 'true' : 'false';
+ $init_obj .= $key . ':' . $val . ',';
+ continue;
+ } elseif ( ! empty( $value ) && is_string( $value ) && (
+ ( '{' == $value{0} && '}' == $value{strlen( $value ) - 1} ) ||
+ ( '[' == $value{0} && ']' == $value{strlen( $value ) - 1} ) ||
+ preg_match( '/^\(?function ?\(/', $value ) ) ) {
+
+ $init_obj .= $key . ':' . $value . ',';
+ continue;
+ }
+ $init_obj .= $key . ':"' . $value . '",';
}
- wp_localize_script(
- 'wp-block-library',
- 'wpEditorL10n',
- array(
- 'tinymce' => array(
- 'baseURL' => includes_url( 'js/tinymce' ),
- 'suffix' => SCRIPT_DEBUG ? '' : '.min',
- 'settings' => $tinymce_settings,
- ),
- )
- );
- gutenberg_override_script(
- 'wp-editor',
- gutenberg_url( 'build/editor/index.js' ),
- array(
- 'jquery',
- 'lodash',
- 'tinymce-latest-lists',
- 'wp-a11y',
- 'wp-api-fetch',
- 'wp-blob',
- 'wp-blocks',
- 'wp-components',
- 'wp-compose',
- 'wp-core-data',
- 'wp-data',
- 'wp-date',
- 'wp-deprecated',
- 'wp-dom',
- 'wp-element',
- 'wp-hooks',
- 'wp-html-entities',
- 'wp-i18n',
- 'wp-is-shallow-equal',
- 'wp-keycodes',
- 'wp-notices',
- 'wp-nux',
- 'wp-polyfill',
- 'wp-tinymce',
- 'wp-token-list',
- 'wp-url',
- 'wp-viewport',
- 'wp-wordcount',
- 'wp-rich-text',
- ),
- filemtime( gutenberg_dir_path() . 'build/editor/index.js' )
- );
+ $init_obj = '{' . trim( $init_obj, ' ,' ) . '}';
- gutenberg_override_script(
- 'wp-edit-post',
- gutenberg_url( 'build/edit-post/index.js' ),
- array(
- 'jquery',
- 'lodash',
- 'postbox',
- 'media-models',
- 'media-views',
- 'wp-a11y',
- 'wp-api-fetch',
- 'wp-block-library',
- 'wp-blocks',
- 'wp-components',
- 'wp-compose',
- 'wp-core-data',
- 'wp-data',
- 'wp-dom-ready',
- 'wp-editor',
- 'wp-element',
- 'wp-embed',
- 'wp-i18n',
- 'wp-keycodes',
- 'wp-nux',
- 'wp-plugins',
- 'wp-polyfill',
- 'wp-url',
- 'wp-viewport',
- ),
- filemtime( gutenberg_dir_path() . 'build/edit-post/index.js' ),
- true
- );
+ $script = 'window.wpEditorL10n = {
+ tinymce: {
+ baseURL: ' . wp_json_encode( includes_url( 'js/tinymce' ) ) . ',
+ suffix: ' . ( SCRIPT_DEBUG ? '""' : '".min"' ) . ',
+ settings: ' . $init_obj . ',
+ }
+ }';
- gutenberg_override_script(
- 'wp-list-reusable-blocks',
- gutenberg_url( 'build/list-reusable-blocks/index.js' ),
- array(
- 'lodash',
- 'wp-api-fetch',
- 'wp-components',
- 'wp-compose',
- 'wp-element',
- 'wp-i18n',
- 'wp-polyfill',
- ),
- filemtime( gutenberg_dir_path() . 'build/list-reusable-blocks/index.js' ),
- true
- );
+ wp_add_inline_script( 'wp-block-library', $script, 'before' );
// Editor Styles.
- // This empty stylesheet is defined to ensure backwards compatibility.
+ // This empty stylesheet is defined to ensure backward compatibility.
gutenberg_override_style( 'wp-blocks', false );
-
$fonts_url = '';
/*
- * Translators: If there are characters in your language that are not supported
- * by Noto Serif, translate this to 'off'. Do not translate into your own language.
+ * Translators: Use this to specify the proper Google Font name and variants
+ * to load that is supported by your language. Do not translate.
+ * Set to 'off' to disable loading.
*/
- if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'gutenberg' ) ) {
+ $font_family = _x( 'Noto Serif:400,400i,700,700i', 'Google Font Name and Variants', 'gutenberg' );
+ if ( 'off' !== $font_family ) {
$query_args = array(
- 'family' => urlencode( 'Noto Serif:400,400i,700,700i' ),
+ 'family' => urlencode( $font_family ),
);
-
- $fonts_url = esc_url_raw( add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ) );
+ $fonts_url = esc_url_raw( add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ) );
}
gutenberg_override_style(
@@ -823,6 +461,7 @@ function gutenberg_register_scripts_and_styles() {
array(
'wp-components',
'wp-editor',
+ 'wp-block-library',
// Always include visual styles so the editor never appears broken.
'wp-block-library-theme',
),
@@ -984,12 +623,6 @@ function gutenberg_register_vendor_scripts() {
'https://unpkg.com/moment@2.22.1/' . $moment_script,
array()
);
- $tinymce_version = '4.7.11';
- gutenberg_register_vendor_script(
- 'tinymce-latest-lists',
- 'https://unpkg.com/tinymce@' . $tinymce_version . '/plugins/lists/plugin' . $suffix . '.js',
- array( 'wp-tinymce' )
- );
gutenberg_register_vendor_script(
'lodash',
'https://unpkg.com/lodash@4.17.5/lodash' . $suffix . '.js'
@@ -1423,6 +1056,7 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
// editor". Forcing this to be true guarantees that TinyMCE and its plugins
// are available in Gutenberg. Fixes
// https://github.com/WordPress/gutenberg/issues/5667.
+ $user_can_richedit = user_can_richedit();
add_filter( 'user_can_richedit', '__return_true' );
wp_enqueue_script( 'wp-edit-post' );
@@ -1577,6 +1211,13 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
),
),
);
+
+ /* Translators: Use this to specify the CSS font family for the default font */
+ $locale_font_family = esc_html_x( 'Noto Serif', 'CSS Font Family for Editor Font', 'gutenberg' );
+ $styles[] = array(
+ 'css' => "body { font-family: '$locale_font_family' }",
+ );
+
if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
foreach ( $editor_styles as $style ) {
if ( filter_var( $style, FILTER_VALIDATE_URL ) ) {
@@ -1584,11 +1225,13 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
'css' => file_get_contents( $style ),
);
} else {
- $file = get_theme_file_path( $style );
- $styles[] = array(
- 'css' => file_get_contents( get_theme_file_path( $style ) ),
- 'baseURL' => get_theme_file_uri( $style ),
- );
+ $file = get_theme_file_path( $style );
+ if ( file_exists( $file ) ) {
+ $styles[] = array(
+ 'css' => file_get_contents( $file ),
+ 'baseURL' => get_theme_file_uri( $style ),
+ );
+ }
}
}
}
@@ -1654,6 +1297,7 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
'allowedMimeTypes' => get_allowed_mime_types(),
'styles' => $styles,
'imageSizes' => gutenberg_get_available_image_sizes(),
+ 'richEditingEnabled' => $user_can_richedit,
// Ideally, we'd remove this and rely on a REST API endpoint.
'postLock' => $lock_details,
diff --git a/lib/compat.php b/lib/compat.php
index ff0938c496828a..03af8d9302af14 100644
--- a/lib/compat.php
+++ b/lib/compat.php
@@ -99,24 +99,6 @@ function gutenberg_add_rest_nonce_to_heartbeat_response_headers( $response ) {
}
add_filter( 'wp_refresh_nonces', 'gutenberg_add_rest_nonce_to_heartbeat_response_headers' );
-/**
- * As a substitute for the default content `wpautop` filter, applies autop
- * behavior only for posts where content does not contain blocks.
- *
- * @param string $content Post content.
- * @return string Paragraph-converted text if non-block content.
- */
-function gutenberg_wpautop( $content ) {
- if ( has_blocks( $content ) ) {
- return $content;
- }
-
- return wpautop( $content );
-}
-remove_filter( 'the_content', 'wpautop' );
-add_filter( 'the_content', 'gutenberg_wpautop', 6 );
-
-
/**
* Check if we need to load the block warning in the Classic Editor.
*
@@ -304,3 +286,22 @@ function gutenberg_warn_classic_about_blocks() {
array(
+ 'wp-dom-ready',
+ ),
+ 'wp-annotations' => array(
+ 'wp-data',
+ 'wp-hooks',
+ 'wp-i18n',
+ 'wp-rich-text',
+ ),
+ 'wp-api-fetch' => array(
+ 'wp-hooks',
+ 'wp-i18n',
+ 'wp-url',
+ ),
+ 'wp-autop' => array(),
+ 'wp-blob' => array(),
+ 'wp-block-library' => array(
+ 'editor',
+ 'lodash',
+ 'wp-api-fetch',
+ 'wp-autop',
+ 'wp-blob',
+ 'wp-blocks',
+ 'wp-components',
+ 'wp-compose',
+ 'wp-core-data',
+ 'wp-data',
+ 'wp-date',
+ 'wp-editor',
+ 'wp-element',
+ 'wp-html-entities',
+ 'wp-i18n',
+ 'wp-keycodes',
+ 'wp-rich-text',
+ 'wp-url',
+ 'wp-viewport',
+ ),
+ 'wp-block-serialization-default-parser' => array(),
+ 'wp-block-serialization-spec-parser' => array(),
+ 'wp-blocks' => array(
+ 'lodash',
+ 'wp-autop',
+ 'wp-blob',
+ 'wp-block-serialization-default-parser',
+ 'wp-data',
+ 'wp-dom',
+ 'wp-element',
+ 'wp-hooks',
+ 'wp-html-entities',
+ 'wp-i18n',
+ 'wp-is-shallow-equal',
+ 'wp-shortcode',
+ ),
+ 'wp-components' => array(
+ 'lodash',
+ 'moment',
+ 'wp-a11y',
+ 'wp-api-fetch',
+ 'wp-compose',
+ 'wp-dom',
+ 'wp-element',
+ 'wp-hooks',
+ 'wp-html-entities',
+ 'wp-i18n',
+ 'wp-is-shallow-equal',
+ 'wp-keycodes',
+ 'wp-rich-text',
+ 'wp-url',
+ ),
+ 'wp-compose' => array(
+ 'lodash',
+ 'wp-element',
+ 'wp-is-shallow-equal',
+ ),
+ 'wp-core-data' => array(
+ 'lodash',
+ 'wp-api-fetch',
+ 'wp-data',
+ 'wp-url',
+ ),
+ 'wp-data' => array(
+ 'lodash',
+ 'wp-compose',
+ 'wp-element',
+ 'wp-is-shallow-equal',
+ 'wp-redux-routine',
+ ),
+ 'wp-date' => array(
+ 'moment',
+ ),
+ 'wp-deprecated' => array(
+ 'wp-hooks',
+ ),
+ 'wp-dom' => array(
+ 'lodash',
+ 'wp-tinymce',
+ ),
+ 'wp-dom-ready' => array(),
+ 'wp-edit-post' => array(
+ 'jquery',
+ 'lodash',
+ 'postbox',
+ 'media-models',
+ 'media-views',
+ 'wp-a11y',
+ 'wp-api-fetch',
+ 'wp-block-library',
+ 'wp-blocks',
+ 'wp-components',
+ 'wp-compose',
+ 'wp-core-data',
+ 'wp-data',
+ 'wp-dom-ready',
+ 'wp-editor',
+ 'wp-element',
+ 'wp-embed',
+ 'wp-i18n',
+ 'wp-keycodes',
+ 'wp-notices',
+ 'wp-nux',
+ 'wp-plugins',
+ 'wp-url',
+ 'wp-viewport',
+ ),
+ 'wp-editor' => array(
+ 'jquery',
+ 'lodash',
+ 'wp-tinymce-lists',
+ 'wp-a11y',
+ 'wp-api-fetch',
+ 'wp-blob',
+ 'wp-blocks',
+ 'wp-components',
+ 'wp-compose',
+ 'wp-core-data',
+ 'wp-data',
+ 'wp-date',
+ 'wp-deprecated',
+ 'wp-dom',
+ 'wp-element',
+ 'wp-hooks',
+ 'wp-html-entities',
+ 'wp-i18n',
+ 'wp-is-shallow-equal',
+ 'wp-keycodes',
+ 'wp-notices',
+ 'wp-nux',
+ 'wp-rich-text',
+ 'wp-tinymce',
+ 'wp-token-list',
+ 'wp-url',
+ 'wp-viewport',
+ 'wp-wordcount',
+ ),
+ 'wp-element' => array(
+ 'lodash',
+ 'react',
+ 'react-dom',
+ 'wp-escape-html',
+ ),
+ 'wp-escape-html' => array(),
+ 'wp-format-library' => array(
+ 'wp-components',
+ 'wp-dom',
+ 'wp-editor',
+ 'wp-element',
+ 'wp-i18n',
+ 'wp-keycodes',
+ 'wp-rich-text',
+ 'wp-url',
+ ),
+ 'wp-hooks' => array(),
+ 'wp-html-entities' => array(),
+ 'wp-i18n' => array(),
+ 'wp-is-shallow-equal' => array(),
+ 'wp-keycodes' => array(
+ 'lodash',
+ 'wp-i18n',
+ ),
+ 'wp-list-reusable-blocks' => array(
+ 'lodash',
+ 'wp-api-fetch',
+ 'wp-components',
+ 'wp-compose',
+ 'wp-element',
+ 'wp-i18n',
+ ),
+ 'wp-notices' => array(
+ 'lodash',
+ 'wp-a11y',
+ 'wp-data',
+ ),
+ 'wp-nux' => array(
+ 'lodash',
+ 'wp-components',
+ 'wp-compose',
+ 'wp-data',
+ 'wp-element',
+ 'wp-i18n',
+ ),
+ 'wp-plugins' => array(
+ 'lodash',
+ 'wp-compose',
+ 'wp-element',
+ 'wp-hooks',
+ ),
+ 'wp-redux-routine' => array(),
+ 'wp-rich-text' => array(
+ 'lodash',
+ 'wp-data',
+ 'wp-escape-html',
+ ),
+ 'wp-shortcode' => array(
+ 'lodash',
+ ),
+ 'wp-token-list' => array(
+ 'lodash',
+ ),
+ 'wp-url' => array(),
+ 'wp-viewport' => array(
+ 'lodash',
+ 'wp-compose',
+ 'wp-data',
+ 'wp-element',
+ ),
+ 'wp-wordcount' => array(),
+);
diff --git a/lib/rest-api.php b/lib/rest-api.php
index 35f4af5c52e77e..2baec1befdd19d 100644
--- a/lib/rest-api.php
+++ b/lib/rest-api.php
@@ -206,6 +206,11 @@ function gutenberg_add_permalink_template_to_posts( $response, $post, $request )
return $response;
}
+ $post_type_obj = get_post_type_object( $post->post_type );
+ if ( ! is_post_type_viewable( $post_type_obj ) || ! $post_type_obj->public ) {
+ return $response;
+ }
+
if ( ! function_exists( 'get_sample_permalink' ) ) {
require_once ABSPATH . '/wp-admin/includes/post.php';
}
diff --git a/package-lock.json b/package-lock.json
index 194f9cde20cf27..eb6406cdd4b658 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "4.4.0",
+ "version": "4.7.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -2283,14 +2283,9 @@
"@wordpress/i18n": "file:packages/i18n",
"@wordpress/rich-text": "file:packages/rich-text",
"lodash": "^4.17.10",
+ "memize": "^1.0.5",
"rememo": "^3.0.0",
"uuid": "^3.3.2"
- },
- "dependencies": {
- "uuid": {
- "version": "3.3.2",
- "bundled": true
- }
}
},
"@wordpress/api-fetch": {
@@ -2328,6 +2323,7 @@
"version": "file:packages/babel-preset-default",
"dev": true,
"requires": {
+ "@babel/core": "^7.0.0",
"@babel/plugin-proposal-async-generator-functions": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
@@ -2365,9 +2361,6 @@
"classnames": "^2.2.5",
"lodash": "^4.17.10",
"memize": "^1.0.5",
- "moment": "^2.22.1",
- "querystring": "^0.2.0",
- "querystringify": "^1.0.0",
"url": "^0.11.0"
}
},
@@ -2416,7 +2409,6 @@
"@wordpress/a11y": "file:packages/a11y",
"@wordpress/api-fetch": "file:packages/api-fetch",
"@wordpress/compose": "file:packages/compose",
- "@wordpress/deprecated": "file:packages/deprecated",
"@wordpress/dom": "file:packages/dom",
"@wordpress/element": "file:packages/element",
"@wordpress/hooks": "file:packages/hooks",
@@ -2599,6 +2591,16 @@
"@babel/runtime": "^7.0.0"
}
},
+ "@wordpress/eslint-plugin": {
+ "version": "file:packages/eslint-plugin",
+ "dev": true,
+ "requires": {
+ "babel-eslint": "^8.0.3",
+ "eslint-plugin-jsx-a11y": "6.0.2",
+ "eslint-plugin-react": "7.7.0",
+ "requireindex": "^1.2.0"
+ }
+ },
"@wordpress/format-library": {
"version": "file:packages/format-library",
"requires": {
@@ -2647,7 +2649,7 @@
"dev": true,
"requires": {
"@babel/runtime": "^7.0.0",
- "jest-matcher-utils": "^22.4.3",
+ "jest-matcher-utils": "^23.6.0",
"lodash": "^4.17.10"
}
},
@@ -2656,7 +2658,7 @@
"dev": true,
"requires": {
"@wordpress/jest-console": "file:packages/jest-console",
- "babel-jest": "^23.4.2",
+ "babel-jest": "^23.6.0",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"jest-enzyme": "^6.0.2"
@@ -2666,6 +2668,7 @@
"version": "file:packages/keycodes",
"requires": {
"@babel/runtime": "^7.0.0",
+ "@wordpress/i18n": "file:packages/i18n",
"lodash": "^4.17.10"
}
},
@@ -2678,6 +2681,18 @@
"webpack-sources": "^1.1.0"
}
},
+ "@wordpress/list-reusable-blocks": {
+ "version": "file:packages/list-reusable-blocks",
+ "requires": {
+ "@babel/runtime": "^7.0.0",
+ "@wordpress/api-fetch": "file:packages/api-fetch",
+ "@wordpress/components": "file:packages/components",
+ "@wordpress/compose": "file:packages/compose",
+ "@wordpress/element": "file:packages/element",
+ "@wordpress/i18n": "file:packages/i18n",
+ "lodash": "^4.17.10"
+ }
+ },
"@wordpress/notices": {
"version": "file:packages/notices",
"requires": {
@@ -2719,7 +2734,9 @@
"dev": true,
"requires": {
"@babel/runtime": "^7.0.0",
- "postcss": "^6.0.16"
+ "autoprefixer": "^8.2.0",
+ "postcss": "^6.0.16",
+ "postcss-color-function": "^4.0.1"
}
},
"@wordpress/redux-routine": {
@@ -2734,6 +2751,7 @@
"version": "file:packages/rich-text",
"requires": {
"@babel/runtime": "^7.0.0",
+ "@wordpress/compose": "file:packages/compose",
"@wordpress/data": "file:packages/data",
"@wordpress/escape-html": "file:packages/escape-html",
"lodash": "^4.17.10",
@@ -2745,16 +2763,21 @@
"dev": true,
"requires": {
"@wordpress/babel-preset-default": "file:packages/babel-preset-default",
+ "@wordpress/eslint-plugin": "file:packages/eslint-plugin",
"@wordpress/jest-preset-default": "file:packages/jest-preset-default",
"@wordpress/npm-package-json-lint-config": "file:packages/npm-package-json-lint-config",
- "babel-eslint": "8.0.3",
"chalk": "^2.4.1",
+ "check-node-version": "^3.1.1",
"cross-spawn": "^5.1.0",
"eslint": "^4.19.1",
- "jest": "^23.4.2",
+ "jest": "^23.6.0",
+ "jest-puppeteer": "3.2.1",
"npm-package-json-lint": "^3.3.1",
+ "puppeteer": "1.6.1",
"read-pkg-up": "^1.0.1",
- "resolve-bin": "^0.4.0"
+ "resolve-bin": "^0.4.0",
+ "stylelint": "^9.5.0",
+ "stylelint-config-wordpress": "^13.1.0"
}
},
"@wordpress/shortcode": {
@@ -3002,19 +3025,13 @@
"normalize-path": "^2.1.1"
}
},
- "app-root-path": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.1.0.tgz",
- "integrity": "sha1-mL9lmTJ+zqGZMJhm6BQDaP0uZGo=",
- "dev": true
- },
"append-transform": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz",
- "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==",
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz",
+ "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=",
"dev": true,
"requires": {
- "default-require-extensions": "^2.0.0"
+ "default-require-extensions": "^1.0.0"
}
},
"aproba": {
@@ -3050,16 +3067,6 @@
}
}
},
- "aria-query": {
- "version": "0.7.1",
- "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.1.tgz",
- "integrity": "sha1-Jsu1r/ZBRLCoJb4YRuCxbPoAsR4=",
- "dev": true,
- "requires": {
- "ast-types-flow": "0.0.7",
- "commander": "^2.11.0"
- }
- },
"arr-diff": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
@@ -3318,15 +3325,6 @@
"integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==",
"dev": true
},
- "axobject-query": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-0.1.0.tgz",
- "integrity": "sha1-YvWdvFnJ+SQnWco0mWDnov48NsA=",
- "dev": true,
- "requires": {
- "ast-types-flow": "0.0.7"
- }
- },
"babel-code-frame": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
@@ -3680,9 +3678,9 @@
}
},
"babel-jest": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.4.2.tgz",
- "integrity": "sha512-wg1LJ2tzsafXqPFVgAsYsMCVD5U7kwJZAvbZIxVm27iOewsQw1BR7VZifDlMTEWVo3wasoPPyMdKXWCsfFPr3Q==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz",
+ "integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==",
"dev": true,
"requires": {
"babel-plugin-istanbul": "^4.1.6",
@@ -4507,6 +4505,16 @@
"tweetnacl": "^0.14.3"
}
},
+ "benchmark": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz",
+ "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.4",
+ "platform": "^1.3.3"
+ }
+ },
"bfj": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/bfj/-/bfj-6.1.1.tgz",
@@ -5666,15 +5674,6 @@
"integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==",
"dev": true
},
- "comment-parser": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.4.2.tgz",
- "integrity": "sha1-+lo/eAEwcBFIZtx7jpzzF6ljX3Q=",
- "dev": true,
- "requires": {
- "readable-stream": "^2.0.4"
- }
- },
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
@@ -5702,12 +5701,6 @@
}
}
},
- "compare-versions": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.3.0.tgz",
- "integrity": "sha512-MAAAIOdi2s4Gl6rZ76PNcUa9IOYB+5ICdT41o5uMRf09aEu/F9RK+qhe8RjXNPwcTjGV7KU7h2P/fljThFVqyQ==",
- "dev": true
- },
"component-emitter": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
@@ -6859,20 +6852,12 @@
"integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ=="
},
"default-require-extensions": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz",
- "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz",
+ "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=",
"dev": true,
"requires": {
- "strip-bom": "^3.0.0"
- },
- "dependencies": {
- "strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true
- }
+ "strip-bom": "^2.0.0"
}
},
"defaults": {
@@ -7371,16 +7356,6 @@
}
}
},
- "enzyme-matchers": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/enzyme-matchers/-/enzyme-matchers-6.0.2.tgz",
- "integrity": "sha1-eU1OQyVNqqD//TpZHlhp/IYd7rI=",
- "dev": true,
- "requires": {
- "circular-json-es6": "^2.0.1",
- "deep-equal-ident": "^1.1.1"
- }
- },
"enzyme-to-json": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/enzyme-to-json/-/enzyme-to-json-3.3.4.tgz",
@@ -7574,34 +7549,12 @@
}
}
},
- "eslint-config-wordpress": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/eslint-config-wordpress/-/eslint-config-wordpress-2.0.0.tgz",
- "integrity": "sha1-UgEgbGlk1kgxUjLt9t+9LpJeTNY=",
- "dev": true
- },
- "eslint-plugin-i18n": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-i18n/-/eslint-plugin-i18n-1.2.0.tgz",
- "integrity": "sha1-SfP0OA7e/oyHbwyXlh9lw6w3zao=",
- "dev": true
- },
"eslint-plugin-jest": {
"version": "21.5.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.5.0.tgz",
"integrity": "sha512-4fxfe2RcqzU+IVNQL5n4pqibLcUhKKxihYsA510+6kC/FTdGInszDDHgO4ntBzPWu8mcHAvKJLs8o3AQw6eHTg==",
"dev": true
},
- "eslint-plugin-jsdoc": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-3.5.0.tgz",
- "integrity": "sha512-qoNpVicVWGjGBXAJsqRoqVuAnajgX7PWtSa2Men36XKRiXe3RS/QmRv215PXZwo4OHskYOsUoJUeiPiWtS9ULA==",
- "dev": true,
- "requires": {
- "comment-parser": "^0.4.2",
- "lodash": "^4.17.4"
- }
- },
"eslint-plugin-jsx-a11y": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.2.tgz",
@@ -7615,18 +7568,33 @@
"damerau-levenshtein": "^1.0.0",
"emoji-regex": "^6.1.0",
"jsx-ast-utils": "^1.4.0"
- }
- },
- "eslint-plugin-node": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz",
- "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==",
- "dev": true,
- "requires": {
- "ignore": "^3.3.6",
- "minimatch": "^3.0.4",
- "resolve": "^1.3.3",
- "semver": "^5.4.1"
+ },
+ "dependencies": {
+ "aria-query": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-0.7.1.tgz",
+ "integrity": "sha1-Jsu1r/ZBRLCoJb4YRuCxbPoAsR4=",
+ "dev": true,
+ "requires": {
+ "ast-types-flow": "0.0.7",
+ "commander": "^2.11.0"
+ }
+ },
+ "axobject-query": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-0.1.0.tgz",
+ "integrity": "sha1-YvWdvFnJ+SQnWco0mWDnov48NsA=",
+ "dev": true,
+ "requires": {
+ "ast-types-flow": "0.0.7"
+ }
+ },
+ "jsx-ast-utils": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz",
+ "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=",
+ "dev": true
+ }
}
},
"eslint-plugin-react": {
@@ -7641,15 +7609,6 @@
"prop-types": "^15.6.0"
},
"dependencies": {
- "jsx-ast-utils": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
- "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
- "dev": true,
- "requires": {
- "array-includes": "^3.0.3"
- }
- },
"prop-types": {
"version": "15.6.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz",
@@ -7662,27 +7621,6 @@
}
}
},
- "eslint-plugin-wordpress": {
- "version": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1",
- "from": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1",
- "dev": true,
- "requires": {
- "eslint-plugin-i18n": "~1.2.0",
- "eslint-plugin-jsdoc": "~3.5.0",
- "eslint-plugin-node": "~6.0.1",
- "eslint-plugin-wpcalypso": "~4.0.1",
- "merge": "~1.2.0"
- }
- },
- "eslint-plugin-wpcalypso": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-wpcalypso/-/eslint-plugin-wpcalypso-4.0.1.tgz",
- "integrity": "sha512-fU5NSc0XGdel/tlEIUoESOdqphBWQN2FfSgXXNHpXKX7ftTcqXacqgzXU8OVziyhXz6s2RUzK0+JSJaNxhZ+Mw==",
- "dev": true,
- "requires": {
- "requireindex": "^1.1.0"
- }
- },
"eslint-scope": {
"version": "3.7.3",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz",
@@ -7942,15 +7880,15 @@
}
},
"expect": {
- "version": "23.4.0",
- "resolved": "https://registry.npmjs.org/expect/-/expect-23.4.0.tgz",
- "integrity": "sha1-baTsyZwUcSU+cogziYOtHrrbYMM=",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/expect/-/expect-23.6.0.tgz",
+ "integrity": "sha512-dgSoOHgmtn/aDGRVFWclQyPDKl2CQRq0hmIEoUAuQs/2rn2NcvCWcSCovm6BLeuB/7EZuLGu2QfnR+qRt5OM4w==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.0",
- "jest-diff": "^23.2.0",
+ "jest-diff": "^23.6.0",
"jest-get-type": "^22.1.0",
- "jest-matcher-utils": "^23.2.0",
+ "jest-matcher-utils": "^23.6.0",
"jest-message-util": "^23.4.0",
"jest-regex-util": "^23.3.0"
},
@@ -8000,14 +7938,14 @@
}
},
"jest-matcher-utils": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.2.0.tgz",
- "integrity": "sha1-TUmB8jIT6Tnjzt8j3DTHR7WuGRM=",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz",
+ "integrity": "sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog==",
"dev": true,
"requires": {
"chalk": "^2.0.1",
"jest-get-type": "^22.1.0",
- "pretty-format": "^23.2.0"
+ "pretty-format": "^23.6.0"
}
},
"jest-message-util": {
@@ -8054,9 +7992,9 @@
}
},
"pretty-format": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.2.0.tgz",
- "integrity": "sha1-OwqqY8AYpTWDNzwcs6XZbMXoMBc=",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz",
+ "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==",
"dev": true,
"requires": {
"ansi-regex": "^3.0.0",
@@ -8066,9 +8004,9 @@
}
},
"expect-puppeteer": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/expect-puppeteer/-/expect-puppeteer-3.2.0.tgz",
- "integrity": "sha1-tMMi4ouG6edPXG1jb7Hg3eXEpVk=",
+ "version": "3.5.1",
+ "resolved": "https://registry.npmjs.org/expect-puppeteer/-/expect-puppeteer-3.5.1.tgz",
+ "integrity": "sha512-SB5JeJCXWSRcUK39fBJlCA6qnVt3BG1/M9vYZ+XYq8gY9jab9Jm4BztsrAwDTWca1L+O/7dRYrG2BPziRtjh+Q==",
"dev": true
},
"express": {
@@ -8564,14 +8502,15 @@
}
},
"find-process": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/find-process/-/find-process-1.1.1.tgz",
- "integrity": "sha1-V/sa28f0MEeG23IKSf69cIoxYtQ=",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/find-process/-/find-process-1.2.1.tgz",
+ "integrity": "sha512-z4RXYStNAcoi4+smpKbzJXbMT8DdvwqTE7wL7DWZMD0SkTRfQ49z9S7YaK24kuRseKr23YSZlnyL/TaJZtgM1g==",
"dev": true,
"requires": {
"chalk": "^2.0.1",
"commander": "^2.11.0",
- "debug": "^2.6.8"
+ "debug": "^2.6.8",
+ "lodash": "^4.17.11"
},
"dependencies": {
"debug": {
@@ -8582,6 +8521,12 @@
"requires": {
"ms": "2.0.0"
}
+ },
+ "lodash": {
+ "version": "4.17.11",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
+ "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
+ "dev": true
}
}
},
@@ -11059,23 +11004,45 @@
"dev": true
},
"istanbul-api": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.1.tgz",
- "integrity": "sha512-duj6AlLcsWNwUpfyfHt0nWIeRiZpuShnP40YTxOGQgtaN8fd6JYSxsvxUphTDy8V5MfDXo4s/xVCIIvVCO808g==",
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.7.tgz",
+ "integrity": "sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA==",
"dev": true,
"requires": {
"async": "^2.1.4",
- "compare-versions": "^3.1.0",
"fileset": "^2.0.2",
- "istanbul-lib-coverage": "^1.2.0",
- "istanbul-lib-hook": "^1.2.0",
- "istanbul-lib-instrument": "^1.10.1",
- "istanbul-lib-report": "^1.1.4",
- "istanbul-lib-source-maps": "^1.2.4",
- "istanbul-reports": "^1.3.0",
+ "istanbul-lib-coverage": "^1.2.1",
+ "istanbul-lib-hook": "^1.2.2",
+ "istanbul-lib-instrument": "^1.10.2",
+ "istanbul-lib-report": "^1.1.5",
+ "istanbul-lib-source-maps": "^1.2.6",
+ "istanbul-reports": "^1.5.1",
"js-yaml": "^3.7.0",
"mkdirp": "^0.5.1",
"once": "^1.4.0"
+ },
+ "dependencies": {
+ "istanbul-lib-coverage": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz",
+ "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==",
+ "dev": true
+ },
+ "istanbul-lib-instrument": {
+ "version": "1.10.2",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz",
+ "integrity": "sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A==",
+ "dev": true,
+ "requires": {
+ "babel-generator": "^6.18.0",
+ "babel-template": "^6.16.0",
+ "babel-traverse": "^6.18.0",
+ "babel-types": "^6.18.0",
+ "babylon": "^6.18.0",
+ "istanbul-lib-coverage": "^1.2.1",
+ "semver": "^5.3.0"
+ }
+ }
}
},
"istanbul-lib-coverage": {
@@ -11085,12 +11052,12 @@
"dev": true
},
"istanbul-lib-hook": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz",
- "integrity": "sha512-eLAMkPG9FU0v5L02lIkcj/2/Zlz9OuluaXikdr5iStk8FDbSwAixTK9TkYxbF0eNnzAJTwM2fkV2A1tpsIp4Jg==",
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz",
+ "integrity": "sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw==",
"dev": true,
"requires": {
- "append-transform": "^1.0.0"
+ "append-transform": "^0.4.0"
}
},
"istanbul-lib-instrument": {
@@ -11109,12 +11076,12 @@
}
},
"istanbul-lib-report": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz",
- "integrity": "sha512-Azqvq5tT0U09nrncK3q82e/Zjkxa4tkFZv7E6VcqP0QCPn6oNljDPfrZEC/umNXds2t7b8sRJfs6Kmpzt8m2kA==",
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz",
+ "integrity": "sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw==",
"dev": true,
"requires": {
- "istanbul-lib-coverage": "^1.2.0",
+ "istanbul-lib-coverage": "^1.2.1",
"mkdirp": "^0.5.1",
"path-parse": "^1.0.5",
"supports-color": "^3.1.2"
@@ -11126,6 +11093,12 @@
"integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
"dev": true
},
+ "istanbul-lib-coverage": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz",
+ "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==",
+ "dev": true
+ },
"supports-color": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
@@ -11138,22 +11111,30 @@
}
},
"istanbul-lib-source-maps": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz",
- "integrity": "sha512-8O2T/3VhrQHn0XcJbP1/GN7kXMiRAlPi+fj3uEHrjBD8Oz7Py0prSC25C09NuAZS6bgW1NNKAvCSHZXB0irSGA==",
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz",
+ "integrity": "sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg==",
"dev": true,
"requires": {
"debug": "^3.1.0",
- "istanbul-lib-coverage": "^1.2.0",
+ "istanbul-lib-coverage": "^1.2.1",
"mkdirp": "^0.5.1",
"rimraf": "^2.6.1",
"source-map": "^0.5.3"
+ },
+ "dependencies": {
+ "istanbul-lib-coverage": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz",
+ "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==",
+ "dev": true
+ }
}
},
"istanbul-reports": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.3.0.tgz",
- "integrity": "sha512-y2Z2IMqE1gefWUaVjrBm0mSKvUkaBy9Vqz8iwr/r40Y9hBbIteH5wqHG/9DLTfJ9xUnUT2j7A3+VVJ6EaYBllA==",
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.5.1.tgz",
+ "integrity": "sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw==",
"dev": true,
"requires": {
"handlebars": "^4.0.3"
@@ -11181,13 +11162,13 @@
}
},
"jest": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/jest/-/jest-23.4.2.tgz",
- "integrity": "sha512-w10HGpVFWT1oN8B2coxeiMEsZoggkDaw3i26xHGLU+rsR+LYkBk8qpZCgi+1cD1S6ttPjZDL8E8M99lmNhgTeA==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest/-/jest-23.6.0.tgz",
+ "integrity": "sha512-lWzcd+HSiqeuxyhG+EnZds6iO3Y3ZEnMrfZq/OTGvF/C+Z4fPMCdhWTGSAiO2Oym9rbEXfwddHhh6jqrTF3+Lw==",
"dev": true,
"requires": {
"import-local": "^1.0.0",
- "jest-cli": "^23.4.2"
+ "jest-cli": "^23.6.0"
},
"dependencies": {
"arr-diff": {
@@ -11235,9 +11216,9 @@
}
},
"jest-cli": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-23.4.2.tgz",
- "integrity": "sha512-vaDzy0wRWrgSfz4ZImCqD2gtZqCSoEWp60y3USvGDxA2b4K0rGj2voru6a5scJFjDx5GCiNWKpz2E8IdWDVjdw==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-23.6.0.tgz",
+ "integrity": "sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ==",
"dev": true,
"requires": {
"ansi-escapes": "^3.0.0",
@@ -11252,18 +11233,18 @@
"istanbul-lib-instrument": "^1.10.1",
"istanbul-lib-source-maps": "^1.2.4",
"jest-changed-files": "^23.4.2",
- "jest-config": "^23.4.2",
+ "jest-config": "^23.6.0",
"jest-environment-jsdom": "^23.4.0",
"jest-get-type": "^22.1.0",
- "jest-haste-map": "^23.4.1",
+ "jest-haste-map": "^23.6.0",
"jest-message-util": "^23.4.0",
"jest-regex-util": "^23.3.0",
- "jest-resolve-dependencies": "^23.4.2",
- "jest-runner": "^23.4.2",
- "jest-runtime": "^23.4.2",
- "jest-snapshot": "^23.4.2",
+ "jest-resolve-dependencies": "^23.6.0",
+ "jest-runner": "^23.6.0",
+ "jest-runtime": "^23.6.0",
+ "jest-snapshot": "^23.6.0",
"jest-util": "^23.4.0",
- "jest-validate": "^23.4.0",
+ "jest-validate": "^23.6.0",
"jest-watcher": "^23.4.0",
"jest-worker": "^23.2.0",
"micromatch": "^2.3.11",
@@ -11362,7 +11343,7 @@
},
"yargs": {
"version": "11.1.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz",
+ "resolved": "http://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz",
"integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==",
"dev": true,
"requires": {
@@ -11401,24 +11382,25 @@
}
},
"jest-config": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-23.4.2.tgz",
- "integrity": "sha512-CDJGO4H+7P+T6khaSHEjTxqVaIlmQMEFAyJFOVrAQeM+Xn12iZ+YY8Pluk1RDxi8Jqj9DoE09PHQzASCGePGtg==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-23.6.0.tgz",
+ "integrity": "sha512-i8V7z9BeDXab1+VNo78WM0AtWpBRXJLnkT+lyT+Slx/cbP5sZJ0+NDuLcmBE5hXAoK0aUp7vI+MOxR+R4d8SRQ==",
"dev": true,
"requires": {
"babel-core": "^6.0.0",
- "babel-jest": "^23.4.2",
+ "babel-jest": "^23.6.0",
"chalk": "^2.0.1",
"glob": "^7.1.1",
"jest-environment-jsdom": "^23.4.0",
"jest-environment-node": "^23.4.0",
"jest-get-type": "^22.1.0",
- "jest-jasmine2": "^23.4.2",
+ "jest-jasmine2": "^23.6.0",
"jest-regex-util": "^23.3.0",
- "jest-resolve": "^23.4.1",
+ "jest-resolve": "^23.6.0",
"jest-util": "^23.4.0",
- "jest-validate": "^23.4.0",
- "pretty-format": "^23.2.0"
+ "jest-validate": "^23.6.0",
+ "micromatch": "^2.3.11",
+ "pretty-format": "^23.6.0"
},
"dependencies": {
"arr-diff": {
@@ -11584,55 +11566,60 @@
"parse-glob": "^3.0.4",
"regex-cache": "^0.4.2"
}
- },
- "pretty-format": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.2.0.tgz",
- "integrity": "sha1-OwqqY8AYpTWDNzwcs6XZbMXoMBc=",
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0",
- "ansi-styles": "^3.2.0"
- }
}
}
},
"jest-dev-server": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/jest-dev-server/-/jest-dev-server-3.2.0.tgz",
- "integrity": "sha1-Gf5g7hVgyv/E8W9In680R52c28Y=",
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/jest-dev-server/-/jest-dev-server-3.6.0.tgz",
+ "integrity": "sha512-UbDPDBjpD3t9hjZ6z4j1NW8+jYE1rP5jJ6qVLbWsnpPgfJDBziOhhUSspSvyCG3DW+txK8/Xtw1lwwiEponWpg==",
"dev": true,
"requires": {
"chalk": "^2.4.1",
"cwd": "^0.10.0",
- "find-process": "^1.1.1",
- "inquirer": "^6.0.0",
- "spawnd": "^2.0.0",
- "terminate": "^2.1.0",
+ "find-process": "^1.2.1",
+ "inquirer": "^6.2.0",
+ "spawnd": "^3.5.2",
+ "terminate": "^2.1.2",
"wait-port": "^0.2.2"
},
"dependencies": {
+ "ansi-regex": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz",
+ "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==",
+ "dev": true
+ },
"chardet": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.5.0.tgz",
- "integrity": "sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g==",
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
+ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
"dev": true
},
"external-editor": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.0.tgz",
- "integrity": "sha512-mpkfj0FEdxrIhOC04zk85X7StNtr0yXnG7zCb+8ikO8OJi2jsHh5YGoknNTyXgsbHOf1WOOcVU3kPFWT2WgCkQ==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz",
+ "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==",
"dev": true,
"requires": {
- "chardet": "^0.5.0",
- "iconv-lite": "^0.4.22",
+ "chardet": "^0.7.0",
+ "iconv-lite": "^0.4.24",
"tmp": "^0.0.33"
}
},
+ "iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
+ "requires": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ }
+ },
"inquirer": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.0.0.tgz",
- "integrity": "sha512-tISQWRwtcAgrz+SHPhTH7d3e73k31gsOy6i1csonLc0u1dVK/wYvuOnFeiWqC5OXFIYbmrIFInef31wbT8MEJg==",
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz",
+ "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==",
"dev": true,
"requires": {
"ansi-escapes": "^3.0.0",
@@ -11641,48 +11628,45 @@
"cli-width": "^2.0.0",
"external-editor": "^3.0.0",
"figures": "^2.0.0",
- "lodash": "^4.3.0",
+ "lodash": "^4.17.10",
"mute-stream": "0.0.7",
"run-async": "^2.2.0",
"rxjs": "^6.1.0",
"string-width": "^2.1.0",
- "strip-ansi": "^4.0.0",
+ "strip-ansi": "^5.0.0",
"through": "^2.3.6"
}
},
"rxjs": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.2.tgz",
- "integrity": "sha512-0MI8+mkKAXZUF9vMrEoPnaoHkfzBPP4IGwUYRJhIRJF6/w3uByO1e91bEHn8zd43RdkTMKiooYKmwz7RH6zfOQ==",
+ "version": "6.3.3",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz",
+ "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
+ },
+ "strip-ansi": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz",
+ "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^4.0.0"
+ }
}
}
},
"jest-diff": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-23.2.0.tgz",
- "integrity": "sha1-nyz0tR4Sx5FVAgCrwWtHEwrxBio=",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-23.6.0.tgz",
+ "integrity": "sha512-Gz9l5Ov+X3aL5L37IT+8hoCUsof1CVYBb2QEkOupK64XyRR3h+uRpYIm97K7sY8diFxowR8pIGEdyfMKTixo3g==",
"dev": true,
"requires": {
"chalk": "^2.0.1",
"diff": "^3.2.0",
"jest-get-type": "^22.1.0",
- "pretty-format": "^23.2.0"
- },
- "dependencies": {
- "pretty-format": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.2.0.tgz",
- "integrity": "sha1-OwqqY8AYpTWDNzwcs6XZbMXoMBc=",
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0",
- "ansi-styles": "^3.2.0"
- }
- }
+ "pretty-format": "^23.6.0"
}
},
"jest-docblock": {
@@ -11695,31 +11679,19 @@
}
},
"jest-each": {
- "version": "23.4.0",
- "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-23.4.0.tgz",
- "integrity": "sha1-L6nt2J2qGk7cn/m/YGKja3E0UUM=",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-23.6.0.tgz",
+ "integrity": "sha512-x7V6M/WGJo6/kLoissORuvLIeAoyo2YqLOoCDkohgJ4XOXSqOtyvr8FbInlAWS77ojBsZrafbozWoKVRdtxFCg==",
"dev": true,
"requires": {
"chalk": "^2.0.1",
- "pretty-format": "^23.2.0"
- },
- "dependencies": {
- "pretty-format": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.2.0.tgz",
- "integrity": "sha1-OwqqY8AYpTWDNzwcs6XZbMXoMBc=",
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0",
- "ansi-styles": "^3.2.0"
- }
- }
+ "pretty-format": "^23.6.0"
}
},
"jest-environment-enzyme": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/jest-environment-enzyme/-/jest-environment-enzyme-6.0.2.tgz",
- "integrity": "sha1-iQUmYi1d6KggoYSdJoTwO8AG4O8=",
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/jest-environment-enzyme/-/jest-environment-enzyme-6.1.2.tgz",
+ "integrity": "sha512-WHeBKgBYOdryuOTEoK55lJwjg7Raery1OgXHLwukI3mSYgOkm2UrCDDT+vneqVgy7F8KuRHyStfD+TC/m2b7Kg==",
"dev": true,
"requires": {
"jest-environment-jsdom": "^22.4.1"
@@ -11727,7 +11699,7 @@
},
"jest-environment-jsdom": {
"version": "22.4.3",
- "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-22.4.3.tgz",
+ "resolved": "http://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-22.4.3.tgz",
"integrity": "sha512-FviwfR+VyT3Datf13+ULjIMO5CSeajlayhhYQwpzgunswoaLIPutdbrnfUHEMyJCwvqQFaVtTmn9+Y8WCt6n1w==",
"dev": true,
"requires": {
@@ -11864,44 +11836,55 @@
}
},
"jest-environment-puppeteer": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/jest-environment-puppeteer/-/jest-environment-puppeteer-3.2.1.tgz",
- "integrity": "sha1-xS6aqY8HtS83hyHV8f8PAAxODp8=",
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/jest-environment-puppeteer/-/jest-environment-puppeteer-3.6.0.tgz",
+ "integrity": "sha512-3ULqgH6f+HRu53wxP0NDFb8uZFxn2+97tK4eZicktgst/zWpSJucEpbsVVNWk4cIHrPo79rYoUfomxnui/ndAg==",
"dev": true,
"requires": {
"chalk": "^2.4.1",
"cwd": "^0.10.0",
- "jest-dev-server": "^3.2.0",
- "lodash": "^4.17.10",
- "mkdirp": "^0.5.1",
- "rimraf": "^2.6.2"
+ "jest-dev-server": "^3.6.0",
+ "merge-deep": "^3.0.2"
}
},
"jest-enzyme": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/jest-enzyme/-/jest-enzyme-6.0.2.tgz",
- "integrity": "sha1-vEZBad5sLVBgLgK7yUZEYFB/spU=",
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/jest-enzyme/-/jest-enzyme-6.1.2.tgz",
+ "integrity": "sha512-+ds7r2ru3QkNJxelQ2tnC6d33pjUSsZHPD3v4TlnHlNMuGX3UKdxm5C46yZBvJICYBvIF+RFKBhLMM4evNM95Q==",
"dev": true,
"requires": {
- "enzyme-matchers": "^6.0.2",
+ "enzyme-matchers": "^6.1.2",
"enzyme-to-json": "^3.3.0",
- "jest-environment-enzyme": "^6.0.2"
+ "jest-environment-enzyme": "^6.1.2"
+ },
+ "dependencies": {
+ "enzyme-matchers": {
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/enzyme-matchers/-/enzyme-matchers-6.1.2.tgz",
+ "integrity": "sha512-cP9p+HMOZ1ZXQ+k2H4dCkxmTZzIvpEy5zv0ZjgoBl6D0U43v+bJGH5IeWHdIovCzgJ0dVcMCKJ6lNu83lYUCAA==",
+ "dev": true,
+ "requires": {
+ "circular-json-es6": "^2.0.1",
+ "deep-equal-ident": "^1.1.1"
+ }
+ }
}
},
"jest-get-type": {
"version": "22.4.3",
- "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz",
+ "resolved": "http://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz",
"integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==",
"dev": true
},
"jest-haste-map": {
- "version": "23.4.1",
- "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-23.4.1.tgz",
- "integrity": "sha512-PGQxOEGAfRbTyJkmZeOKkVSs+KVeWgG625p89KUuq+sIIchY5P8iPIIc+Hw2tJJPBzahU3qopw1kF/qyhDdNBw==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-23.6.0.tgz",
+ "integrity": "sha512-uyNhMyl6dr6HaXGHp8VF7cK6KpC6G9z9LiMNsst+rJIZ8l7wY0tk8qwjPmEghczojZ2/ZhtEdIabZ0OQRJSGGg==",
"dev": true,
"requires": {
"fb-watchman": "^2.0.0",
"graceful-fs": "^4.1.11",
+ "invariant": "^2.2.4",
"jest-docblock": "^23.2.0",
"jest-serializer": "^23.0.1",
"jest-worker": "^23.2.0",
@@ -11986,23 +11969,23 @@
}
},
"jest-jasmine2": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-23.4.2.tgz",
- "integrity": "sha512-MUoqn41XHMQe5u8QvRTH2HahpBNzImnnjS3pV/T7LvrCM6f2zfGdi1Pm+bRbFMLJROqR8VlK8HmsenL2WjrUIQ==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz",
+ "integrity": "sha512-pe2Ytgs1nyCs8IvsEJRiRTPC0eVYd8L/dXJGU08GFuBwZ4sYH/lmFDdOL3ZmvJR8QKqV9MFuwlsAi/EWkFUbsQ==",
"dev": true,
"requires": {
"babel-traverse": "^6.0.0",
"chalk": "^2.0.1",
"co": "^4.6.0",
- "expect": "^23.4.0",
+ "expect": "^23.6.0",
"is-generator-fn": "^1.0.0",
- "jest-diff": "^23.2.0",
- "jest-each": "^23.4.0",
- "jest-matcher-utils": "^23.2.0",
+ "jest-diff": "^23.6.0",
+ "jest-each": "^23.6.0",
+ "jest-matcher-utils": "^23.6.0",
"jest-message-util": "^23.4.0",
- "jest-snapshot": "^23.4.2",
+ "jest-snapshot": "^23.6.0",
"jest-util": "^23.4.0",
- "pretty-format": "^23.2.0"
+ "pretty-format": "^23.6.0"
},
"dependencies": {
"arr-diff": {
@@ -12049,17 +12032,6 @@
"is-extglob": "^1.0.0"
}
},
- "jest-matcher-utils": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.2.0.tgz",
- "integrity": "sha1-TUmB8jIT6Tnjzt8j3DTHR7WuGRM=",
- "dev": true,
- "requires": {
- "chalk": "^2.0.1",
- "jest-get-type": "^22.1.0",
- "pretty-format": "^23.2.0"
- }
- },
"jest-message-util": {
"version": "23.4.0",
"resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-23.4.0.tgz",
@@ -12119,16 +12091,6 @@
"regex-cache": "^0.4.2"
}
},
- "pretty-format": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.2.0.tgz",
- "integrity": "sha1-OwqqY8AYpTWDNzwcs6XZbMXoMBc=",
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0",
- "ansi-styles": "^3.2.0"
- }
- },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -12138,40 +12100,28 @@
}
},
"jest-leak-detector": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-23.2.0.tgz",
- "integrity": "sha1-wonZYdxjjxQ1fU75bgQx7MGqN30=",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz",
+ "integrity": "sha512-f/8zA04rsl1Nzj10HIyEsXvYlMpMPcy0QkQilVZDFOaPbv2ur71X5u2+C4ZQJGyV/xvVXtCCZ3wQ99IgQxftCg==",
"dev": true,
"requires": {
- "pretty-format": "^23.2.0"
- },
- "dependencies": {
- "pretty-format": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.2.0.tgz",
- "integrity": "sha1-OwqqY8AYpTWDNzwcs6XZbMXoMBc=",
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0",
- "ansi-styles": "^3.2.0"
- }
- }
+ "pretty-format": "^23.6.0"
}
},
"jest-matcher-utils": {
- "version": "22.4.3",
- "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-22.4.3.tgz",
- "integrity": "sha512-lsEHVaTnKzdAPR5t4B6OcxXo9Vy4K+kRRbG5gtddY8lBEC+Mlpvm1CJcsMESRjzUhzkz568exMV1hTB76nAKbA==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz",
+ "integrity": "sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog==",
"dev": true,
"requires": {
"chalk": "^2.0.1",
- "jest-get-type": "^22.4.3",
- "pretty-format": "^22.4.3"
+ "jest-get-type": "^22.1.0",
+ "pretty-format": "^23.6.0"
}
},
"jest-message-util": {
"version": "22.4.3",
- "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-22.4.3.tgz",
+ "resolved": "http://registry.npmjs.org/jest-message-util/-/jest-message-util-22.4.3.tgz",
"integrity": "sha512-iAMeKxhB3Se5xkSjU0NndLLCHtP4n+GtCqV0bISKA5dmOXQfEbdEmYiu2qpnWBDCQdEafNDDU6Q+l6oBMd/+BA==",
"dev": true,
"requires": {
@@ -12260,7 +12210,7 @@
},
"jest-mock": {
"version": "22.4.3",
- "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-22.4.3.tgz",
+ "resolved": "http://registry.npmjs.org/jest-mock/-/jest-mock-22.4.3.tgz",
"integrity": "sha512-+4R6mH5M1G4NK16CKg9N1DtCaFmuxhcIqF4lQK/Q1CIotqMs/XBemfpDPeVZBFow6iyUNu6EBT9ugdNOTT5o5Q==",
"dev": true
},
@@ -12281,9 +12231,9 @@
"dev": true
},
"jest-resolve": {
- "version": "23.4.1",
- "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-23.4.1.tgz",
- "integrity": "sha512-VNk4YRNR5gsHhNS0Lp46/DzTT11e+ecbUC61ikE593cKbtdrhrMO+zXkOJaE8YDD5sHxH9W6OfssNn4FkZBzZQ==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-23.6.0.tgz",
+ "integrity": "sha512-XyoRxNtO7YGpQDmtQCmZjum1MljDqUCob7XlZ6jy9gsMugHdN2hY4+Acz9Qvjz2mSsOnPSH7skBmDYCHXVZqkA==",
"dev": true,
"requires": {
"browser-resolve": "^1.11.3",
@@ -12292,30 +12242,30 @@
}
},
"jest-resolve-dependencies": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-23.4.2.tgz",
- "integrity": "sha512-JUrU1/1mQAf0eKwKT4+RRnaqcw0UcRzRE38vyO+YnqoXUVidf646iuaKE+NG7E6Gb0+EVPOJ6TgqkaTPdQz78A==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz",
+ "integrity": "sha512-EkQWkFWjGKwRtRyIwRwI6rtPAEyPWlUC2MpzHissYnzJeHcyCn1Hc8j7Nn1xUVrS5C6W5+ZL37XTem4D4pLZdA==",
"dev": true,
"requires": {
"jest-regex-util": "^23.3.0",
- "jest-snapshot": "^23.4.2"
+ "jest-snapshot": "^23.6.0"
}
},
"jest-runner": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-23.4.2.tgz",
- "integrity": "sha512-o+aEdDE7/Gyp8fLYEEf5B8aOUguz76AYcAMl5pueucey2Q50O8uUIXJ7zvt8O6OEJDztR3Kb+osMoh8MVIqgTw==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-23.6.0.tgz",
+ "integrity": "sha512-kw0+uj710dzSJKU6ygri851CObtCD9cN8aNkg8jWJf4ewFyEa6kwmiH/r/M1Ec5IL/6VFa0wnAk6w+gzUtjJzA==",
"dev": true,
"requires": {
"exit": "^0.1.2",
"graceful-fs": "^4.1.11",
- "jest-config": "^23.4.2",
+ "jest-config": "^23.6.0",
"jest-docblock": "^23.2.0",
- "jest-haste-map": "^23.4.1",
- "jest-jasmine2": "^23.4.2",
- "jest-leak-detector": "^23.2.0",
+ "jest-haste-map": "^23.6.0",
+ "jest-jasmine2": "^23.6.0",
+ "jest-leak-detector": "^23.6.0",
"jest-message-util": "^23.4.0",
- "jest-runtime": "^23.4.2",
+ "jest-runtime": "^23.6.0",
"jest-util": "^23.4.0",
"jest-worker": "^23.2.0",
"source-map-support": "^0.5.6",
@@ -12432,9 +12382,9 @@
"dev": true
},
"source-map-support": {
- "version": "0.5.6",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz",
- "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==",
+ "version": "0.5.9",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz",
+ "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
@@ -12444,9 +12394,9 @@
}
},
"jest-runtime": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-23.4.2.tgz",
- "integrity": "sha512-qaUDOi7tcdDe3MH5g5ycEslTpx0voPZvzIYbKjvWxCzCL2JEemLM+7IEe0BeLi2v5wvb/uh3dkb2wQI67uPtCw==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-23.6.0.tgz",
+ "integrity": "sha512-ycnLTNPT2Gv+TRhnAYAQ0B3SryEXhhRj1kA6hBPSeZaNQkJ7GbZsxOLUkwg6YmvWGdX3BB3PYKFLDQCAE1zNOw==",
"dev": true,
"requires": {
"babel-core": "^6.0.0",
@@ -12456,14 +12406,14 @@
"exit": "^0.1.2",
"fast-json-stable-stringify": "^2.0.0",
"graceful-fs": "^4.1.11",
- "jest-config": "^23.4.2",
- "jest-haste-map": "^23.4.1",
+ "jest-config": "^23.6.0",
+ "jest-haste-map": "^23.6.0",
"jest-message-util": "^23.4.0",
"jest-regex-util": "^23.3.0",
- "jest-resolve": "^23.4.1",
- "jest-snapshot": "^23.4.2",
+ "jest-resolve": "^23.6.0",
+ "jest-snapshot": "^23.6.0",
"jest-util": "^23.4.0",
- "jest-validate": "^23.4.0",
+ "jest-validate": "^23.6.0",
"micromatch": "^2.3.11",
"realpath-native": "^1.0.0",
"slash": "^1.0.0",
@@ -12627,7 +12577,7 @@
},
"yargs": {
"version": "11.1.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz",
+ "resolved": "http://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz",
"integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==",
"dev": true,
"requires": {
@@ -12663,20 +12613,20 @@
"dev": true
},
"jest-snapshot": {
- "version": "23.4.2",
- "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-23.4.2.tgz",
- "integrity": "sha512-rCBxIURDlVEW1gJgJSpo8l2F2gFwp9U7Yb3CmcABUpmQ8NASpb6LJkEvtcQifAYSi22OL44TSuanq1G6x1GJwg==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-23.6.0.tgz",
+ "integrity": "sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg==",
"dev": true,
"requires": {
"babel-types": "^6.0.0",
"chalk": "^2.0.1",
- "jest-diff": "^23.2.0",
- "jest-matcher-utils": "^23.2.0",
+ "jest-diff": "^23.6.0",
+ "jest-matcher-utils": "^23.6.0",
"jest-message-util": "^23.4.0",
- "jest-resolve": "^23.4.1",
+ "jest-resolve": "^23.6.0",
"mkdirp": "^0.5.1",
"natural-compare": "^1.4.0",
- "pretty-format": "^23.2.0",
+ "pretty-format": "^23.6.0",
"semver": "^5.5.0"
},
"dependencies": {
@@ -12724,17 +12674,6 @@
"is-extglob": "^1.0.0"
}
},
- "jest-matcher-utils": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.2.0.tgz",
- "integrity": "sha1-TUmB8jIT6Tnjzt8j3DTHR7WuGRM=",
- "dev": true,
- "requires": {
- "chalk": "^2.0.1",
- "jest-get-type": "^22.1.0",
- "pretty-format": "^23.2.0"
- }
- },
"jest-message-util": {
"version": "23.4.0",
"resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-23.4.0.tgz",
@@ -12777,22 +12716,12 @@
"parse-glob": "^3.0.4",
"regex-cache": "^0.4.2"
}
- },
- "pretty-format": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.2.0.tgz",
- "integrity": "sha1-OwqqY8AYpTWDNzwcs6XZbMXoMBc=",
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0",
- "ansi-styles": "^3.2.0"
- }
}
}
},
"jest-util": {
"version": "22.4.3",
- "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-22.4.3.tgz",
+ "resolved": "http://registry.npmjs.org/jest-util/-/jest-util-22.4.3.tgz",
"integrity": "sha512-rfDfG8wyC5pDPNdcnAlZgwKnzHvZDu8Td2NJI/jAGKEGxJPYiE4F0ss/gSAkG4778Y23Hvbz+0GMrDJTeo7RjQ==",
"dev": true,
"requires": {
@@ -12814,27 +12743,15 @@
}
},
"jest-validate": {
- "version": "23.4.0",
- "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-23.4.0.tgz",
- "integrity": "sha1-2W7t4B7wOskJwAnpyORVGX1IwgE=",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-23.6.0.tgz",
+ "integrity": "sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A==",
"dev": true,
"requires": {
"chalk": "^2.0.1",
"jest-get-type": "^22.1.0",
"leven": "^2.1.0",
- "pretty-format": "^23.2.0"
- },
- "dependencies": {
- "pretty-format": {
- "version": "23.2.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.2.0.tgz",
- "integrity": "sha1-OwqqY8AYpTWDNzwcs6XZbMXoMBc=",
- "dev": true,
- "requires": {
- "ansi-regex": "^3.0.0",
- "ansi-styles": "^3.2.0"
- }
- }
+ "pretty-format": "^23.6.0"
}
},
"jest-watcher": {
@@ -13213,10 +13130,13 @@
}
},
"jsx-ast-utils": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz",
- "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=",
- "dev": true
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
+ "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
+ "dev": true,
+ "requires": {
+ "array-includes": "^3.0.3"
+ }
},
"keyv": {
"version": "3.0.0",
@@ -13234,9 +13154,9 @@
"dev": true
},
"kleur": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.1.tgz",
- "integrity": "sha512-Zq/jyANIJ2uX8UZjWlqLwbyhcxSXJtT/Y89lClyeZd3l++3ztL1I5SSCYrbcbwSunTjC88N3WuMk0kRDQD6gzA==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.2.tgz",
+ "integrity": "sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ==",
"dev": true
},
"known-css-properties": {
@@ -13249,8 +13169,7 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
"integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=",
- "dev": true,
- "optional": true
+ "dev": true
},
"lcid": {
"version": "1.0.0",
@@ -13361,12 +13280,11 @@
}
},
"lint-staged": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-7.2.0.tgz",
- "integrity": "sha512-jPoIMbmgtWMUrz/l0rhBVa1j6H71zr0rEoxDWBA333PZcaqBvELdg0Sf4tdGHlwrBM0GXaXMVgTRkLTm2vA7Jg==",
+ "version": "7.3.0",
+ "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-7.3.0.tgz",
+ "integrity": "sha512-AXk40M9DAiPi7f4tdJggwuKIViUplYtVj1os1MVEteW7qOkU50EOehayCfO9TsoGK24o/EsWb41yrEgfJDDjCw==",
"dev": true,
"requires": {
- "app-root-path": "^2.0.1",
"chalk": "^2.3.1",
"commander": "^2.14.1",
"cosmiconfig": "^5.0.2",
@@ -13376,7 +13294,7 @@
"find-parent-dir": "^0.3.0",
"is-glob": "^4.0.0",
"is-windows": "^1.0.2",
- "jest-validate": "^23.0.0",
+ "jest-validate": "^23.5.0",
"listr": "^0.14.1",
"lodash": "^4.17.5",
"log-symbols": "^2.2.0",
@@ -13428,15 +13346,6 @@
"object-assign": "^4.1.0"
}
},
- "indent-string": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
- "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
- "dev": true,
- "requires": {
- "repeating": "^2.0.0"
- }
- },
"is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -13462,32 +13371,49 @@
}
},
"listr": {
- "version": "0.14.1",
- "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.1.tgz",
- "integrity": "sha512-MSMUUVN1f8aRnPi4034RkOqdiUlpYW+FqwFE3aL0uYNPRavkt2S2SsSpDDofn8BDpqv2RNnsdOcCHWsChcq77A==",
+ "version": "0.14.3",
+ "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz",
+ "integrity": "sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA==",
"dev": true,
"requires": {
"@samverschueren/stream-to-observable": "^0.3.0",
- "cli-truncate": "^0.2.1",
- "figures": "^1.7.0",
- "indent-string": "^2.1.0",
"is-observable": "^1.1.0",
"is-promise": "^2.1.0",
"is-stream": "^1.1.0",
"listr-silent-renderer": "^1.1.1",
- "listr-update-renderer": "^0.4.0",
- "listr-verbose-renderer": "^0.4.0",
+ "listr-update-renderer": "^0.5.0",
+ "listr-verbose-renderer": "^0.5.0",
+ "p-map": "^2.0.0",
+ "rxjs": "^6.3.3"
+ },
+ "dependencies": {
+ "p-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.0.0.tgz",
+ "integrity": "sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w==",
+ "dev": true
+ }
+ }
+ },
+ "listr-update-renderer": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz",
+ "integrity": "sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA==",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.1.3",
+ "cli-truncate": "^0.2.1",
+ "elegant-spinner": "^1.0.1",
+ "figures": "^1.7.0",
+ "indent-string": "^3.0.0",
"log-symbols": "^1.0.2",
- "log-update": "^1.0.2",
- "ora": "^0.2.3",
- "p-map": "^1.1.1",
- "rxjs": "^6.1.0",
+ "log-update": "^2.3.0",
"strip-ansi": "^3.0.1"
},
"dependencies": {
"chalk": {
"version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
@@ -13509,6 +13435,40 @@
}
}
},
+ "listr-verbose-renderer": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz",
+ "integrity": "sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.1",
+ "cli-cursor": "^2.1.0",
+ "date-fns": "^1.27.2",
+ "figures": "^2.0.0"
+ },
+ "dependencies": {
+ "figures": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
+ "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "^1.0.5"
+ }
+ }
+ }
+ },
+ "log-update": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz",
+ "integrity": "sha1-iDKP19HOeTiykoN0bwsbwSayRwg=",
+ "dev": true,
+ "requires": {
+ "ansi-escapes": "^3.0.0",
+ "cli-cursor": "^2.0.0",
+ "wrap-ansi": "^3.0.1"
+ }
+ },
"pify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
@@ -13516,9 +13476,9 @@
"dev": true
},
"rxjs": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.2.tgz",
- "integrity": "sha512-0MI8+mkKAXZUF9vMrEoPnaoHkfzBPP4IGwUYRJhIRJF6/w3uByO1e91bEHn8zd43RdkTMKiooYKmwz7RH6zfOQ==",
+ "version": "6.3.3",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz",
+ "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
@@ -13538,6 +13498,33 @@
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
+ },
+ "wrap-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz",
+ "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=",
+ "dev": true,
+ "requires": {
+ "string-width": "^2.1.1",
+ "strip-ansi": "^4.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^3.0.0"
+ }
+ }
+ }
}
}
},
@@ -13633,6 +13620,30 @@
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
+ },
+ "wrap-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz",
+ "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=",
+ "requires": {
+ "string-width": "^2.1.1",
+ "strip-ansi": "^4.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "requires": {
+ "ansi-regex": "^3.0.0"
+ }
+ }
+ }
}
}
},
@@ -14522,11 +14533,75 @@
}
},
"merge": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz",
- "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz",
+ "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==",
"dev": true
},
+ "merge-deep": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.2.tgz",
+ "integrity": "sha512-T7qC8kg4Zoti1cFd8Cr0M+qaZfOwjlPDEdZIIPPB2JZctjaPM4fX+i7HOId69tAti2fvO6X5ldfYUONDODsrkA==",
+ "dev": true,
+ "requires": {
+ "arr-union": "^3.1.0",
+ "clone-deep": "^0.2.4",
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "clone-deep": {
+ "version": "0.2.4",
+ "resolved": "http://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz",
+ "integrity": "sha1-TnPdCen7lxzDhnDF3O2cGJZIHMY=",
+ "dev": true,
+ "requires": {
+ "for-own": "^0.1.3",
+ "is-plain-object": "^2.0.1",
+ "kind-of": "^3.0.2",
+ "lazy-cache": "^1.0.3",
+ "shallow-clone": "^0.1.2"
+ }
+ },
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ },
+ "shallow-clone": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz",
+ "integrity": "sha1-WQnodLp3EG1zrEFM/sH/yofZcGA=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.1",
+ "kind-of": "^2.0.1",
+ "lazy-cache": "^0.2.3",
+ "mixin-object": "^2.0.1"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "2.0.1",
+ "resolved": "http://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz",
+ "integrity": "sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.0.2"
+ }
+ },
+ "lazy-cache": {
+ "version": "0.2.7",
+ "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz",
+ "integrity": "sha1-f+3fLctu23fRHvHRF6tf/fCrG2U=",
+ "dev": true
+ }
+ }
+ }
+ }
+ },
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
@@ -14586,9 +14661,9 @@
}
},
"mime": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz",
- "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==",
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz",
+ "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==",
"dev": true
},
"mime-db": {
@@ -14977,13 +15052,13 @@
}
},
"node-notifier": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz",
- "integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==",
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.3.0.tgz",
+ "integrity": "sha512-AhENzCSGZnZJgBARsUjnQ7DnZbzyP+HxlVXuD0xqAnvL8q+OqtSX7lGg9e8nHzwXkMMXNdVeqq4E2M3EUAqX6Q==",
"dev": true,
"requires": {
"growly": "^1.3.0",
- "semver": "^5.4.1",
+ "semver": "^5.5.0",
"shellwords": "^0.1.1",
"which": "^1.3.0"
}
@@ -14998,9 +15073,9 @@
}
},
"node-sass": {
- "version": "4.9.2",
- "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.9.2.tgz",
- "integrity": "sha512-LdxoJLZutx0aQXHtWIYwJKMj+9pTjneTcLWJgzf2XbGu0q5pRNqW5QvFCEdm3mc5rJOdru/mzln5d0EZLacf6g==",
+ "version": "4.11.0",
+ "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.11.0.tgz",
+ "integrity": "sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==",
"dev": true,
"requires": {
"async-foreach": "^0.1.3",
@@ -15016,14 +15091,26 @@
"meow": "^3.7.0",
"mkdirp": "^0.5.1",
"nan": "^2.10.0",
- "node-gyp": "^3.3.1",
+ "node-gyp": "^3.8.0",
"npmlog": "^4.0.0",
- "request": "2.87.0",
+ "request": "^2.88.0",
"sass-graph": "^2.2.4",
"stdout-stream": "^1.4.0",
"true-case-path": "^1.0.2"
},
"dependencies": {
+ "ajv": {
+ "version": "6.6.1",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.1.tgz",
+ "integrity": "sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^2.0.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
@@ -15036,6 +15123,12 @@
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
"dev": true
},
+ "aws4": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
+ "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==",
+ "dev": true
+ },
"camelcase": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
@@ -15075,6 +15168,28 @@
"which": "^1.2.9"
}
},
+ "extend": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
+ "dev": true
+ },
+ "fast-deep-equal": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
+ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
+ "dev": true
+ },
+ "har-validator": {
+ "version": "5.1.3",
+ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz",
+ "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
+ "dev": true,
+ "requires": {
+ "ajv": "^6.5.5",
+ "har-schema": "^2.0.0"
+ }
+ },
"indent-string": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
@@ -15084,15 +15199,11 @@
"repeating": "^2.0.0"
}
},
- "lru-cache": {
- "version": "4.1.3",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz",
- "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==",
- "dev": true,
- "requires": {
- "pseudomap": "^1.0.2",
- "yallist": "^2.1.2"
- }
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true
},
"map-obj": {
"version": "1.0.1",
@@ -15118,12 +15229,33 @@
"trim-newlines": "^1.0.0"
}
},
+ "mime-db": {
+ "version": "1.37.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz",
+ "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==",
+ "dev": true
+ },
+ "mime-types": {
+ "version": "2.1.21",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz",
+ "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==",
+ "dev": true,
+ "requires": {
+ "mime-db": "~1.37.0"
+ }
+ },
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
+ "oauth-sign": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
+ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==",
+ "dev": true
+ },
"redent": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
@@ -15134,6 +15266,34 @@
"strip-indent": "^1.0.1"
}
},
+ "request": {
+ "version": "2.88.0",
+ "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
+ "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
+ "dev": true,
+ "requires": {
+ "aws-sign2": "~0.7.0",
+ "aws4": "^1.8.0",
+ "caseless": "~0.12.0",
+ "combined-stream": "~1.0.6",
+ "extend": "~3.0.2",
+ "forever-agent": "~0.6.1",
+ "form-data": "~2.3.2",
+ "har-validator": "~5.1.0",
+ "http-signature": "~1.2.0",
+ "is-typedarray": "~1.0.0",
+ "isstream": "~0.1.2",
+ "json-stringify-safe": "~5.0.1",
+ "mime-types": "~2.1.19",
+ "oauth-sign": "~0.9.0",
+ "performance-now": "^2.1.0",
+ "qs": "~6.5.2",
+ "safe-buffer": "^5.1.2",
+ "tough-cookie": "~2.4.3",
+ "tunnel-agent": "^0.6.0",
+ "uuid": "^3.3.2"
+ }
+ },
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
@@ -16253,6 +16413,12 @@
"find-up": "^2.1.0"
}
},
+ "platform": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.5.tgz",
+ "integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==",
+ "dev": true
+ },
"please-upgrade-node": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz",
@@ -17400,9 +17566,9 @@
"dev": true
},
"pretty-format": {
- "version": "22.4.3",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-22.4.3.tgz",
- "integrity": "sha512-S4oT9/sT6MN7/3COoOy+ZJeA92VmOnveLHgrwBE3Z1W5N9S2A1QGNYiE1z75DAENbJrXXUb+OWXhpJcg05QKQQ==",
+ "version": "23.6.0",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz",
+ "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==",
"dev": true,
"requires": {
"ansi-regex": "^3.0.0",
@@ -17533,12 +17699,12 @@
"dev": true
},
"ps-tree": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
- "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz",
+ "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==",
"dev": true,
"requires": {
- "event-stream": "~3.3.0"
+ "event-stream": "=3.3.4"
}
},
"pseudomap": {
@@ -17652,11 +17818,6 @@
"integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=",
"dev": true
},
- "querystringify": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz",
- "integrity": "sha1-YoYkIRLFtxL6ZU5SZlK/ahP/Bcs="
- },
"quick-lru": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
@@ -18156,9 +18317,9 @@
}
},
"realpath-native": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.1.tgz",
- "integrity": "sha512-W14EcXuqUvKP8dkWkD7B95iMy77lpMnlFXbbk409bQtNCbeu0kvRE5reo+yIZ3JXxg6frbGsz2DLQ39lrCB40g==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.2.tgz",
+ "integrity": "sha512-+S3zTvVt9yTntFrBpm7TQmQ3tzpCrnA1a/y+3cUHAc9ZR6aIjG0WNLR+Rj79QpJktY+VeW/TQtFlQ1bzsehI8g==",
"dev": true,
"requires": {
"util.promisify": "^1.0.0"
@@ -19173,6 +19334,24 @@
}
}
},
+ "shallow-equal": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-1.0.0.tgz",
+ "integrity": "sha1-UI0YOLPeWQq4dXsBGyXkMJAJRfc=",
+ "dev": true
+ },
+ "shallow-equals": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/shallow-equals/-/shallow-equals-1.0.0.tgz",
+ "integrity": "sha1-JLdL8cY0wR7Uxxgqbfb7MA3OQ5A=",
+ "dev": true
+ },
+ "shallowequal": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz",
+ "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==",
+ "dev": true
+ },
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
@@ -19494,14 +19673,14 @@
"dev": true
},
"spawnd": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/spawnd/-/spawnd-2.0.0.tgz",
- "integrity": "sha1-0gIEA9xe9y7Kw/+rm0L6Fq6RdfU=",
+ "version": "3.5.2",
+ "resolved": "https://registry.npmjs.org/spawnd/-/spawnd-3.5.2.tgz",
+ "integrity": "sha512-taf6nYLIl8b3b1RNt0YuxnIUUgHqfx+nix8Rdr2FkNG8259+Jt8YJahrPDShOPa9vCMnDPfPsefRAY/oJy+QBg==",
"dev": true,
"requires": {
"exit": "^0.1.2",
"signal-exit": "^3.0.2",
- "terminate": "^2.1.0",
+ "terminate": "^2.1.2",
"wait-port": "^0.2.2"
}
},
@@ -19653,9 +19832,9 @@
"dev": true
},
"stdout-stream": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.0.tgz",
- "integrity": "sha1-osfIWH5U2UJ+qe2zrD8s1SLfN4s=",
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz",
+ "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==",
"dev": true,
"requires": {
"readable-stream": "^2.0.1"
@@ -20329,12 +20508,6 @@
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=",
"dev": true
},
- "symlink-or-copy": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/symlink-or-copy/-/symlink-or-copy-1.2.0.tgz",
- "integrity": "sha512-W31+GLiBmU/ZR02Ii0mVZICuNEN9daZ63xZMPDsYgPgNjMtg+atqLEGI7PPI936jYSQZxoLb/63xos8Adrx4Eg==",
- "dev": true
- },
"table": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz",
@@ -20447,12 +20620,12 @@
}
},
"terminate": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/terminate/-/terminate-2.1.0.tgz",
- "integrity": "sha1-qH7kJL4BodKPLzAQRQQ6W81nmgU=",
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/terminate/-/terminate-2.1.2.tgz",
+ "integrity": "sha512-ltKc9MkgcRe7gzD7XSttHCF1feKM1pTkCdb58jFVWk1efPN9JIk/BHSlOaYF+hCcWoubeJQ8C8Phb0++fa6iNQ==",
"dev": true,
"requires": {
- "ps-tree": "^1.1.0"
+ "ps-tree": "^1.1.1"
}
},
"test-exclude": {
@@ -20702,27 +20875,12 @@
"dev": true
},
"true-case-path": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.2.tgz",
- "integrity": "sha1-fskRMJJHZsf1c74wIMNPj9/QDWI=",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz",
+ "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==",
"dev": true,
"requires": {
- "glob": "^6.0.4"
- },
- "dependencies": {
- "glob": {
- "version": "6.0.4",
- "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
- "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=",
- "dev": true,
- "requires": {
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "2 || 3",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- }
+ "glob": "^7.1.2"
}
},
"tryer": {
diff --git a/package.json b/package.json
index fba02b0a957f67..15e713f80c20d3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "4.4.0",
+ "version": "4.7.0",
"private": true,
"description": "A new WordPress editor experience",
"repository": "git+https://github.com/WordPress/gutenberg.git",
@@ -10,10 +10,6 @@
"WordPress",
"editor"
],
- "engines": {
- "node": ">=8.0.0",
- "npm": ">=6.0.0"
- },
"dependencies": {
"@wordpress/a11y": "file:packages/a11y",
"@wordpress/annotations": "file:packages/annotations",
@@ -42,6 +38,7 @@
"@wordpress/i18n": "file:packages/i18n",
"@wordpress/is-shallow-equal": "file:packages/is-shallow-equal",
"@wordpress/keycodes": "file:packages/keycodes",
+ "@wordpress/list-reusable-blocks": "file:packages/list-reusable-blocks",
"@wordpress/notices": "file:packages/notices",
"@wordpress/nux": "file:packages/nux",
"@wordpress/plugins": "file:packages/plugins",
@@ -55,58 +52,62 @@
},
"devDependencies": {
"@babel/core": "7.0.0",
+ "@babel/plugin-syntax-jsx": "7.0.0",
"@babel/runtime-corejs2": "7.0.0",
+ "@babel/traverse": "7.0.0",
"@wordpress/babel-plugin-import-jsx-pragma": "file:packages/babel-plugin-import-jsx-pragma",
"@wordpress/babel-plugin-makepot": "file:packages/babel-plugin-makepot",
"@wordpress/babel-preset-default": "file:packages/babel-preset-default",
"@wordpress/browserslist-config": "file:packages/browserslist-config",
"@wordpress/custom-templated-path-webpack-plugin": "file:packages/custom-templated-path-webpack-plugin",
+ "@wordpress/eslint-plugin": "file:packages/eslint-plugin",
"@wordpress/jest-console": "file:packages/jest-console",
"@wordpress/jest-preset-default": "file:packages/jest-preset-default",
"@wordpress/library-export-default-webpack-plugin": "file:packages/library-export-default-webpack-plugin",
"@wordpress/npm-package-json-lint-config": "file:packages/npm-package-json-lint-config",
"@wordpress/postcss-themes": "file:packages/postcss-themes",
"@wordpress/scripts": "file:packages/scripts",
- "autoprefixer": "8.2.0",
"babel-loader": "8.0.0",
+ "benchmark": "2.1.4",
+ "browserslist": "3.2.8",
"chalk": "2.4.1",
- "check-node-version": "3.1.1",
"concurrently": "3.5.0",
"copy-webpack-plugin": "4.5.2",
"core-js": "2.5.7",
"cross-env": "3.2.4",
"cssnano": "4.0.3",
+ "enzyme": "3.7.0",
"deasync": "0.1.13",
"deep-freeze": "0.0.1",
"doctrine": "2.1.0",
- "eslint-config-wordpress": "2.0.0",
"eslint-plugin-jest": "21.5.0",
- "eslint-plugin-jsx-a11y": "6.0.2",
- "eslint-plugin-react": "7.7.0",
- "eslint-plugin-wordpress": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1",
"espree": "3.5.4",
+ "fbjs": "0.8.17",
"glob": "7.1.2",
"husky": "0.14.3",
+ "is-plain-obj": "1.1.0",
+ "is-equal-shallow": "0.1.3",
"jest-puppeteer": "3.2.1",
+ "jsdom": "11.12.0",
"lerna": "3.4.3",
- "lint-staged": "7.2.0",
+ "lint-staged": "7.3.0",
"lodash": "4.17.10",
"mkdirp": "0.5.1",
- "node-sass": "4.9.2",
- "path-type": "3.0.0",
+ "node-sass": "4.11.0",
"pegjs": "0.10.0",
"phpegjs": "1.0.0-beta7",
- "postcss-color-function": "4.0.1",
- "puppeteer": "1.6.1",
+ "react-dom": "16.6.3",
"react-test-renderer": "16.6.3",
+ "redux": "4.0.0",
"rimraf": "2.6.2",
"rtlcss": "2.4.0",
"sass-loader": "6.0.7",
- "source-map-loader": "0.2.3",
+ "shallow-equal": "1.0.0",
+ "shallow-equals": "1.0.0",
+ "shallowequal": "1.1.0",
"sprintf-js": "1.1.1",
- "stylelint": "9.5.0",
+ "source-map-loader": "0.2.3",
"stylelint-config-wordpress": "13.1.0",
- "symlink-or-copy": "1.2.0",
"uuid": "3.3.2",
"webpack": "4.8.3",
"webpack-bundle-analyzer": "3.0.2",
@@ -147,7 +148,7 @@
"prebuild:packages": "npm run clean:packages && lerna run build && cross-env INCLUDE_PACKAGES=babel-plugin-import-jsx-pragma,postcss-themes,jest-console SKIP_JSX_PRAGMA_TRANSFORM=1 node ./bin/packages/build.js",
"build:packages": "cross-env EXCLUDE_PACKAGES=babel-plugin-import-jsx-pragma,jest-console,postcss-themes node ./bin/packages/build.js",
"build": "npm run build:packages && cross-env NODE_ENV=production webpack",
- "check-engines": "check-node-version --package",
+ "check-engines": "wp-scripts check-engines",
"check-licenses": "concurrently \"wp-scripts check-licenses --prod --gpl2\" \"wp-scripts check-licenses --dev\"",
"precheck-local-changes": "npm run docs:build",
"check-local-changes": "( git diff -U0 | xargs -0 node bin/process-git-diff ) || ( echo \"There are local uncommitted changes after one or both of 'npm install' or 'npm run docs:build'!\" && exit 1 );",
@@ -162,11 +163,11 @@
"fixtures:regenerate": "npm run fixtures:clean && npm run fixtures:generate",
"lint": "concurrently \"npm run lint-js\" \"npm run lint-pkg-json\" \"npm run lint-css\"",
"lint-js": "wp-scripts lint-js .",
- "lint-js:fix": "wp-scripts lint-js . --fix",
+ "lint-js:fix": "npm run lint-js -- --fix",
"lint-php": "docker-compose run --rm composer run-script lint",
"lint-pkg-json": "wp-scripts lint-pkg-json ./packages",
- "lint-css": "stylelint '**/*.scss'",
- "lint-css:fix": "stylelint '**/*.scss' --fix",
+ "lint-css": "wp-scripts lint-style '**/*.scss'",
+ "lint-css:fix": "npm run lint-css -- --fix",
"package-plugin": "./bin/build-plugin-zip.sh",
"postinstall": "npm run check-licenses && npm run build:packages",
"pot-to-php": "./bin/pot-to-php.js",
@@ -176,7 +177,7 @@
"publish:prod": "npm run build:packages && lerna publish",
"test": "npm run lint && npm run test-unit",
"pretest-e2e": "concurrently \"./bin/reset-e2e-tests.sh\" \"npm run build\"",
- "test-e2e": "cross-env JEST_PUPPETEER_CONFIG=test/e2e/puppeteer.config.js wp-scripts test-unit-js --config test/e2e/jest.config.json --runInBand",
+ "test-e2e": "wp-scripts test-e2e --config test/e2e/jest.config.json",
"test-e2e:watch": "npm run test-e2e -- --watch",
"test-php": "npm run lint-php && npm run test-unit-php",
"test-unit": "wp-scripts test-unit-js --config test/unit/jest.config.json",
@@ -191,7 +192,7 @@
"wp-scripts lint-pkg-json"
],
"*.scss": [
- "stylelint"
+ "wp-scripts lint-style"
],
"*.js": [
"wp-scripts lint-js"
diff --git a/packages/annotations/CHANGELOG.md b/packages/annotations/CHANGELOG.md
index f8bd3d08f2c7bc..9d8994d0b48610 100644
--- a/packages/annotations/CHANGELOG.md
+++ b/packages/annotations/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 1.0.4 (2018-12-12)
+
+## 1.0.3 (2018-11-21)
+
+## 1.0.2 (2018-11-20)
+
## 1.0.1 (2018-11-15)
## 1.0.0 (2018-11-12)
diff --git a/packages/annotations/package.json b/packages/annotations/package.json
index 89eb55c53d0a67..3e909c7a0852c0 100644
--- a/packages/annotations/package.json
+++ b/packages/annotations/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/annotations",
- "version": "1.0.1",
+ "version": "1.0.4",
"description": "Annotate content in the Gutenberg editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
@@ -26,6 +26,7 @@
"@wordpress/i18n": "file:../i18n",
"@wordpress/rich-text": "file:../rich-text",
"lodash": "^4.17.10",
+ "memize": "^1.0.5",
"rememo": "^3.0.0",
"uuid": "^3.3.2"
},
diff --git a/packages/annotations/src/block/index.js b/packages/annotations/src/block/index.js
index 5095fc473d67e6..e2677bbf6a9b3a 100644
--- a/packages/annotations/src/block/index.js
+++ b/packages/annotations/src/block/index.js
@@ -17,7 +17,7 @@ const addAnnotationClassName = ( OriginalComponent ) => {
return {
className: annotations.map( ( annotation ) => {
return 'is-annotated-by-' + annotation.source;
- } ),
+ } ).join( ' ' ),
};
} )( OriginalComponent );
};
diff --git a/packages/annotations/src/format/annotation.js b/packages/annotations/src/format/annotation.js
index b052de27f335fd..e72786bad0e3bc 100644
--- a/packages/annotations/src/format/annotation.js
+++ b/packages/annotations/src/format/annotation.js
@@ -1,15 +1,19 @@
/**
- * WordPress dependencies
+ * External dependencies
*/
-import { __ } from '@wordpress/i18n';
-
-const name = 'core/annotation';
+import memize from 'memize';
/**
* WordPress dependencies
*/
+import { __ } from '@wordpress/i18n';
import { applyFormat, removeFormat } from '@wordpress/rich-text';
+const FORMAT_NAME = 'core/annotation';
+
+const ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';
+const STORE_KEY = 'core/annotations';
+
/**
* Applies given annotations to the given record.
*
@@ -29,11 +33,17 @@ export function applyAnnotations( record, annotations = [] ) {
end = record.text.length;
}
- const className = 'annotation-text-' + annotation.source;
+ const className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;
+ const id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;
record = applyFormat(
record,
- { type: 'core/annotation', attributes: { className } },
+ {
+ type: FORMAT_NAME, attributes: {
+ className,
+ id,
+ },
+ },
start,
end
);
@@ -52,31 +62,126 @@ export function removeAnnotations( record ) {
return removeFormat( record, 'core/annotation', 0, record.text.length );
}
+/**
+ * Retrieves the positions of annotations inside an array of formats.
+ *
+ * @param {Array} formats Formats with annotations in there.
+ * @return {Object} ID keyed positions of annotations.
+ */
+function retrieveAnnotationPositions( formats ) {
+ const positions = {};
+
+ formats.forEach( ( characterFormats, i ) => {
+ characterFormats = characterFormats || [];
+ characterFormats = characterFormats.filter( ( format ) => format.type === FORMAT_NAME );
+ characterFormats.forEach( ( format ) => {
+ let { id } = format.attributes;
+ id = id.replace( ANNOTATION_ATTRIBUTE_PREFIX, '' );
+
+ if ( ! positions.hasOwnProperty( id ) ) {
+ positions[ id ] = {
+ start: i,
+ };
+ }
+
+ // Annotations refer to positions between characters.
+ // Formats refer to the character themselves.
+ // So we need to adjust for that here.
+ positions[ id ].end = i + 1;
+ } );
+ } );
+
+ return positions;
+}
+
+/**
+ * Updates annotations in the state based on positions retrieved from RichText.
+ *
+ * @param {Array} annotations The annotations that are currently applied.
+ * @param {Array} positions The current positions of the given annotations.
+ * @param {Function} removeAnnotation Function to remove an annotation from the state.
+ * @param {Function} updateAnnotationRange Function to update an annotation range in the state.
+ */
+function updateAnnotationsWithPositions( annotations, positions, { removeAnnotation, updateAnnotationRange } ) {
+ annotations.forEach( ( currentAnnotation ) => {
+ const position = positions[ currentAnnotation.id ];
+ // If we cannot find an annotation, delete it.
+ if ( ! position ) {
+ // Apparently the annotation has been removed, so remove it from the state:
+ // Remove...
+ removeAnnotation( currentAnnotation.id );
+ return;
+ }
+
+ const { start, end } = currentAnnotation;
+ if ( start !== position.start || end !== position.end ) {
+ updateAnnotationRange( currentAnnotation.id, position.start, position.end );
+ }
+ } );
+}
+
+/**
+ * Create prepareEditableTree memoized based on the annotation props.
+ *
+ * @param {Object} The props with annotations in them.
+ *
+ * @return {Function} The prepareEditableTree.
+ */
+const createPrepareEditableTree = memize( ( props ) => {
+ const { annotations } = props;
+
+ return ( formats, text ) => {
+ if ( annotations.length === 0 ) {
+ return formats;
+ }
+
+ let record = { formats, text };
+ record = applyAnnotations( record, annotations );
+ return record.formats;
+ };
+} );
+
+/**
+ * Returns the annotations as a props object. Memoized to prevent re-renders.
+ *
+ * @param {Array} The annotations to put in the object.
+ *
+ * @return {Object} The annotations props object.
+ */
+const getAnnotationObject = memize( ( annotations ) => {
+ return {
+ annotations,
+ };
+} );
+
export const annotation = {
- name,
+ name: FORMAT_NAME,
title: __( 'Annotation' ),
tagName: 'mark',
className: 'annotation-text',
attributes: {
className: 'class',
+ id: 'id',
},
edit() {
return null;
},
__experimentalGetPropsForEditableTreePreparation( select, { richTextIdentifier, blockClientId } ) {
+ return getAnnotationObject( select( STORE_KEY ).__experimentalGetAnnotationsForRichText( blockClientId, richTextIdentifier ) );
+ },
+ __experimentalCreatePrepareEditableTree: createPrepareEditableTree,
+ __experimentalGetPropsForEditableTreeChangeHandler( dispatch ) {
return {
- annotations: select( 'core/annotations' ).__experimentalGetAnnotationsForRichText( blockClientId, richTextIdentifier ),
+ removeAnnotation: dispatch( STORE_KEY ).__experimentalRemoveAnnotation,
+ updateAnnotationRange: dispatch( STORE_KEY ).__experimentalUpdateAnnotationRange,
};
},
- __experimentalCreatePrepareEditableTree( props ) {
- return ( formats, text ) => {
- if ( props.annotations.length === 0 ) {
- return formats;
- }
+ __experimentalCreateOnChangeEditableValue( props ) {
+ return ( formats ) => {
+ const positions = retrieveAnnotationPositions( formats );
+ const { removeAnnotation, updateAnnotationRange, annotations } = props;
- let record = { formats, text };
- record = applyAnnotations( record, props.annotations );
- return record.formats;
+ updateAnnotationsWithPositions( annotations, positions, { removeAnnotation, updateAnnotationRange } );
};
},
};
diff --git a/packages/annotations/src/store/actions.js b/packages/annotations/src/store/actions.js
index 73f8c9e1fe381c..96598022d5a7c1 100644
--- a/packages/annotations/src/store/actions.js
+++ b/packages/annotations/src/store/actions.js
@@ -57,6 +57,24 @@ export function __experimentalRemoveAnnotation( annotationId ) {
};
}
+/**
+ * Updates the range of an annotation.
+ *
+ * @param {string} annotationId ID of the annotation to update.
+ * @param {number} start The start of the new range.
+ * @param {number} end The end of the new range.
+ *
+ * @return {Object} Action object.
+ */
+export function __experimentalUpdateAnnotationRange( annotationId, start, end ) {
+ return {
+ type: 'ANNOTATION_UPDATE_RANGE',
+ annotationId,
+ start,
+ end,
+ };
+}
+
/**
* Removes all annotations of a specific source.
*
diff --git a/packages/annotations/src/store/reducer.js b/packages/annotations/src/store/reducer.js
index cb14165a5d6bdd..1f768a78ad2157 100644
--- a/packages/annotations/src/store/reducer.js
+++ b/packages/annotations/src/store/reducer.js
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
-import { isNumber, mapValues } from 'lodash';
+import { get, isNumber, mapValues } from 'lodash';
/**
* Filters an array based on the predicate, but keeps the reference the same if
@@ -38,7 +38,7 @@ function isValidAnnotationRange( annotation ) {
*
* @return {Array} Updated state.
*/
-export function annotations( state = { all: [], byBlockClientId: {} }, action ) {
+export function annotations( state = {}, action ) {
switch ( action.type ) {
case 'ANNOTATION_ADD':
const blockClientId = action.blockClientId;
@@ -55,52 +55,48 @@ export function annotations( state = { all: [], byBlockClientId: {} }, action )
return state;
}
- const previousAnnotationsForBlock = state.byBlockClientId[ blockClientId ] || [];
+ const previousAnnotationsForBlock = get( state, blockClientId, [] );
return {
- all: [
- ...state.all,
- newAnnotation,
- ],
- byBlockClientId: {
- ...state.byBlockClientId,
- [ blockClientId ]: [ ...previousAnnotationsForBlock, action.id ],
- },
+ ...state,
+ [ blockClientId ]: [ ...previousAnnotationsForBlock, newAnnotation ],
};
case 'ANNOTATION_REMOVE':
- return {
- all: state.all.filter( ( annotation ) => annotation.id !== action.annotationId ),
+ return mapValues( state, ( annotationsForBlock ) => {
+ return filterWithReference( annotationsForBlock, ( annotation ) => {
+ return annotation.id !== action.annotationId;
+ } );
+ } );
- // We use filterWithReference to not refresh the reference if a block still has
- // the same annotations.
- byBlockClientId: mapValues( state.byBlockClientId, ( annotationForBlock ) => {
- return filterWithReference( annotationForBlock, ( annotationId ) => {
- return annotationId !== action.annotationId;
- } );
- } ),
- };
+ case 'ANNOTATION_UPDATE_RANGE':
+ return mapValues( state, ( annotationsForBlock ) => {
+ let hasChangedRange = false;
- case 'ANNOTATION_REMOVE_SOURCE':
- const idsToRemove = [];
+ const newAnnotations = annotationsForBlock.map( ( annotation ) => {
+ if ( annotation.id === action.annotationId ) {
+ hasChangedRange = true;
+ return {
+ ...annotation,
+ range: {
+ start: action.start,
+ end: action.end,
+ },
+ };
+ }
- const allAnnotations = state.all.filter( ( annotation ) => {
- if ( annotation.source === action.source ) {
- idsToRemove.push( annotation.id );
- return false;
- }
+ return annotation;
+ } );
- return true;
+ return hasChangedRange ? newAnnotations : annotationsForBlock;
} );
- return {
- all: allAnnotations,
- byBlockClientId: mapValues( state.byBlockClientId, ( annotationForBlock ) => {
- return filterWithReference( annotationForBlock, ( annotationId ) => {
- return ! idsToRemove.includes( annotationId );
- } );
- } ),
- };
+ case 'ANNOTATION_REMOVE_SOURCE':
+ return mapValues( state, ( annotationsForBlock ) => {
+ return filterWithReference( annotationsForBlock, ( annotation ) => {
+ return annotation.source !== action.source;
+ } );
+ } );
}
return state;
diff --git a/packages/annotations/src/store/selectors.js b/packages/annotations/src/store/selectors.js
index 659b83e83e30d1..a39a315c92f907 100644
--- a/packages/annotations/src/store/selectors.js
+++ b/packages/annotations/src/store/selectors.js
@@ -2,6 +2,18 @@
* External dependencies
*/
import createSelector from 'rememo';
+import { get, flatMap } from 'lodash';
+
+/**
+ * Shared reference to an empty array for cases where it is important to avoid
+ * returning a new array reference on every invocation, as in a connected or
+ * other pure component which performs `shouldComponentUpdate` check on props.
+ * This should be used as a last resort, since the normalized data should be
+ * maintained by the reducer result in state.
+ *
+ * @type {Array}
+ */
+const EMPTY_ARRAY = [];
/**
* Returns the annotations for a specific client ID.
@@ -13,15 +25,19 @@ import createSelector from 'rememo';
*/
export const __experimentalGetAnnotationsForBlock = createSelector(
( state, blockClientId ) => {
- return state.all.filter( ( annotation ) => {
- return annotation.selector === 'block' && annotation.blockClientId === blockClientId;
+ return get( state, blockClientId, [] ).filter( ( annotation ) => {
+ return annotation.selector === 'block';
} );
},
( state, blockClientId ) => [
- state.byBlockClientId[ blockClientId ],
+ get( state, blockClientId, EMPTY_ARRAY ),
]
);
+export const __experimentalGetAllAnnotationsForBlock = function( state, blockClientId ) {
+ return get( state, blockClientId, EMPTY_ARRAY );
+};
+
/**
* Returns the annotations that apply to the given RichText instance.
*
@@ -36,9 +52,8 @@ export const __experimentalGetAnnotationsForBlock = createSelector(
*/
export const __experimentalGetAnnotationsForRichText = createSelector(
( state, blockClientId, richTextIdentifier ) => {
- return state.all.filter( ( annotation ) => {
+ return get( state, blockClientId, [] ).filter( ( annotation ) => {
return annotation.selector === 'range' &&
- annotation.blockClientId === blockClientId &&
richTextIdentifier === annotation.richTextIdentifier;
} ).map( ( annotation ) => {
const { range, ...other } = annotation;
@@ -50,7 +65,7 @@ export const __experimentalGetAnnotationsForRichText = createSelector(
} );
},
( state, blockClientId ) => [
- state.byBlockClientId[ blockClientId ],
+ get( state, blockClientId, EMPTY_ARRAY ),
]
);
@@ -61,5 +76,7 @@ export const __experimentalGetAnnotationsForRichText = createSelector(
* @return {Array} All annotations currently applied.
*/
export function __experimentalGetAnnotations( state ) {
- return state.all;
+ return flatMap( state, ( annotations ) => {
+ return annotations;
+ } );
}
diff --git a/packages/annotations/src/store/test/reducer.js b/packages/annotations/src/store/test/reducer.js
index a1dba8db8c8ac4..190795bd8a98cf 100644
--- a/packages/annotations/src/store/test/reducer.js
+++ b/packages/annotations/src/store/test/reducer.js
@@ -4,12 +4,12 @@
import { annotations } from '../reducer';
describe( 'annotations', () => {
- const initialState = { all: [], byBlockClientId: {} };
+ const initialState = {};
it( 'returns all annotations and annotation IDs per block', () => {
const state = annotations( undefined, {} );
- expect( state ).toEqual( { all: [], byBlockClientId: {} } );
+ expect( state ).toEqual( initialState );
} );
it( 'returns a state with an annotation that has been added', () => {
@@ -23,24 +23,19 @@ describe( 'annotations', () => {
} );
expect( state ).toEqual( {
- all: [
- {
- id: 'annotationId',
- blockClientId: 'blockClientId',
- richTextIdentifier: 'identifier',
- source: 'default',
- selector: 'block',
- },
- ],
- byBlockClientId: {
- blockClientId: [ 'annotationId' ],
- },
+ blockClientId: [ {
+ id: 'annotationId',
+ blockClientId: 'blockClientId',
+ richTextIdentifier: 'identifier',
+ source: 'default',
+ selector: 'block',
+ } ],
} );
} );
it( 'allows an annotation to be removed', () => {
const state = annotations( {
- all: [
+ blockClientId: [
{
id: 'annotationId',
blockClientId: 'blockClientId',
@@ -49,15 +44,12 @@ describe( 'annotations', () => {
selector: 'block',
},
],
- byBlockClientId: {
- blockClientId: [ 'annotationId' ],
- },
}, {
type: 'ANNOTATION_REMOVE',
annotationId: 'annotationId',
} );
- expect( state ).toEqual( { all: [], byBlockClientId: { blockClientId: [] } } );
+ expect( state ).toEqual( { blockClientId: [] } );
} );
it( 'allows an annotation to be removed by its source', () => {
@@ -76,25 +68,20 @@ describe( 'annotations', () => {
selector: 'block',
};
const state = annotations( {
- all: [
+ blockClientId: [
annotation1,
+ ],
+ blockClientId2: [
annotation2,
],
- byBlockClientId: {
- blockClientId: [ 'annotationId' ],
- blockClientId2: [ 'annotationId2' ],
- },
}, {
type: 'ANNOTATION_REMOVE_SOURCE',
source: 'default',
} );
expect( state ).toEqual( {
- all: [ annotation2 ],
- byBlockClientId: {
- blockClientId: [],
- blockClientId2: [ 'annotationId2' ],
- },
+ blockClientId: [],
+ blockClientId2: [ annotation2 ],
} );
} );
@@ -113,7 +100,7 @@ describe( 'annotations', () => {
} );
expect( state ).toEqual( {
- all: [
+ blockClientId: [
{
id: 'annotationId',
blockClientId: 'blockClientId',
@@ -126,9 +113,45 @@ describe( 'annotations', () => {
},
},
],
- byBlockClientId: {
- blockClientId: [ 'annotationId' ],
- },
+ } );
+ } );
+
+ it( 'moves annotations when said action is dispatched', () => {
+ const state = annotations( {
+ blockClientId: [
+ {
+ id: 'annotationId',
+ blockClientId: 'blockClientId',
+ richTextIdentifier: 'identifier',
+ source: 'default',
+ selector: 'range',
+ range: {
+ start: 0,
+ end: 100,
+ },
+ },
+ ],
+ }, {
+ type: 'ANNOTATION_UPDATE_RANGE',
+ annotationId: 'annotationId',
+ start: 50,
+ end: 75,
+ } );
+
+ expect( state ).toEqual( {
+ blockClientId: [
+ {
+ id: 'annotationId',
+ blockClientId: 'blockClientId',
+ richTextIdentifier: 'identifier',
+ source: 'default',
+ selector: 'range',
+ range: {
+ start: 50,
+ end: 75,
+ },
+ },
+ ],
} );
} );
diff --git a/packages/api-fetch/CHANGELOG.md b/packages/api-fetch/CHANGELOG.md
index 733d979bc8ce89..b4c58ed5d9e1a9 100644
--- a/packages/api-fetch/CHANGELOG.md
+++ b/packages/api-fetch/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.2.6 (2018-12-12)
+
+## 2.2.5 (2018-11-20)
+
## 2.2.4 (2018-11-15)
## 2.2.3 (2018-11-12)
@@ -22,4 +26,4 @@
### Breaking Change
-- Change how required built-ins are polyfilled with Babel 7 ([#9171](https://github.com/WordPress/gutenberg/pull/9171)). If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill) will add support for these methods.
+- Change how required built-ins are polyfilled with Babel 7 ([#9171](https://github.com/WordPress/gutenberg/pull/9171)). If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill) will add support for these methods.
diff --git a/packages/api-fetch/package.json b/packages/api-fetch/package.json
index fc9d2ac3295902..0c3ab7e8e9bbc6 100644
--- a/packages/api-fetch/package.json
+++ b/packages/api-fetch/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/api-fetch",
- "version": "2.2.4",
+ "version": "2.2.6",
"description": "Utility to make WordPress REST API requests.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/babel-plugin-import-jsx-pragma/package.json b/packages/babel-plugin-import-jsx-pragma/package.json
index 5cd00bf163f86f..1c2bb7de9bb959 100644
--- a/packages/babel-plugin-import-jsx-pragma/package.json
+++ b/packages/babel-plugin-import-jsx-pragma/package.json
@@ -28,10 +28,6 @@
"dependencies": {
"@babel/runtime": "^7.0.0"
},
- "devDependencies": {
- "@babel/core": "^7.0.0",
- "@babel/plugin-syntax-jsx": "^7.0.0"
- },
"peerDependencies": {
"@babel/core": "^7.0.0"
},
diff --git a/packages/babel-plugin-makepot/package.json b/packages/babel-plugin-makepot/package.json
index e21a023be7d3d3..819415f3b97320 100644
--- a/packages/babel-plugin-makepot/package.json
+++ b/packages/babel-plugin-makepot/package.json
@@ -29,10 +29,6 @@
"gettext-parser": "^1.3.1",
"lodash": "^4.17.10"
},
- "devDependencies": {
- "@babel/core": "^7.0.0",
- "@babel/traverse": "^7.0.0"
- },
"peerDependencies": {
"@babel/core": "^7.0.0"
},
diff --git a/packages/babel-preset-default/package.json b/packages/babel-preset-default/package.json
index 08149a01f9b6b2..95bc302227f147 100644
--- a/packages/babel-preset-default/package.json
+++ b/packages/babel-preset-default/package.json
@@ -23,6 +23,7 @@
},
"main": "index.js",
"dependencies": {
+ "@babel/core": "^7.0.0",
"@babel/plugin-proposal-async-generator-functions": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
diff --git a/packages/block-library/CHANGELOG.md b/packages/block-library/CHANGELOG.md
index 9dc4bfe833a91b..f784c887fb110c 100644
--- a/packages/block-library/CHANGELOG.md
+++ b/packages/block-library/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 2.2.10 (2018-12-12)
+
+## 2.2.9 (2018-11-30)
+
+## 2.2.8 (2018-11-30)
+
+## 2.2.7 (2018-11-22)
+
+## 2.2.6 (2018-11-21)
+
+## 2.2.5 (2018-11-20)
+
## 2.2.4 (2018-11-15)
## 2.2.3 (2018-11-12)
diff --git a/packages/block-library/package.json b/packages/block-library/package.json
index b2d15a2e64cef5..3f81dcf5dfd3df 100644
--- a/packages/block-library/package.json
+++ b/packages/block-library/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-library",
- "version": "2.2.4",
+ "version": "2.2.10",
"description": "Block library for the WordPress editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
@@ -38,16 +38,8 @@
"classnames": "^2.2.5",
"lodash": "^4.17.10",
"memize": "^1.0.5",
- "moment": "^2.22.1",
- "querystring": "^0.2.0",
- "querystringify": "^1.0.0",
"url": "^0.11.0"
},
- "devDependencies": {
- "deep-freeze": "^0.0.1",
- "enzyme": "^3.7.0",
- "react-test-renderer": "^16.6.3"
- },
"publishConfig": {
"access": "public"
}
diff --git a/packages/block-library/src/archives/index.php b/packages/block-library/src/archives/index.php
index 97c8849ffc8188..3d7b5b42f4ae43 100644
--- a/packages/block-library/src/archives/index.php
+++ b/packages/block-library/src/archives/index.php
@@ -2,7 +2,7 @@
/**
* Server-side rendering of the `core/archives` block.
*
- * @package gutenberg
+ * @package WordPress
*/
/**
@@ -32,7 +32,7 @@ function render_block_core_archives( $attributes ) {
$class .= ' wp-block-archives-dropdown';
$dropdown_id = esc_attr( uniqid( 'wp-block-archives-' ) );
- $title = __( 'Archives', 'gutenberg' );
+ $title = __( 'Archives' );
/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
$dropdown_args = apply_filters(
@@ -50,19 +50,19 @@ function render_block_core_archives( $attributes ) {
switch ( $dropdown_args['type'] ) {
case 'yearly':
- $label = __( 'Select Year', 'gutenberg' );
+ $label = __( 'Select Year' );
break;
case 'monthly':
- $label = __( 'Select Month', 'gutenberg' );
+ $label = __( 'Select Month' );
break;
case 'daily':
- $label = __( 'Select Day', 'gutenberg' );
+ $label = __( 'Select Day' );
break;
case 'weekly':
- $label = __( 'Select Week', 'gutenberg' );
+ $label = __( 'Select Week' );
break;
default:
- $label = __( 'Select Post', 'gutenberg' );
+ $label = __( 'Select Post' );
break;
}
@@ -101,7 +101,7 @@ function render_block_core_archives( $attributes ) {
$block_content = sprintf(
'%2$s
',
$classnames,
- __( 'No archives to show.', 'gutenberg' )
+ __( 'No archives to show.' )
);
} else {
diff --git a/packages/block-library/src/audio/edit.js b/packages/block-library/src/audio/edit.js
index ed5c7d5aee2d94..ee2966208d015b 100644
--- a/packages/block-library/src/audio/edit.js
+++ b/packages/block-library/src/audio/edit.js
@@ -21,6 +21,11 @@ import {
} from '@wordpress/editor';
import { getBlobByURL, isBlobURL } from '@wordpress/blob';
+/**
+ * Internal dependencies
+ */
+import { createUpgradedEmbedBlock } from '../embed/util';
+
const ALLOWED_MEDIA_TYPES = [ 'audio' ];
class AudioEdit extends Component {
@@ -73,6 +78,14 @@ class AudioEdit extends Component {
// Set the block's src from the edit component's state, and switch off
// the editing UI.
if ( newSrc !== src ) {
+ // Check if there's an embed block that handles this URL.
+ const embedBlock = createUpgradedEmbedBlock(
+ { attributes: { url: newSrc } }
+ );
+ if ( undefined !== embedBlock ) {
+ this.props.onReplace( embedBlock );
+ return;
+ }
setAttributes( { src: newSrc, id: undefined } );
}
diff --git a/packages/block-library/src/block/index.js b/packages/block-library/src/block/index.js
index 799522b0bdbc50..2a3b451f8f2a98 100644
--- a/packages/block-library/src/block/index.js
+++ b/packages/block-library/src/block/index.js
@@ -15,7 +15,7 @@ export const settings = {
category: 'reusable',
- description: __( 'Create content, and save it to reuse across your site. Update the block, and the changes apply everywhere it’s used.' ),
+ description: __( 'Create content, and save it for you and other contributors to reuse across your site. Update the block, and the changes apply everywhere it’s used.' ),
attributes: {
ref: {
diff --git a/packages/block-library/src/block/index.php b/packages/block-library/src/block/index.php
index bc33929ac517ab..aa235f170333ee 100644
--- a/packages/block-library/src/block/index.php
+++ b/packages/block-library/src/block/index.php
@@ -2,7 +2,7 @@
/**
* Server-side rendering of the `core/block` block.
*
- * @package gutenberg
+ * @package WordPress
*/
/**
@@ -22,6 +22,10 @@ function render_block_core_block( $attributes ) {
return '';
}
+ if ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) {
+ return '';
+ }
+
return do_blocks( $reusable_block->post_content );
}
diff --git a/packages/block-library/src/button/editor.scss b/packages/block-library/src/button/editor.scss
index c4e960352c80c5..1330ff2cdf96f9 100644
--- a/packages/block-library/src/button/editor.scss
+++ b/packages/block-library/src/button/editor.scss
@@ -1,5 +1,3 @@
-$blocks-button__line-height: $big-font-size + 6px;
-
.editor-block-list__block[data-type="core/button"] {
&[data-align="center"] {
text-align: center;
@@ -18,7 +16,6 @@ $blocks-button__line-height: $big-font-size + 6px;
.editor-rich-text__tinymce.mce-content-body {
cursor: text;
- line-height: $blocks-button__line-height;
}
// Make placeholder text white unless custom colors or outline versions are chosen.
@@ -35,6 +32,11 @@ $blocks-button__line-height: $big-font-size + 6px;
.editor-block-preview__content & {
max-width: 100%;
+ // Polish the empty placeholder text for the button in variation previews.
+ .editor-rich-text__tinymce[data-is-placeholder-visible="true"] {
+ height: auto;
+ }
+
.wp-block-button__link {
max-width: 100%;
overflow: hidden;
@@ -53,7 +55,7 @@ $blocks-button__line-height: $big-font-size + 6px;
font-size: $default-font-size;
line-height: $default-line-height;
- // the width of input box plus padding plus two icon buttons.
+ // The width of input box plus padding plus two icon buttons.
$blocks-button__link-input-width: 300px + 2px + 2 * $icon-button-size;
width: $blocks-button__link-input-width;
diff --git a/packages/block-library/src/button/style.scss b/packages/block-library/src/button/style.scss
index 49ae444c831495..2a45e2e574b38f 100644
--- a/packages/block-library/src/button/style.scss
+++ b/packages/block-library/src/button/style.scss
@@ -1,29 +1,9 @@
-$blocks-button__height: 46px;
-$blocks-button__line-height: $big-font-size + 6px;
+$blocks-button__height: 56px;
.wp-block-button {
+ color: $white;
margin-bottom: 1.5em;
- & .wp-block-button__link {
- border: none;
- border-radius: $blocks-button__height / 2;
- box-shadow: none;
- cursor: pointer;
- display: inline-block;
- font-size: $big-font-size;
- line-height: $blocks-button__line-height;
- margin: 0;
- padding: ($blocks-button__height - $blocks-button__line-height) / 2 24px;
- text-align: center;
- text-decoration: none;
- white-space: normal;
- word-break: break-all;
- }
-
- &.is-style-squared .wp-block-button__link {
- border-radius: 0;
- }
-
&.aligncenter {
text-align: center;
}
@@ -34,45 +14,38 @@ $blocks-button__line-height: $big-font-size + 6px;
}
}
-.wp-block-button__link:not(.has-background) {
+.wp-block-button__link {
background-color: $dark-gray-700;
+ border: none;
+ border-radius: $blocks-button__height / 2;
+ box-shadow: none;
+ color: inherit;
+ cursor: pointer;
+ display: inline-block;
+ font-size: $big-font-size;
+ margin: 0;
+ padding: 12px 24px;
+ text-align: center;
+ text-decoration: none;
+ white-space: normal;
+ overflow-wrap: break-word;
&:hover,
&:focus,
&:active {
- background-color: $dark-gray-700;
+ color: inherit;
}
}
-.wp-block-button.is-style-outline {
- .wp-block-button__link {
- background: transparent;
- border: 2px solid currentcolor;
-
- &:hover,
- &:focus,
- &:active {
- border-color: currentcolor;
- }
- }
-
- .wp-block-button__link:not(.has-text-color) {
- color: $dark-gray-700;
-
- &:hover,
- &:focus,
- &:active {
- color: $dark-gray-700;
- }
- }
+.is-style-squared .wp-block-button__link {
+ border-radius: 0;
}
-.wp-block-button__link:not(.has-text-color) {
- color: $white;
+.is-style-outline {
+ color: $dark-gray-700;
- &:hover,
- &:focus,
- &:active {
- color: $white;
+ .wp-block-button__link {
+ background: transparent;
+ border: 2px solid currentcolor;
}
}
diff --git a/packages/block-library/src/button/test/__snapshots__/index.js.snap b/packages/block-library/src/button/test/__snapshots__/index.js.snap
index 9d96ec60114b22..e1532798910960 100644
--- a/packages/block-library/src/button/test/__snapshots__/index.js.snap
+++ b/packages/block-library/src/button/test/__snapshots__/index.js.snap
@@ -16,7 +16,6 @@ exports[`core/button block edit matches snapshot 1`] = `
>
%2$s
';
$items_markup = wp_dropdown_categories( $args );
$type = 'dropdown';
@@ -72,7 +72,7 @@ function build_dropdown_script_block_core_categories( $dropdown_id ) {
?>