diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 1ff7397f6c7c6f..94e2bce07afc13 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -18,8 +18,8 @@
## Checklist:
- [ ] My code is tested.
-- [ ] My code follows the WordPress code style.
-- [ ] My code follows the accessibility standards.
-- [ ] My code has proper inline documentation.
+- [ ] My code follows the WordPress code style.
+- [ ] My code follows the accessibility standards.
+- [ ] My code has proper inline documentation.
- [ ] I've included developer documentation if appropriate.
- [ ] I've updated all React Native files affected by any refactorings/renamings in this PR.
diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml
index 840e49a55ee078..bb7f6a59cf249f 100644
--- a/.github/workflows/rnmobile-ios-runner.yml
+++ b/.github/workflows/rnmobile-ios-runner.yml
@@ -30,7 +30,7 @@ jobs:
- name: Restore build cache
uses: actions/cache@v2
with:
- path: packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app
+ path: packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app
key: ${{ runner.os }}-ios-build-${{ hashFiles('ios-checksums.txt') }}
- name: Restore pods cache
@@ -55,13 +55,13 @@ jobs:
run: sudo xcode-select --switch /Applications/Xcode_11.4.1.app
- name: Build (if needed)
- run: test -e packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app/gutenberg || SKIP_BUNDLING=true npm run native test:e2e:build-app:ios
+ run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/gutenberg || SKIP_BUNDLING=true npm run native test:e2e:build-app:ios
- name: Run iOS Device Tests
run: TEST_RN_PLATFORM=ios npm run native device-tests:local ${{ matrix.native-test-name }}
- name: Prepare build cache
- run: rm packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app/main.jsbundle
+ run: rm packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle
- uses: actions/upload-artifact@v2
if: always()
diff --git a/bin/build-plugin-zip.sh b/bin/build-plugin-zip.sh
index 059df8063f2923..c44e5e3db50811 100755
--- a/bin/build-plugin-zip.sh
+++ b/bin/build-plugin-zip.sh
@@ -109,7 +109,12 @@ npm run build
php bin/generate-gutenberg-php.php > gutenberg.tmp.php
mv gutenberg.tmp.php gutenberg.php
-build_files=$(ls build/*/*.{js,css,asset.php} build/block-library/blocks/*.php build/block-library/blocks/*/block.json)
+build_files=$(
+ ls build/*/*.{js,css,asset.php} \
+ build/block-library/blocks/*.php build/block-library/blocks/*/block.json \
+ build/edit-widgets/blocks/*.php build/edit-widgets/blocks/*/block.json \
+)
+
# Generate the plugin zip file.
status "Creating archive... 🎁"
diff --git a/bin/tsconfig.json b/bin/tsconfig.json
index fb4b29fb702e42..86d2a07c742f8c 100644
--- a/bin/tsconfig.json
+++ b/bin/tsconfig.json
@@ -6,11 +6,13 @@
"target": "ES6",
"lib": [ "ES6", "ES2020.string" ],
"rootDir": ".",
- "declarationMap": false,
- // We're not interested in the output, but we must generate
- // something as part of a composite project. Use the
- // ignored `.cache` file to hide tsbuildinfo and d.ts files.
+ // These scripts aren't published and packages don't depend on them.
+ // Don't generate types, this is strictly for validation.
+ "incremental": true,
+ "declarationMap": false,
+ "emitDeclarationOnly": false,
+ "noEmit": true,
"outDir": ".cache"
},
"files": [
@@ -24,6 +26,6 @@
"./plugin/lib/logger.js",
"./plugin/lib/utils.js",
"./plugin/lib/git.js",
- "./validate-package-lock.js",
+ "./validate-package-lock.js"
]
}
diff --git a/changelog.txt b/changelog.txt
index 07d7b4cd0214ae..9bc39db2a4630f 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,8 +1,166 @@
== Changelog ==
-= 9.1.0-rc.1 =
+= 9.1.0 =
-TODO: Changelog will be provided later.
+### Features
+
+- Add "open in new tab" feature to Social Links Block. ([25468](https://github.com/WordPress/gutenberg/pull/25468))
+- Add Image Size control to the Media & Text block. ([24795](https://github.com/WordPress/gutenberg/pull/24795))
+
+### Enhancements
+
+- Inserter: Add block pattern category selection. ([24954](https://github.com/WordPress/gutenberg/pull/24954))
+- Reduce minimum height to 1px for the Spacer block. ([25528](https://github.com/WordPress/gutenberg/pull/25528))
+- Show the Fullscreen keyboard shortcut. ([25395](https://github.com/WordPress/gutenberg/pull/25395))
+- Improve the Audio block shortcode transform to account for all sources. ([25114](https://github.com/WordPress/gutenberg/pull/25114))
+- Code block: Allow HTML editing & rich text content. ([24689](https://github.com/WordPress/gutenberg/pull/24689))
+- Remove appender from unselected Buttons and Social Icons block. ([25518](https://github.com/WordPress/gutenberg/pull/25518))
+- Widgets Screen:
+ - Register legacy widgets as block variations. ([24905](https://github.com/WordPress/gutenberg/pull/24905))
+ - Use the default block list appender for the widget areas. ([25635](https://github.com/WordPress/gutenberg/pull/25635))
+ - Add titles to Legacy Widgets. ([25638](https://github.com/WordPress/gutenberg/pull/25638))
+- Buttons block: Lighten editor DOM. ([23222](https://github.com/WordPress/gutenberg/pull/23222))
+- Copy: Reword block settings menu item labels. ([22955](https://github.com/WordPress/gutenberg/pull/22955))
+- Add a tooltip to the Drag & Drop handle. ([25606](https://github.com/WordPress/gutenberg/pull/25606)) ([25614](https://github.com/WordPress/gutenberg/pull/25614))
+- A11y:
+ - Add aria-haspopup property to the BlockNavigation component. ([25605](https://github.com/WordPress/gutenberg/pull/25605))
+ - Add aria-haspopup property to the TableOfContents component. ([25603](https://github.com/WordPress/gutenberg/pull/25603))
+ - Add aria-haspopup to the ToolSelector. ([25600](https://github.com/WordPress/gutenberg/pull/25600))
+ - Add aria-haspopup to the MediaReplaceFlow button. ([25597](https://github.com/WordPress/gutenberg/pull/25597))
+ - Add aria-haspopup attribute to CustomGradientBar component. ([25571](https://github.com/WordPress/gutenberg/pull/25571))
+ - Add aria-haspopup to CircularOptionPicker component. ([25564](https://github.com/WordPress/gutenberg/pull/25564))
+ - Add aria-describedby to featured-image button. ([24888](https://github.com/WordPress/gutenberg/pull/24888))
+- Don't show heading ancestor blocks in Document Outline. ([25599](https://github.com/WordPress/gutenberg/pull/25599))
+- Support the default link config for the Gallery and Image blocks (`image_default_link_type`). ([25578](https://github.com/WordPress/gutenberg/pull/25578)) ([25582](https://github.com/WordPress/gutenberg/pull/25582))
+- Social Icons Block: Let icons wrap. ([25334](https://github.com/WordPress/gutenberg/pull/25334))
+
+### New APIs
+
+- Add new ComboboxControl. ([25442](https://github.com/WordPress/gutenberg/pull/25442))
+- Data Controls: Add new syncSelect control. ([25336](https://github.com/WordPress/gutenberg/pull/25336))
+- DateTimePicker: Add support for highlighting days. ([22032](https://github.com/WordPress/gutenberg/pull/22032))
+
+### Bug Fixes
+
+- Widgets Screen:
+ - Auto expand the last selected widget area when opening the inserter. ([25669](https://github.com/WordPress/gutenberg/pull/25669))
+ - Ensure all widgets are properly initialized when they're added, do not unmount widgets once they're mounted. ([25645](https://github.com/WordPress/gutenberg/pull/25645))
+ - Fix Legacy widget block previews and use iFrames. ([25443](https://github.com/WordPress/gutenberg/pull/25443)) ([14643](https://github.com/WordPress/gutenberg/pull/14643))
+ - Report save errors. ([25408](https://github.com/WordPress/gutenberg/pull/25408))
+ - Fix global inserter. ([24908](https://github.com/WordPress/gutenberg/pull/24908))
+- Fix RangeControl direct entry in input field. ([25609](https://github.com/WordPress/gutenberg/pull/25609))
+- A11y:
+ - Fix the color contrast in the code editor. ([25593](https://github.com/WordPress/gutenberg/pull/25593))
+ - Fix Publish sidebar Cancel button not usable through screen readers. ([25441](https://github.com/WordPress/gutenberg/pull/25441))
+ - Fix keyboard navigation on the Image block toolbar. ([25127](https://github.com/WordPress/gutenberg/pull/25127))
+ - More block: Use an actual placeholder for input text. ([23836](https://github.com/WordPress/gutenberg/pull/23836))
+- Fix nested container smart margins. ([25527](https://github.com/WordPress/gutenberg/pull/25527))
+- Fix add_filter instead of apply_filters. ([25512](https://github.com/WordPress/gutenberg/pull/25512))
+- Fix the WordPress embed preview in the editor. ([25370](https://github.com/WordPress/gutenberg/pull/25370))
+- Remove Embed block aspect ratio classes on url change. ([25295](https://github.com/WordPress/gutenberg/pull/25295))
+- Remove duplicate help item. ([25283](https://github.com/WordPress/gutenberg/pull/25283))
+- Fix Block Directory author average rating formating. ([24732](https://github.com/WordPress/gutenberg/pull/24732))
+- @wordpress/api-fetch:
+ - Fix preloading middleware referencing stale data. ([25550](https://github.com/WordPress/gutenberg/pull/25550))
+ - Check nonce header value before skipping adding it. ([25458](https://github.com/WordPress/gutenberg/pull/25458))
+- Use esc_html instead of esc_attr in the Archives block. ([25476](https://github.com/WordPress/gutenberg/pull/25476))
+- Fix Canceling Drag and Drop using ESC key. ([25317](https://github.com/WordPress/gutenberg/pull/25317))
+- Cover block: Add explilcit box-sizing style. ([25115](https://github.com/WordPress/gutenberg/pull/25115))
+- Use a ComboboxControl for the post author selector to fix loading issues for sites with a big number of authors. ([23237](https://github.com/WordPress/gutenberg/pull/23237))
+
+### Performance
+
+- Avoid relying on DOM events to measure the loading time. ([25288](https://github.com/WordPress/gutenberg/pull/25288))
+
+### Experiments
+
+- Site Editor Screen:
+ - Fix wrong close label in the block inspector. ([25424](https://github.com/WordPress/gutenberg/pull/25424))
+ - Add basic template information to editor header. ([25320](https://github.com/WordPress/gutenberg/pull/25320))
+ - Fix the footer styling. ([25152](https://github.com/WordPress/gutenberg/pull/25152))
+ - Add a reset button to global styles sidebar. ([25426](https://github.com/WordPress/gutenberg/pull/25426))
+ - Show document subtext if template part child is selected. ([25544](https://github.com/WordPress/gutenberg/pull/25544))
+ - Add navigation panel. ([25506](https://github.com/WordPress/gutenberg/pull/25506))
+ - Fix site base URL. ([25409](https://github.com/WordPress/gutenberg/pull/25409))
+- Post and Site Blocks:
+ - Add link option in PostTitle block. ([25341](https://github.com/WordPress/gutenberg/pull/25341)) ([25397](https://github.com/WordPress/gutenberg/pull/25397))
+ - Register the Site Logo block using `register_block_type_from_metadata`. ([25289](https://github.com/WordPress/gutenberg/pull/25289))
+- Themes and global styles:
+ - Support defining colors and gradients config from theme.json. ([25419](https://github.com/WordPress/gutenberg/pull/25419))
+ - Support defining font sizes config from theme.json. ([25516](https://github.com/WordPress/gutenberg/pull/25516))
+ - Support custom units on theme.json. ([25217](https://github.com/WordPress/gutenberg/pull/25217))
+ - Add separate support keys for color and background color. ([25314](https://github.com/WordPress/gutenberg/pull/25314))
+ - Allow themes to enqueue custom CSS variables via theme.json. ([25446](https://github.com/WordPress/gutenberg/pull/25446)) ([25619](https://github.com/WordPress/gutenberg/pull/25619))
+ - Refactor theme.json format. ([25301](https://github.com/WordPress/gutenberg/pull/25301)) ([25407](https://github.com/WordPress/gutenberg/pull/25407))
+ - Update theme json documentation to account for latest changes. ([25369](https://github.com/WordPress/gutenberg/pull/25369))
+- Block API: Introduce useBlockWrapperProps hook to use light block DOM in the editor. ([23034](https://github.com/WordPress/gutenberg/pull/23034)) ([25679](https://github.com/WordPress/gutenberg/pull/25679)) ([25554](https://github.com/WordPress/gutenberg/pull/25554)) ([25515](https://github.com/WordPress/gutenberg/pull/25515))
+- Navigation block and screen:
+ - Handle block menu items. ([24846](https://github.com/WordPress/gutenberg/pull/24846))
+ - Avoid auto-focusing Navigation block in Navigation screen. ([25592](https://github.com/WordPress/gutenberg/pull/25592))
+ - Change the block description. ([25531](https://github.com/WordPress/gutenberg/pull/25531)) ([25555](https://github.com/WordPress/gutenberg/pull/25555))
+ - Allow Social Links within Navigation Block. ([25357](https://github.com/WordPress/gutenberg/pull/25357))
+ - Wrap navigation editing features with filters. ([25329](https://github.com/WordPress/gutenberg/pull/25329))
+ - Add move markers to list view. ([25205](https://github.com/WordPress/gutenberg/pull/25205))
+- Iterating on the Navigation Component ([25608](https://github.com/WordPress/gutenberg/pull/25608)) ([25495](https://github.com/WordPress/gutenberg/pull/25495)) ([25572](https://github.com/WordPress/gutenberg/pull/25572)) ([25540](https://github.com/WordPress/gutenberg/pull/25540)) ([25520](https://github.com/WordPress/gutenberg/pull/25520)) ([25507](https://github.com/WordPress/gutenberg/pull/25507)) ([25367](https://github.com/WordPress/gutenberg/pull/25367)) ([25364](https://github.com/WordPress/gutenberg/pull/25364)) ([25340](https://github.com/WordPress/gutenberg/pull/25340)) ([25327](https://github.com/WordPress/gutenberg/pull/25327)) ([25281](https://github.com/WordPress/gutenberg/pull/25281)) ([25280](https://github.com/WordPress/gutenberg/pull/25280))
+
+
+### Documentation
+
+- Add a data format and flow architecture document. ([25299](https://github.com/WordPress/gutenberg/pull/25299))
+- @wordpress/env: Add documentation for inspecting the docker compose file. ([25666](https://github.com/WordPress/gutenberg/pull/25666))
+- Add new block supports page to the handbook. ([25647](https://github.com/WordPress/gutenberg/pull/25647))
+- Block Directory: Add developer documentation. ([25591](https://github.com/WordPress/gutenberg/pull/25591))
+- Move custom-fields note to the 'Register Meta Field' documentation. ([25584](https://github.com/WordPress/gutenberg/pull/25584))
+- Add Block Editor Components documentation:
+ - Warning ([25574](https://github.com/WordPress/gutenberg/pull/25574))
+ - FontSizePicker ([25568](https://github.com/WordPress/gutenberg/pull/25568))
+ - UnitControl ([25565](https://github.com/WordPress/gutenberg/pull/25565))
+ - CopyHandler ([25342](https://github.com/WordPress/gutenberg/pull/25342))
+ - MultiSelection ([25306](https://github.com/WordPress/gutenberg/pull/25306))
+ - LineHeightControl ([25303](https://github.com/WordPress/gutenberg/pull/25303))
+ - BlockAlignmentToolbar ([25212](https://github.com/WordPress/gutenberg/pull/25212))
+ - AlignmentToolbar ([25210](https://github.com/WordPress/gutenberg/pull/25210))
+ - BlockFormatControls ([25573](https://github.com/WordPress/gutenberg/pull/25573))
+- Add Caveats section for MAMP. ([25444](https://github.com/WordPress/gutenberg/pull/25444))
+- Add FormTokenField story. ([25439](https://github.com/WordPress/gutenberg/pull/25439))
+- Improve documentation for the data registry control and selector creators. ([25335](https://github.com/WordPress/gutenberg/pull/25335))
+- Update git workflow documentation. ([25164](https://github.com/WordPress/gutenberg/pull/25164))
+- Refresh the Getting Started guide. ([25090](https://github.com/WordPress/gutenberg/pull/25090))
+- Update JavaScript troubleshooting guide. ([24105](https://github.com/WordPress/gutenberg/pull/24105))
+- Enhance the Block Context documentation. ([25272](https://github.com/WordPress/gutenberg/pull/25272))
+- Typos: ([25359](https://github.com/WordPress/gutenberg/pull/25359)) ([25653](https://github.com/WordPress/gutenberg/pull/25653))
+
+### Code Quality
+
+- Update the Dashicon component to rely on the font that ships with WordPress. ([20003](https://github.com/WordPress/gutenberg/pull/20003))
+- Add new $gray-200 SASS variable and use for skeleton borders. ([25491](https://github.com/WordPress/gutenberg/pull/25491))
+- Block Editor: Remove empty module focus-detector. ([25561](https://github.com/WordPress/gutenberg/pull/25561))
+- Image block: Avoid remounting to focus caption. ([25493](https://github.com/WordPress/gutenberg/pull/25493))
+- Add explicit boxSizing style to Placeholder component. ([25463](https://github.com/WordPress/gutenberg/pull/25463))
+- Remove classic block code used to support WP 4.9. ([25365](https://github.com/WordPress/gutenberg/pull/25365))
+- Add RichText value type definition. ([25363](https://github.com/WordPress/gutenberg/pull/25363))
+- Avoid global DOM dependencies. ([25332](https://github.com/WordPress/gutenberg/pull/25332))
+- Use controls from the Data Controls package instead of local ones. ([25235](https://github.com/WordPress/gutenberg/pull/25235))
+- RichText: Simplify withFormatTypes as hook. ([23145](https://github.com/WordPress/gutenberg/pull/23145))
+- Video block: Use hooks. ([25513](https://github.com/WordPress/gutenberg/pull/25513))
+- Remove wp_area custom post type. ([25497](https://github.com/WordPress/gutenberg/pull/25497))
+- Post Featured Image: Remove redundant condition. ([25490](https://github.com/WordPress/gutenberg/pull/25490))
+- Move legacy-widget block over to edit-widgets package. ([25371](https://github.com/WordPress/gutenberg/pull/25371)) ([25404](https://github.com/WordPress/gutenberg/pull/25404))
+- Don't use percent units for line-height. ([25398](https://github.com/WordPress/gutenberg/pull/25398))
+- Change wording and names to not include "whitelist". ([25396](https://github.com/WordPress/gutenberg/pull/25396))
+- Don't discard all promises results when one of them rejects. ([25302](https://github.com/WordPress/gutenberg/pull/25302))
+- Block Directory: Switch to `blocks.registerBlockType` filter. ([25264](https://github.com/WordPress/gutenberg/pull/25264))
+- Fix some javascript warnings. ([24996](https://github.com/WordPress/gutenberg/pull/24996))
+
+### Various
+
+- Remove the Block-based widgets editor from the customizer. ([25626](https://github.com/WordPress/gutenberg/pull/25626))
+- Cover block: Remove default position (center/center) className from rendering. ([25346](https://github.com/WordPress/gutenberg/pull/25346))
+- Fix the default label position in SelectControl. ([25427](https://github.com/WordPress/gutenberg/pull/25427))
+- DropdownMenu tooltip default to true. ([25391](https://github.com/WordPress/gutenberg/pull/25391))
+- Pass block pattern name when using replaceBlocks and insertBlocks. ([25165](https://github.com/WordPress/gutenberg/pull/25165)). ([25433](https://github.com/WordPress/gutenberg/pull/25433))
+- Babel Preset: Update Babel version to 7.11.x. ([25351](https://github.com/WordPress/gutenberg/pull/25351))
+- InputControl: Remove floating label variant. ([25308](https://github.com/WordPress/gutenberg/pull/25308))
= 9.0.0 =
diff --git a/docs/contributors/git-workflow.md b/docs/contributors/git-workflow.md
index 3acfd27a36f0c8..0894945e8a2850 100644
--- a/docs/contributors/git-workflow.md
+++ b/docs/contributors/git-workflow.md
@@ -51,7 +51,7 @@ git switch -c update/my-branch
**Step 4**: Make the code changes. Build, confirm, and test your change thoroughly. See [coding guidelines](/docs/contributors/coding-guidelines.md) and [testing overview](/docs/contributors/testing-overview.md) for guidance.
-**Step 5**: Commit your change with a [good commmit message](https://make.wordpress.org/core/handbook/best-practices/commit-messages/). This will commit your change to your local copy of the repository.
+**Step 5**: Commit your change with a [good commit message](https://make.wordpress.org/core/handbook/best-practices/commit-messages/). This will commit your change to your local copy of the repository.
```bash
git commit -m "Your Good Commit Message" path/to/FILE
diff --git a/docs/designers-developers/developers/block-api/block-metadata.md b/docs/designers-developers/developers/block-api/block-metadata.md
index c159d7c1391071..24d1468121ba29 100644
--- a/docs/designers-developers/developers/block-api/block-metadata.md
+++ b/docs/designers-developers/developers/block-api/block-metadata.md
@@ -11,6 +11,7 @@ To register a new block type using metadata that can be shared between codebase
```json
{
+ "apiVersion": 2,
"name": "my-plugin/notice",
"title": "Notice",
"category": "text",
@@ -32,7 +33,6 @@ To register a new block type using metadata that can be shared between codebase
"usesContext": [ "groupId" ],
"supports": {
"align": true,
- "lightBlockWrapper": true
},
"styles": [
{ "name": "default", "label": "Default", "isDefault": true },
diff --git a/docs/designers-developers/developers/themes/block-based-themes.md b/docs/designers-developers/developers/themes/block-based-themes.md
index 4889a36580bd48..03f4f278b9a256 100644
--- a/docs/designers-developers/developers/themes/block-based-themes.md
+++ b/docs/designers-developers/developers/themes/block-based-themes.md
@@ -17,6 +17,7 @@ A very simple block-based theme is structured like so:
```
theme
|__ style.css
+|__ experimental-theme.json
|__ functions.php
|__ block-templates
|__ index.html
@@ -30,7 +31,7 @@ theme
|__ ...
```
-The difference with existing WordPress themes is that the different templates in the template hierarchy, and template parts, are block templates instead of php files.
+The difference with existing WordPress themes is that the different templates in the template hierarchy, and template parts, are block templates instead of php files. In addition, this example includes an [`experimental-theme.json`](/docs/designers-developers/developers/themes/theme-json.md) file for some styles.
## What is a block template?
@@ -111,17 +112,21 @@ As we're still early in the process, the number of blocks specifically dedicated
- Post Title
- Post Content
- Post Author
+- Post Comment
+- Post Comment Author
+- Post Comment Date
- Post Comments
-- Post CommentsCount
-- Post CommentsForm
+- Post Comments Count
+- Post Comments Form
- Post Date
- Post Excerpt
- Post Featured Image
+- Post Hierarchical Terms
- Post Tags
## Styling
-One of the most important aspects of themes (if not the most important) is the styling. While initially you'll be able to provide styles and enqueue them using the same hooks themes have always used, this is an area that is still [being explored](https://github.com/WordPress/gutenberg/issues/9534).
+One of the most important aspects of themes (if not the most important) is the styling. While initially you'll be able to provide styles and enqueue them using the same hooks themes have always used, the [Global Styles](/docs/designers-developers/developers/themes/theme-json.md) effort will provide a scaffolding for adding many theme styles in the future.
## Resources
diff --git a/docs/designers-developers/developers/themes/theme-json.md b/docs/designers-developers/developers/themes/theme-json.md
index 1deafc2e0d0f84..58a4ca6cb27578 100644
--- a/docs/designers-developers/developers/themes/theme-json.md
+++ b/docs/designers-developers/developers/themes/theme-json.md
@@ -87,7 +87,7 @@ The settings section has the following structure and default values:
"palette": [ ... ], /* color presets, as in add_theme_support('editor-color-palette', ... ) */
},
"spacing": {
- "customPadding": false, /* true to opt-in, as in add_theme_support('experimental-custom-spacing') */
+ "customPadding": false, /* true to opt-in, as in add_theme_support('custom-spacing') */
"units": [ "px", "em", "rem", "vh", "vw" ], /* filter values, as in add_theme_support('custom-units', ... ) */
},
"typography": {
diff --git a/docs/designers-developers/developers/themes/theme-support.md b/docs/designers-developers/developers/themes/theme-support.md
index bc0d8080503ab5..8331a41d2d935b 100644
--- a/docs/designers-developers/developers/themes/theme-support.md
+++ b/docs/designers-developers/developers/themes/theme-support.md
@@ -388,12 +388,12 @@ To make the content resize and keep its aspect ratio, the `
` element needs
add_theme_support( 'responsive-embeds' );
```
-## Experimental — Cover block padding
+## Cover block padding
-Using the Gutenberg plugin (version 8.3 or later), Cover blocks can provide padding controls in the editor for users. This is off by default, and requires the theme to opt in by declaring support:
+Some blocks can provide padding controls in the editor for users. This is off by default, and requires the theme to opt in by declaring support:
```php
-add_theme_support('experimental-custom-spacing');
+add_theme_support('custom-spacing');
```
## Experimental — Link color control
diff --git a/docs/designers-developers/developers/tutorials/block-based-themes/README.md b/docs/designers-developers/developers/tutorials/block-based-themes/README.md
index 820403bdbc656a..5739b34b44229a 100644
--- a/docs/designers-developers/developers/tutorials/block-based-themes/README.md
+++ b/docs/designers-developers/developers/tutorials/block-based-themes/README.md
@@ -7,9 +7,11 @@ You will learn about the required files, how to combine templates and template p
how to add presets for global styles, and how to add blocks and export the templates in the site editor.
Full site editing is an experimental feature and the workflow in this tutorial is likely to change.
-This tutorial was written for Gutenberg version 8.5.
+
+This tutorial is up to date as of Gutenberg version 9.1.
## Table of Contents
+
1. [What is needed to create a block-based theme?](/docs/designers-developers/developers/tutorials/block-based-themes/README.md#what-is-needed-to-create-a-block-based-theme)
2. [Creating the theme](/docs/designers-developers/developers/tutorials/block-based-themes/README.md#creating-the-theme)
3. [Creating the templates and template parts](/docs/designers-developers/developers/tutorials/block-based-themes/README.md#creating-the-templates-and-template-parts)
@@ -19,24 +21,20 @@ This tutorial was written for Gutenberg version 8.5.
## What is needed to create a block-based theme?
To use a block based theme you need to have Gutenberg installed and full site editing must be enabled.
+
Full site editing can be enabled from the Gutenberg experiments menu in the WordPress admin area.
-A block-based theme is built using HTML templates and template parts.
-Templates are the main files used in the [template hierarchy](https://developer.wordpress.org/themes/basics/template-hierarchy/),
-for example index, single or archive.
-Templates can optionally include structural template parts, for example a header, footer or sidebar.
+A block-based theme is built using HTML templates and template parts. Templates are the main files used in the [template hierarchy](https://developer.wordpress.org/themes/basics/template-hierarchy/), for example index, single or archive. Templates can optionally include structural template parts, for example a header, footer or sidebar.
-Each template or template part contains the [block grammar](https://developer.wordpress.org/block-editor/principles/key-concepts/#blocks), the HTML, for the selected blocks.
-The block HTML is generated in and exported from the **site editor**. It can also be added to the theme's HTML files manually.
+Each template or template part contains the [block grammar](https://developer.wordpress.org/block-editor/principles/key-concepts/#blocks), the HTML, for the selected blocks. The block HTML is generated in and exported from the **site editor**. It can also be added to the theme's HTML files manually.
### Required files and file structure
-A block based theme requires an index.php file, an index template file, a style.css file, and a functions.php file.
-The theme may optionally include an experimental-theme.json file to manage global styles.
-You decide what additional templates and template parts to include in your theme.
+A block based theme requires an `index.php` file, an index template file, a `style.css` file, and a `functions.php` file.
+
+The theme may optionally include an [experimental-theme.json file](/docs/designers-developers/developers/themes/theme-json.md) to manage global styles. You decide what additional templates and template parts to include in your theme.
-Templates are placed inside the block-templates folder,
-and template parts are placed inside the block-template-parts folder:
+Templates are placed inside the block-templates folder, and template parts are placed inside the block-template-parts folder:
```
theme
@@ -58,12 +56,10 @@ theme
## Creating the theme
-Create a new folder for your theme in /wp-content/themes/.
+Create a new folder for your theme in `/wp-content/themes/`.
Inside this folder, create the block-templates and block-template-parts folders.
-Create a style.css file.
-The file header in the style.css file has the same items that you would use in a traditional theme.
-https://developer.wordpress.org/themes/basics/main-stylesheet-style-css/#explanations
+Create a `style.css` file. The file header in the `style.css` file has [the same items that you would use in a traditional theme](https://developer.wordpress.org/themes/basics/main-stylesheet-style-css/#explanations).
```
/*
@@ -86,12 +82,11 @@ Use it to make something cool, have fun, and share what you've learned with othe
*/
```
-Create a functions.php file.
+Create a `functions.php` file.
-In this file, you will enqueue the style.css file and add any theme support that you want to use.
-For example colors, wide blocks and featured images.
+In this file, you will enqueue the `style.css` file and add any theme support that you want to use. For example colors, wide blocks and featured images.
--You no longer need to add theme support for the title tag. It is already enabled with full site editing.
+_You no longer need to add theme support for the title tag. It is already enabled with full site editing._
https://developer.wordpress.org/themes/basics/theme-functions/#what-is-functions-php
@@ -152,7 +147,7 @@ function myfirsttheme_scripts() {
add_action( 'wp_enqueue_scripts', 'myfirsttheme_scripts' );
```
-Create an index.php file.
+Create an `index.php` file.
This file is used as a fallback if the theme is activated when full site editing is not enabled.
You may leave the file empty for this tutorial.
@@ -171,15 +166,13 @@ theme
### Creating the templates and template parts
-Create two template parts called footer.html and header.html and place them inside the block-template-parts folder.
-You can leave the files empty for now.
+Create two template parts called `footer.html` and `header.html` and place them inside the block-template-parts folder. You can leave the files empty for now.
-Inside the block-templates folder, create an index.html file.
+Inside the block-templates folder, create an `index.html` file.
-In index.html, include the template parts by adding two HTML comments.
+In `index.html`, include the template parts by adding two HTML comments.
-The HTML comments starts with `wp:template-part` which is the name of the template-part block type.
-Inside the curly brackets are two keys and their values: The slug of the template part, and the theme name.
+The HTML comments starts with `wp:template-part` which is the name of the template-part block type. Inside the curly brackets are two keys and their values: The slug of the template part, and the theme name.
```
@@ -193,7 +186,7 @@ Eventually, you will be able to create and combine templates and template parts
### Experimental-theme.json - Global styles
-The purpose of the experimental-theme.json file is to make it easier to style blocks by setting defaults.
+The purpose of the `experimental-theme.json` file is to make it easier to style blocks by setting defaults.
It is used to:
* Create CSS variables (also called CSS custom properties) that can be used to style blocks both on the front and in the editor.
@@ -202,45 +195,46 @@ It is used to:
[The documentation for global styles contains a list of available block and style combinations.](https://developer.wordpress.org/block-editor/developers/themes/theme-json/)
-Create a file called experimental-theme.json and save it inside the main folder.
+Create a file called `experimental-theme.json` and save it inside the main folder.
-CSS variables are generated using **Global presets**.
-The variables are added to the `:root` on the front, and to the `.editor-styles-wrapper` class in the editor.
+CSS variables are generated using **Global presets**. The variables are added to the `:root` on the front, and to the `.editor-styles-wrapper` class in the editor.
-Styles that are added to the themes style.css file or an editor style sheet are loaded after global styles.
+Styles that are added to the themes `style.css` file or an editor style sheet are loaded after global styles.
-Add the following global presets to the experimental-theme.json file:
+Add the following global presets to the `experimental-theme.json` file:
```
{
"global": {
- "presets": {
- "color": [
- {
- "slug": "strong-magenta",
- "value": "#a156b4"
- },
- {
- "slug": "very-dark-gray",
- "value": "#444"
- },
- ],
- "line-height": [
- {
- "slug": "small",
- "value": "1.3"
- },
- {
- "slug": "medium",
- "value": "2"
- },
- {
- "slug": "large",
- "value": "2.5"
- }
- ],
- },
- },
+ "setttings": {
+ "color": {
+ "palette": [
+ {
+ "slug": "strong-magenta",
+ "color": "#a156b4"
+ },
+ {
+ "slug": "very-dark-gray",
+ "color": "#444"
+ },
+ ]
+ },
+ "custom": {
+ "line-height": [
+ {
+ "small": "1.3"
+ },
+ {
+ "medium": "2"
+ },
+ {
+ large": "2.5"
+ }
+ ]
+ }
+ }
+ }
+}
```
This code generates the following variables:
@@ -248,9 +242,9 @@ This code generates the following variables:
--wp--preset--color--strong-magenta: #a156b4;
--wp--preset--color--very-dark-gray: #444;
- --wp--preset--line-height--small: 1.3;
- --wp--preset--line-height--medium: 2;
- --wp--preset--line-height--large: 2.5;
+ --wp--custom--line-height--small: 1.3;
+ --wp--custom--line-height--medium: 2;
+ --wp--custom--line-height--large: 2.5;
```
**Global styles** are used to set default values for the website and for the blocks.
@@ -282,20 +276,20 @@ Block styles are separate from global styles. Add the code after the globals, bu
},
"typography": {
"fontSize": "2.5rem",
- "lineHeight": "var(--wp--preset--line-height--medium)"
+ "lineHeight": "var(--wp--custom--line-height--medium)"
}
}
},
```
CSS variables for font sizes are generated using the `editor-font-sizes` theme support or by adding a global preset.
+
https://developer.wordpress.org/block-editor/developers/themes/theme-support/#block-font-sizes
If the theme does not add any custom font sizes, variables are created using the default sizes.
This example adds the default medium font size to the paragraph block.
-The font sizes are unit less, which is why calc is used:
-https://developer.mozilla.org/en-US/docs/Web/CSS/calc
+The font sizes are unitless, which is why calc is used: https://developer.mozilla.org/en-US/docs/Web/CSS/calc
```
"core/paragraph": {
@@ -307,8 +301,7 @@ https://developer.mozilla.org/en-US/docs/Web/CSS/calc
},
```
-Using the CSS variables is optional.
-In this example, the default background color for the group block is changed to white using a color code:
+Using the CSS variables is optional. In this example, the default background color for the group block is changed to white using a color code:
```
"core/group": {
@@ -325,35 +318,31 @@ Below are the presets and styles combined:
```
{
"global": {
- "presets": {
- "color": [
- {
- "slug": "strong-magenta",
- "value": "#a156b4"
- },
- {
- "slug": "very-dark-gray",
- "value": "#444"
- }
- ],
- "line-height": [
- {
- "slug": "small",
- "value": "1.3"
- },
- {
- "slug": "medium",
- "value": "2"
- },
- {
- "slug": "large",
- "value": "2.5"
- }
- ]
- },
- "styles": {
+ "setttings": {
"color": {
- "background": "var(--wp--preset--color--very-dark-gray)"
+ "palette": [
+ {
+ "slug": "strong-magenta",
+ "color": "#a156b4"
+ },
+ {
+ "slug": "very-dark-gray",
+ "color": "#444"
+ },
+ ]
+ },
+ "custom": {
+ "line-height": [
+ {
+ "small": "1.3"
+ },
+ {
+ "medium": "2"
+ },
+ {
+ large": "2.5"
+ }
+ ]
}
}
},
@@ -365,7 +354,7 @@ Below are the presets and styles combined:
},
"typography": {
"fontSize": "2.5rem",
- "lineHeight": "var(--wp--preset--line-height--medium)"
+ "lineHeight": "var(--wp--custom--line-height--medium)"
}
}
},
diff --git a/docs/designers-developers/developers/tutorials/block-based-themes/block-based-themes-2-adding-blocks.md b/docs/designers-developers/developers/tutorials/block-based-themes/block-based-themes-2-adding-blocks.md
index 6a32769b71ece2..c1e5a2d6a4658c 100644
--- a/docs/designers-developers/developers/tutorials/block-based-themes/block-based-themes-2-adding-blocks.md
+++ b/docs/designers-developers/developers/tutorials/block-based-themes/block-based-themes-2-adding-blocks.md
@@ -7,11 +7,9 @@ There is more than one way to add blocks to the theme files:
- Adding and editing blocks in the site editor and exporting the theme.
- Adding block HTML and comments to the HTML files manually.
-
## Working with blocks and templates in the site editor
-The beta site editor is available from the WordPress admin area when full site editing is enabled.
-To use the site editor, a full site editing theme must be installed and active.
+The beta site editor is available from the WordPress admin area when full site editing is enabled. To use the site editor, a full site editing theme must be installed and active.
The site editor is similar to the block editor, but is used for the site layout instead of the post and page content.
@@ -29,17 +27,13 @@ Template parts can be selected and edited directly in the site editor, like othe

-Select the header template part in the menu to view and edit it individually.
-Add the blocks that you would like in your header, for example a site title block, a navigation block, and an image.
+Select the header template part in the menu to view and edit it individually. Add the blocks that you would like in your header, for example a site title block, a navigation block, and an image.
Next, select the footer template part and add some content, for example widget blocks.
Select the index template again to view the template parts together in the page context.
-To add a post loop to the index template, add a **query** block.
-The query block includes the query loop and the query pagination.
-The default loop displays the post title and post content.
-The query loop and query pagination are also available as individual blocks.
+To add a post loop to the index template, add a **query** block. The query block includes the query loop and the query pagination. The default loop displays the post title and post content. The query loop and query pagination are also available as individual blocks.
## Saving templates and template parts
@@ -51,14 +45,11 @@ Select the templates and template parts that you want to save:

-
-When you save changes in the site editor, the files in the active theme are not updated.
-Instead, the templates and template parts are saved as custom post types, that are accessed via the appearance menu.
+When you save changes in the site editor, the files in the active theme are not updated. Instead, the templates and template parts are saved as custom post types, that are accessed via the appearance menu.

## Exporting changes
-Saved templates and template parts can be exported as a partial theme from the Tools menu in the site editor.
-The block HTML code can then be copied to the theme that you are editing.
+Saved templates and template parts can be exported as a partial theme from the Tools menu in the site editor. The block HTML code can then be copied to the theme that you are editing.
diff --git a/gutenberg.php b/gutenberg.php
index 54e972091ed194..4cf9aacec6ce6a 100644
--- a/gutenberg.php
+++ b/gutenberg.php
@@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
* Requires at least: 5.3
* Requires PHP: 5.6
- * Version: 9.1.0-rc.1
+ * Version: 9.1.0
* Author: Gutenberg Team
* Text Domain: gutenberg
*
diff --git a/lib/block-supports/colors.php b/lib/block-supports/colors.php
index 8649b14d6d6095..b0bb4e1e22ada9 100644
--- a/lib/block-supports/colors.php
+++ b/lib/block-supports/colors.php
@@ -13,7 +13,7 @@
function gutenberg_register_colors_support( $block_type ) {
$color_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
- $color_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalColor' ), false );
+ $color_support = gutenberg_experimental_get( $block_type->supports, array( 'color' ), false );
}
$has_text_colors_support = true === $color_support || ( is_array( $color_support ) && gutenberg_experimental_get( $color_support, array( 'text' ), true ) );
$has_background_colors_support = true === $color_support || ( is_array( $color_support ) && gutenberg_experimental_get( $color_support, array( 'background' ), true ) );
@@ -60,10 +60,10 @@ function gutenberg_register_colors_support( $block_type ) {
* @return array Colors CSS classes and inline styles.
*/
function gutenberg_apply_colors_support( $attributes, $block_attributes, $block_type ) {
- $color_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalColor' ), false );
+ $color_support = gutenberg_experimental_get( $block_type->supports, array( 'color' ), false );
$has_text_colors_support = true === $color_support || ( is_array( $color_support ) && gutenberg_experimental_get( $color_support, array( 'text' ), true ) );
$has_background_colors_support = true === $color_support || ( is_array( $color_support ) && gutenberg_experimental_get( $color_support, array( 'background' ), true ) );
- $has_link_colors_support = gutenberg_experimental_get( $color_support, array( 'linkColor' ), false );
+ $has_link_colors_support = gutenberg_experimental_get( $color_support, array( 'link' ), false );
$has_gradients_support = gutenberg_experimental_get( $color_support, array( 'gradients' ), false );
// Text Colors.
diff --git a/lib/block-supports/typography.php b/lib/block-supports/typography.php
index 083a6ee477b900..ef33c3249ade17 100644
--- a/lib/block-supports/typography.php
+++ b/lib/block-supports/typography.php
@@ -13,12 +13,12 @@
function gutenberg_register_typography_support( $block_type ) {
$has_font_size_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
- $has_font_size_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalFontSize' ), false );
+ $has_font_size_support = gutenberg_experimental_get( $block_type->supports, array( 'fontSize' ), false );
}
$has_line_height_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
- $has_line_height_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalLineHeight' ), false );
+ $has_line_height_support = gutenberg_experimental_get( $block_type->supports, array( 'lineHeight' ), false );
}
if ( ! $block_type->attributes ) {
@@ -51,12 +51,12 @@ function gutenberg_register_typography_support( $block_type ) {
function gutenberg_apply_typography_support( $attributes, $block_attributes, $block_type ) {
$has_font_size_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
- $has_font_size_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalFontSize' ), false );
+ $has_font_size_support = gutenberg_experimental_get( $block_type->supports, array( 'fontSize' ), false );
}
$has_line_height_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
- $has_line_height_support = gutenberg_experimental_get( $block_type->supports, array( '__experimentalLineHeight' ), false );
+ $has_line_height_support = gutenberg_experimental_get( $block_type->supports, array( 'lineHeight' ), false );
}
// Font Size.
diff --git a/lib/class-wp-rest-widget-utils-controller.php b/lib/class-wp-rest-widget-utils-controller.php
index 832a25a6252807..ac02218d48333d 100644
--- a/lib/class-wp-rest-widget-utils-controller.php
+++ b/lib/class-wp-rest-widget-utils-controller.php
@@ -88,8 +88,9 @@ public function permissions_check() {
*
* @return boolean| True if the widget being referenced exists and false otherwise.
* @since 5.2.0
+ * @access public
*/
- private function is_valid_widget( $widget_class ) {
+ public function is_valid_widget( $widget_class ) {
$widget_class = urldecode( $widget_class );
global $wp_widget_factory;
if ( ! $widget_class ) {
diff --git a/lib/client-assets.php b/lib/client-assets.php
index fae60149ceaea6..f1a72422ba00da 100644
--- a/lib/client-assets.php
+++ b/lib/client-assets.php
@@ -619,3 +619,23 @@ function gutenberg_extend_block_editor_styles( $settings ) {
return $settings;
}
add_filter( 'block_editor_settings', 'gutenberg_extend_block_editor_styles' );
+
+/**
+ * Load the default editor styles.
+ * These styles are used if the "no theme styles" options is triggered.
+ *
+ * @param array $settings Default editor settings.
+ *
+ * @return array Filtered editor settings.
+ */
+function gutenberg_extend_block_editor_settings_with_default_editor_styles( $settings ) {
+ $editor_styles_file = gutenberg_dir_path() . 'build/editor/editor-styles.css';
+ $settings['defaultEditorStyles'] = array(
+ array(
+ 'css' => file_get_contents( $editor_styles_file ),
+ ),
+ );
+
+ return $settings;
+}
+add_filter( 'block_editor_settings', 'gutenberg_extend_block_editor_settings_with_default_editor_styles' );
diff --git a/lib/global-styles.php b/lib/global-styles.php
index 1fbdf36f00d95c..c385b72f18bcac 100644
--- a/lib/global-styles.php
+++ b/lib/global-styles.php
@@ -289,7 +289,7 @@ function gutenberg_experimental_global_styles_get_theme_support_settings() {
}
$theme_settings['global']['settings']['typography']['customLineHeight'] = true;
}
- if ( get_theme_support( 'experimental-custom-spacing' ) ) {
+ if ( get_theme_support( 'custom-spacing' ) ) {
if ( ! isset( $theme_settings['global']['settings']['spacing'] ) ) {
$theme_settings['global']['settings']['spacing'] = array();
}
@@ -417,12 +417,12 @@ function gutenberg_experimental_global_styles_get_style_property() {
*/
function gutenberg_experimental_global_styles_get_support_keys() {
return array(
- '--wp--style--color--link' => array( '__experimentalColor', 'linkColor' ),
- 'background' => array( '__experimentalColor', 'gradients' ),
- 'backgroundColor' => array( '__experimentalColor' ),
- 'color' => array( '__experimentalColor' ),
- 'fontSize' => array( '__experimentalFontSize' ),
- 'lineHeight' => array( '__experimentalLineHeight' ),
+ '--wp--style--color--link' => array( 'color', 'linkColor' ),
+ 'background' => array( 'color', 'gradients' ),
+ 'backgroundColor' => array( 'color' ),
+ 'color' => array( 'color' ),
+ 'fontSize' => array( 'fontSize' ),
+ 'lineHeight' => array( 'lineHeight' ),
);
}
@@ -484,8 +484,8 @@ function gutenberg_experimental_global_styles_get_block_data() {
array(
'supports' => array(
'__experimentalSelector' => ':root',
- '__experimentalFontSize' => true,
- '__experimentalColor' => array(
+ 'fontSize' => true,
+ 'color' => array(
'linkColor' => true,
'gradients' => true,
),
diff --git a/lib/widgets-page.php b/lib/widgets-page.php
index f69451a22a6c84..f620d27865b68a 100644
--- a/lib/widgets-page.php
+++ b/lib/widgets-page.php
@@ -77,7 +77,29 @@ function gutenberg_widgets_init( $hook ) {
gutenberg_get_legacy_widget_settings()
);
+ // This purposefully does not rely on apply_filters( 'block_editor_settings', $settings, null );
+ // Applying that filter would bring over multitude of features from the post editor, some of which
+ // may be undesirable. Instead of using that filter, we simply pick just the settings that are needed.
$settings = gutenberg_experimental_global_styles_settings( $settings );
+ $settings = gutenberg_extend_block_editor_styles( $settings );
+
+ $preload_paths = array(
+ array( '/wp/v2/media', 'OPTIONS' ),
+ '/__experimental/sidebars?context=edit',
+ );
+ $preload_data = array_reduce(
+ $preload_paths,
+ 'rest_preload_api_request',
+ array()
+ );
+ wp_add_inline_script(
+ 'wp-api-fetch',
+ sprintf(
+ 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );',
+ wp_json_encode( $preload_data )
+ ),
+ 'after'
+ );
wp_add_inline_script(
'wp-edit-widgets',
diff --git a/package-lock.json b/package-lock.json
index cd429d019d8838..8ca2bd93249c56 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "9.1.0-rc.1",
+ "version": "9.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -7874,8 +7874,8 @@
"integrity": "sha512-ng6Tm537E/M42GjE4TRUxQyL8sRfClcL7bQWblOCoxPZzJ2J3bdALsjeG3vDnVCIfI/R0AeFalN9KjMt0+Z/Zg=="
},
"@react-native-community/masked-view": {
- "version": "git+https://github.com/wordpress-mobile/react-native-masked-view.git#098004d0968f853fc7d96c2aa5f96afe7a133c58",
- "from": "git+https://github.com/wordpress-mobile/react-native-masked-view.git#098004d0968f853fc7d96c2aa5f96afe7a133c58"
+ "version": "git+https://github.com/wordpress-mobile/react-native-masked-view.git#f65a51a3320e58404d7f38d967bfd1f42b439ca9",
+ "from": "git+https://github.com/wordpress-mobile/react-native-masked-view.git#f65a51a3320e58404d7f38d967bfd1f42b439ca9"
},
"@react-native-community/slider": {
"version": "git+https://github.com/wordpress-mobile/react-native-slider.git#d263ff16cdd9fb7352b354342522ff030f220f42",
@@ -17469,6 +17469,7 @@
"@wordpress/url": "file:packages/url",
"classnames": "^2.2.5",
"lodash": "^4.17.19",
+ "reakit": "^1.1.0",
"rememo": "^3.0.0"
},
"dependencies": {
@@ -18231,7 +18232,7 @@
"requires": {
"@babel/runtime": "^7.11.2",
"@react-native-community/blur": "3.6.0",
- "@react-native-community/masked-view": "git+https://github.com/wordpress-mobile/react-native-masked-view.git#098004d0968f853fc7d96c2aa5f96afe7a133c58",
+ "@react-native-community/masked-view": "git+https://github.com/wordpress-mobile/react-native-masked-view.git#f65a51a3320e58404d7f38d967bfd1f42b439ca9",
"@react-native-community/slider": "git+https://github.com/wordpress-mobile/react-native-slider.git#d263ff16cdd9fb7352b354342522ff030f220f42",
"@react-navigation/native": "^5.6.1",
"@react-navigation/stack": "5.6.2",
@@ -59943,9 +59944,9 @@
}
},
"typescript": {
- "version": "3.8.3",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz",
- "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz",
+ "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==",
"dev": true
},
"ua-parser-js": {
diff --git a/package.json b/package.json
index 9e1fadc5512373..118ac43c643078 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "9.1.0-rc.1",
+ "version": "9.1.0",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
@@ -195,7 +195,7 @@
"style-loader": "1.0.0",
"stylelint-config-wordpress": "17.0.0",
"terser-webpack-plugin": "3.0.3",
- "typescript": "3.8.3",
+ "typescript": "4.0.3",
"uuid": "7.0.2",
"wd": "1.12.1",
"webpack": "4.42.0",
diff --git a/packages/a11y/package.json b/packages/a11y/package.json
index 800c9ba2d154dc..4d4be5cdbfa660 100644
--- a/packages/a11y/package.json
+++ b/packages/a11y/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/a11y",
- "version": "2.12.0",
+ "version": "2.13.0",
"description": "Accessibility (a11y) utilities for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/annotations/package.json b/packages/annotations/package.json
index 64eed3e119d406..dac2a023e90153 100644
--- a/packages/annotations/package.json
+++ b/packages/annotations/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/annotations",
- "version": "1.21.1",
+ "version": "1.22.0",
"description": "Annotate content in the Gutenberg editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/api-fetch/package.json b/packages/api-fetch/package.json
index 4b26e00fb8bb93..8f5225db3178bb 100644
--- a/packages/api-fetch/package.json
+++ b/packages/api-fetch/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/api-fetch",
- "version": "3.19.1",
+ "version": "3.20.0",
"description": "Utility to make WordPress REST API requests.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/autop/package.json b/packages/autop/package.json
index 1ba204882524d2..46d41447a9d5f3 100644
--- a/packages/autop/package.json
+++ b/packages/autop/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/autop",
- "version": "2.9.0",
+ "version": "2.10.0",
"description": "WordPress's automatic paragraph functions `autop` and `removep`.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/babel-plugin-makepot/package.json b/packages/babel-plugin-makepot/package.json
index 5f9a3649424dbc..6b44ddfbe85352 100644
--- a/packages/babel-plugin-makepot/package.json
+++ b/packages/babel-plugin-makepot/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/babel-plugin-makepot",
- "version": "3.8.0",
+ "version": "3.9.0",
"description": "WordPress Babel internationalization (i18n) plugin.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/babel-preset-default/package.json b/packages/babel-preset-default/package.json
index ad002d869a836e..38fac877c8f836 100644
--- a/packages/babel-preset-default/package.json
+++ b/packages/babel-preset-default/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/babel-preset-default",
- "version": "4.18.1",
+ "version": "4.19.0",
"description": "Default Babel preset for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/base-styles/package.json b/packages/base-styles/package.json
index d0c835a0e310ce..1cbd52fa812dea 100644
--- a/packages/base-styles/package.json
+++ b/packages/base-styles/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/base-styles",
- "version": "3.0.0",
+ "version": "3.1.0",
"description": "Base SCSS utilities and variables for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/blob/CHANGELOG.md b/packages/blob/CHANGELOG.md
index 1f8cd68b1aaafc..da92c6e537cd83 100644
--- a/packages/blob/CHANGELOG.md
+++ b/packages/blob/CHANGELOG.md
@@ -2,6 +2,10 @@
## Unreleased
+### New feature
+
+- Added a new `getBlobTypeByURL` function. Returns the file type of the blob or undefined if not a blob.
+
## 2.8.0 (2020-04-15)
### New feature
diff --git a/packages/blob/README.md b/packages/blob/README.md
index d9cd997185f4e2..91a371d1d71260 100644
--- a/packages/blob/README.md
+++ b/packages/blob/README.md
@@ -40,6 +40,20 @@ _Returns_
- `(File|undefined)`: The file for the blob URL.
+# **getBlobTypeByURL**
+
+Retrieve a blob type based on URL. The file must have been created by
+`createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
+`undefined`.
+
+_Parameters_
+
+- _url_ `string`: The blob URL.
+
+_Returns_
+
+- `(string|undefined)`: The blob type.
+
# **isBlobURL**
Check whether a url is a blob url.
diff --git a/packages/blob/package.json b/packages/blob/package.json
index fe38146e65b22c..4dc45ba63ecd51 100644
--- a/packages/blob/package.json
+++ b/packages/blob/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/blob",
- "version": "2.9.0",
+ "version": "2.10.0",
"description": "Blob utilities for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/blob/src/index.js b/packages/blob/src/index.js
index ef8ba7e2f7e394..3af66755c011e8 100644
--- a/packages/blob/src/index.js
+++ b/packages/blob/src/index.js
@@ -36,6 +36,19 @@ export function getBlobByURL( url ) {
return cache[ url ];
}
+/**
+ * Retrieve a blob type based on URL. The file must have been created by
+ * `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
+ * `undefined`.
+ *
+ * @param {string} url The blob URL.
+ *
+ * @return {string|undefined} The blob type.
+ */
+export function getBlobTypeByURL( url ) {
+ return getBlobByURL( url )?.type.split( '/' )[ 0 ]; // 0: media type , 1: file extension eg ( type: 'image/jpeg' ).
+}
+
/**
* Remove the resource and file cache from memory.
*
diff --git a/packages/blob/src/test/index.js b/packages/blob/src/test/index.js
index 110340e13639e2..4e59917522b519 100644
--- a/packages/blob/src/test/index.js
+++ b/packages/blob/src/test/index.js
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
-import { isBlobURL } from '../';
+import { isBlobURL, getBlobTypeByURL } from '../';
describe( 'isBlobURL', () => {
it( 'returns true if the url starts with "blob:"', () => {
@@ -16,3 +16,13 @@ describe( 'isBlobURL', () => {
expect( isBlobURL() ).toBe( false );
} );
} );
+
+describe( 'getBlobTypeByURL', () => {
+ it( 'returns undefined if the blob is not found', () => {
+ expect( getBlobTypeByURL( 'blob:notexisting' ) ).toBe( undefined );
+ } );
+
+ it( 'returns undefined if the url is not defined', () => {
+ expect( getBlobTypeByURL() ).toBe( undefined );
+ } );
+} );
diff --git a/packages/block-directory/package.json b/packages/block-directory/package.json
index 075f05713a225e..96d4a8c5858adf 100644
--- a/packages/block-directory/package.json
+++ b/packages/block-directory/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-directory",
- "version": "1.15.0",
+ "version": "1.16.0",
"description": "Extend editor with block directory features to search, download and install blocks.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/block-directory/src/store/test/actions.js b/packages/block-directory/src/store/test/actions.js
index b74f7f1a657725..516f6deef3fe1d 100644
--- a/packages/block-directory/src/store/test/actions.js
+++ b/packages/block-directory/src/store/test/actions.js
@@ -81,7 +81,7 @@ describe( 'actions', () => {
args: [],
selectorName: 'getBlockTypes',
storeKey: 'core/blocks',
- type: 'SELECT',
+ type: '@@data/RESOLVE_SELECT',
} );
expect( generator.next( [ block ] ).value ).toEqual( {
@@ -143,7 +143,7 @@ describe( 'actions', () => {
args: [],
selectorName: 'getBlockTypes',
storeKey: 'core/blocks',
- type: 'SELECT',
+ type: '@@data/RESOLVE_SELECT',
} );
expect( generator.next( [ inactiveBlock ] ).value ).toEqual( {
@@ -274,7 +274,7 @@ describe( 'actions', () => {
data: null,
};
expect( generator.throw( apiError ).value ).toMatchObject( {
- type: 'DISPATCH',
+ type: '@@data/DISPATCH',
actionName: 'createErrorNotice',
storeKey: 'core/notices',
} );
diff --git a/packages/block-editor/CHANGELOG.md b/packages/block-editor/CHANGELOG.md
index 9f6628a24fb1ee..7179c21f6cb6fb 100644
--- a/packages/block-editor/CHANGELOG.md
+++ b/packages/block-editor/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2020-10-06)
+
### Breaking Changes
- The block editor does not contain default colors, gradients, and font sizes anymore. If one wants to take advantage of these features, please explicitly pass colors, gradients, and/or settings or use the new __experimentalFeatures setting that is available.
diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md
index a6cf4764bf57a6..705eb7c4148897 100644
--- a/packages/block-editor/README.md
+++ b/packages/block-editor/README.md
@@ -30,8 +30,8 @@ function MyEditorComponent () {
return (
updateBlocks( blocks ) }
+ onChange={ ( blocks ) => updateBlocks( blocks ) }
>
@@ -400,6 +400,10 @@ _Related_
-
+# **LineHeightControl**
+
+Undocumented declaration.
+
# **MediaPlaceholder**
_Related_
@@ -558,6 +562,26 @@ _Related_
Undocumented declaration.
+# **useBlockProps**
+
+This hook is used to lightly mark an element as a block element. The element
+should be the outermost element of a block. Call this hook and pass the
+returned props to the element to mark as a block. If you define a ref for the
+element, it is important to pass the ref to this hook, which the hook in turn
+will pass to the component through the props it returns. Optionally, you can
+also pass any other props through this hook, and they will be merged and
+returned.
+
+_Parameters_
+
+- _props_ `Object`: Optional. Props to pass to the element. Must contain the ref if one is defined.
+- _options_ `Object`: Options for internal use only.
+- _options.\_\_unstableIsHtml_ `boolean`:
+
+_Returns_
+
+- `Object`: Props to pass to the element to mark as a block.
+
# **validateThemeColors**
Given an array of theme colors checks colors for validity
diff --git a/packages/block-editor/package.json b/packages/block-editor/package.json
index 4b7cc0aaf5e689..dee14d5468e36a 100644
--- a/packages/block-editor/package.json
+++ b/packages/block-editor/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-editor",
- "version": "4.5.0",
+ "version": "5.0.0",
"description": "Generic block editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/block-editor/src/components/block-edit/edit.js b/packages/block-editor/src/components/block-edit/edit.js
index 84044be7cc60db..0746699eb145dc 100644
--- a/packages/block-editor/src/components/block-edit/edit.js
+++ b/packages/block-editor/src/components/block-edit/edit.js
@@ -50,13 +50,11 @@ export const Edit = ( props ) => {
// with which a block is displayed. If `blockType` is valid, assign
// them preferentially as the render value for the block.
const Component = blockType.edit || blockType.save;
- const lightBlockWrapper = hasBlockSupport(
- blockType,
- 'lightBlockWrapper',
- false
- );
- if ( lightBlockWrapper ) {
+ if (
+ blockType.apiVersion > 1 ||
+ hasBlockSupport( blockType, 'lightBlockWrapper', false )
+ ) {
return ;
}
diff --git a/packages/block-editor/src/components/block-edit/test/edit.js b/packages/block-editor/src/components/block-edit/test/edit.js
index 3e89608bb096e5..5525bcf30aaab0 100644
--- a/packages/block-editor/src/components/block-edit/test/edit.js
+++ b/packages/block-editor/src/components/block-edit/test/edit.js
@@ -104,12 +104,10 @@ describe( 'Edit', () => {
it( 'should assign context', () => {
const edit = ( { context } ) => context.value;
registerBlockType( 'core/test-block', {
+ apiVersion: 2,
category: 'text',
title: 'block title',
usesContext: [ 'value' ],
- supports: {
- lightBlockWrapper: true,
- },
edit,
save: noop,
} );
diff --git a/packages/block-editor/src/components/block-list-appender/index.js b/packages/block-editor/src/components/block-list-appender/index.js
index e2a4dbb0ebd6bc..f81e1af2458609 100644
--- a/packages/block-editor/src/components/block-list-appender/index.js
+++ b/packages/block-editor/src/components/block-list-appender/index.js
@@ -7,6 +7,7 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
+import { createContext, useContext } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { getDefaultBlockName } from '@wordpress/blocks';
@@ -16,6 +17,9 @@ import { getDefaultBlockName } from '@wordpress/blocks';
import DefaultBlockAppender from '../default-block-appender';
import ButtonBlockAppender from '../button-block-appender';
+// A Context to store the map of the appender map.
+export const AppenderContext = createContext();
+
function stopPropagation( event ) {
event.stopPropagation();
}
@@ -30,6 +34,8 @@ function BlockListAppender( {
selectedBlockClientId,
tagName: TagName = 'div',
} ) {
+ const appenderMap = useContext( AppenderContext );
+
if ( isLocked || CustomAppender === false ) {
return null;
}
@@ -89,7 +95,20 @@ function BlockListAppender( {
// Prevent the block from being selected when the appender is
// clicked.
onFocus={ stopPropagation }
- className={ classnames( 'block-list-appender', className ) }
+ className={ classnames(
+ 'block-list-appender',
+ 'wp-block',
+ className
+ ) }
+ ref={ ( ref ) => {
+ if ( ref ) {
+ // Set the reference of the "Appender" with `rootClientId` as key.
+ appenderMap.set( rootClientId || '', ref );
+ } else {
+ // If it un-mounts, cleanup the map.
+ appenderMap.delete( rootClientId || '' );
+ }
+ } }
>
{ appender }
diff --git a/packages/block-editor/src/components/block-list/block-wrapper.js b/packages/block-editor/src/components/block-list/block-wrapper.js
index 4aef321a0bf20b..bca876163cc28f 100644
--- a/packages/block-editor/src/components/block-list/block-wrapper.js
+++ b/packages/block-editor/src/components/block-list/block-wrapper.js
@@ -19,6 +19,7 @@ import { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';
import { __, sprintf } from '@wordpress/i18n';
import { useSelect, useDispatch } from '@wordpress/data';
import deprecated from '@wordpress/deprecated';
+import { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';
/**
* Internal dependencies
@@ -30,12 +31,13 @@ import { BlockListBlockContext } from './block';
import ELEMENTS from './block-wrapper-elements';
/**
- * This hook is used to lighly mark an element as a block element. Call this
- * hook and pass the returned props to the element to mark as a block. If you
- * define a ref for the element, it is important to pass the ref to this hook,
- * which the hooks in turn will pass to the component through the props it
- * returns. Optionally, you can also pass any other props through this hook, and
- * they will be merged and returned.
+ * This hook is used to lightly mark an element as a block element. The element
+ * should be the outermost element of a block. Call this hook and pass the
+ * returned props to the element to mark as a block. If you define a ref for the
+ * element, it is important to pass the ref to this hook, which the hook in turn
+ * will pass to the component through the props it returns. Optionally, you can
+ * also pass any other props through this hook, and they will be merged and
+ * returned.
*
* @param {Object} props Optional. Props to pass to the element. Must contain
* the ref if one is defined.
@@ -44,7 +46,7 @@ import ELEMENTS from './block-wrapper-elements';
*
* @return {Object} Props to pass to the element to mark as a block.
*/
-export function useBlockWrapperProps( props = {}, { __unstableIsHtml } = {} ) {
+export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
const fallbackRef = useRef();
const ref = props.ref || fallbackRef;
const onSelectionStart = useContext( Context );
@@ -111,6 +113,20 @@ export function useBlockWrapperProps( props = {}, { __unstableIsHtml } = {} ) {
}
}, [ isSelected, isFirstMultiSelected, isLastMultiSelected ] );
+ // Set new block node if it changes.
+ // This effect should happen on every render, so no dependencies should be
+ // added.
+ useEffect( () => {
+ const node = ref.current;
+ setBlockNodes( ( nodes ) => {
+ if ( ! nodes[ clientId ] || nodes[ clientId ] === node ) {
+ return nodes;
+ }
+
+ return { ...nodes, [ clientId ]: node };
+ } );
+ } );
+
// translators: %s: Type of block (i.e. Text, Image etc)
const blockLabel = sprintf( __( 'Block: %s' ), blockTitle );
@@ -286,13 +302,20 @@ export function useBlockWrapperProps( props = {}, { __unstableIsHtml } = {} ) {
};
}
+/**
+ * Call within a save function to get the props for the block wrapper.
+ *
+ * @param {Object} props Optional. Props to pass to the element.
+ */
+useBlockProps.save = getBlockProps;
+
const BlockComponent = forwardRef(
( { children, tagName: TagName = 'div', ...props }, ref ) => {
deprecated( 'wp.blockEditor.__experimentalBlock', {
- alternative: 'wp.blockEditor.__experimentalUseBlockWrapperProps',
+ alternative: 'wp.blockEditor.useBlockProps',
} );
- const blockWrapperProps = useBlockWrapperProps( { ...props, ref } );
- return { children };
+ const blockProps = useBlockProps( { ...props, ref } );
+ return { children };
}
);
diff --git a/packages/block-editor/src/components/block-list/block-wrapper.native.js b/packages/block-editor/src/components/block-list/block-wrapper.native.js
index 10aea4bb9edd71..122ff1e4f514c5 100644
--- a/packages/block-editor/src/components/block-list/block-wrapper.native.js
+++ b/packages/block-editor/src/components/block-list/block-wrapper.native.js
@@ -1,12 +1,19 @@
+/**
+ * WordPress dependencies
+ */
+import { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';
+
/**
* Internal dependencies
*/
import ELEMENTS from './block-wrapper-elements';
-export function useBlockWrapperProps( props = {} ) {
+export function useBlockProps( props = {} ) {
return props;
}
+useBlockProps.save = getBlockProps;
+
const ExtendedBlockComponent = ELEMENTS.reduce( ( acc, element ) => {
acc[ element ] = element;
return acc;
diff --git a/packages/block-editor/src/components/block-list/block.js b/packages/block-editor/src/components/block-list/block.js
index 345005caf1daaa..9d151b9793d3cf 100644
--- a/packages/block-editor/src/components/block-list/block.js
+++ b/packages/block-editor/src/components/block-list/block.js
@@ -40,7 +40,7 @@ import BlockInvalidWarning from './block-invalid-warning';
import BlockCrashWarning from './block-crash-warning';
import BlockCrashBoundary from './block-crash-boundary';
import BlockHtml from './block-html';
-import { useBlockWrapperProps } from './block-wrapper';
+import { useBlockProps } from './block-wrapper';
export const BlockListBlockContext = createContext();
@@ -70,7 +70,7 @@ function mergeWrapperProps( propsA, propsB ) {
function Block( { children, isHtml, ...props } ) {
return (
-
}
onSelect={ onSelectAudio }
@@ -175,7 +175,7 @@ function AudioEdit( {
/>
-
+
{ /*
Disable the audio tag so the user clicking on it won't play the
file or change the position slider when the controls are enabled.
diff --git a/packages/block-library/src/audio/save.js b/packages/block-library/src/audio/save.js
index f88eb0bba52e0c..14dc6d57047f53 100644
--- a/packages/block-library/src/audio/save.js
+++ b/packages/block-library/src/audio/save.js
@@ -1,14 +1,14 @@
/**
* WordPress dependencies
*/
-import { RichText } from '@wordpress/block-editor';
+import { RichText, useBlockProps } from '@wordpress/block-editor';
export default function save( { attributes } ) {
const { autoplay, caption, loop, preload, src } = attributes;
return (
src && (
-
+