From 24b0275df5602d058c54faf2f9d8fa5ead3ee06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Fri, 29 Jan 2021 17:42:29 +0100 Subject: [PATCH 01/23] Bump plugin version to 9.9.0-rc.1 --- changelog.txt | 222 ++++++++++++++++++++++++++++++++++++++++++++++ gutenberg.php | 2 +- package-lock.json | 2 +- package.json | 2 +- readme.txt | 2 +- 5 files changed, 226 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 09b5eb03b3ffa1..0f9f6e78e420a9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,227 @@ == Changelog == += 9.9.0-rc.1 = + +### Enhancements + +- Try more muted sibling inserter. ([28550](https://github.com/WordPress/gutenberg/pull/28550)) +- Make sure toggleProps doesn't replace important props on ToolbarGroup. ([28401](https://github.com/WordPress/gutenberg/pull/28401)) +- Improve visual clarity of reusable block. ([28318](https://github.com/WordPress/gutenberg/pull/28318)) +- Dark Theme Support: Allow for theme modifications. ([28233](https://github.com/WordPress/gutenberg/pull/28233)) +- Add disabled support in ToggleControl and FormToggle. ([28228](https://github.com/WordPress/gutenberg/pull/28228)) +- Show the spacer block background on hover. ([28129](https://github.com/WordPress/gutenberg/pull/28129)) +- Social Icons: Add icon & background color options. ([28084](https://github.com/WordPress/gutenberg/pull/28084)) +- Support both horizontal and vertical in-between inserters. ([27860](https://github.com/WordPress/gutenberg/pull/27860)) +- Image Block: Add border radius support. ([27667](https://github.com/WordPress/gutenberg/pull/27667)) +- Overlay on disabled elements, to catch events and show tooltips. ([27529](https://github.com/WordPress/gutenberg/pull/27529)) +- Try: System font for vanilla editor styles. ([26822](https://github.com/WordPress/gutenberg/pull/26822)) +- Only consider legal block types for the block list when transforming files to blocks. ([26816](https://github.com/WordPress/gutenberg/pull/26816)) + +### New APIs + +- Block API: Allow overriding the category for block variations. ([28482](https://github.com/WordPress/gutenberg/pull/28482)) +- Create Block: Add optional support for wp-env. ([28234](https://github.com/WordPress/gutenberg/pull/28234)) +- Make i18n functions filter their return values. ([27966](https://github.com/WordPress/gutenberg/pull/27966)) + +### Breaking Change + +The [format](https://developer.wordpress.org/block-editor/developers/themes/theme-json/) of the `experimental-theme.json` has been updated as per + +- Split global block selector into root and defaults. ([28533](https://github.com/WordPress/gutenberg/pull/28533)) +- Make settings and style top-level keys. ([28110](https://github.com/WordPress/gutenberg/pull/28110)) + +Before: + +```json +{ + "global": { + "settings": { ... }, + "styles": { ... } + }, + "core/paragraph": { + "settings": { ... }, + "styles": { ... } + } +} +``` + +After: + +```json +{ + "settings": { + "defaults": { ... }, + "root": { ... }, + "core/paragraph": { ... } + }, + "styles": { + "root": { ... }, + "core/paragraph": { ... } + } +} +``` + +### Bug Fixes + +- Fix sibling inserter color. ([28579](https://github.com/WordPress/gutenberg/pull/28579)) +- Fix issues causing the cover block to black out with a fixed background. ([28565](https://github.com/WordPress/gutenberg/pull/28565)) +- Fix site editor pins. ([28547](https://github.com/WordPress/gutenberg/pull/28547)) +- Resolve issue where insertion point is in incorrect position after changing block selection. ([28542](https://github.com/WordPress/gutenberg/pull/28542)) +- Components: Fix truncate export. ([28527](https://github.com/WordPress/gutenberg/pull/28527)) +- Pinned items regression followup. ([28526](https://github.com/WordPress/gutenberg/pull/28526)) +- Fix regression with pinned plugin items on mobile. ([28521](https://github.com/WordPress/gutenberg/pull/28521)) +- Fix margins and width of 100%-width buttons. ([28467](https://github.com/WordPress/gutenberg/pull/28467)) +- Fix regression caused by #28395. ([28462](https://github.com/WordPress/gutenberg/pull/28462)) +- Fix aborted rendering of non-nested reusable blocks. ([28461](https://github.com/WordPress/gutenberg/pull/28461)) +- Show insertion point after the last block in a container. ([28418](https://github.com/WordPress/gutenberg/pull/28418)) +- Reusable blocks: Prevent infinite recursion. ([28405](https://github.com/WordPress/gutenberg/pull/28405)) +- Fix block inserter automatic reorder. ([28392](https://github.com/WordPress/gutenberg/pull/28392)) +- Create Block: Extract the package name from the template value. ([28383](https://github.com/WordPress/gutenberg/pull/28383)) +- Fix handling of raw transforms that return multiple blocks. ([28371](https://github.com/WordPress/gutenberg/pull/28371)) +- Fix repeated backgrounds with transparent images. ([28362](https://github.com/WordPress/gutenberg/pull/28362)) +- Ensure inline image width popover doesn't appear over media library modal. ([28333](https://github.com/WordPress/gutenberg/pull/28333)) +- Fix bad var name in BlockParentSelector. ([28325](https://github.com/WordPress/gutenberg/pull/28325)) +- Fix repeated backgrounds for cover srcset. ([28310](https://github.com/WordPress/gutenberg/pull/28310)) +- Simple wording fix. ([28288](https://github.com/WordPress/gutenberg/pull/28288)) +- Fix allowedFormats in RichText component. ([28282](https://github.com/WordPress/gutenberg/pull/28282)) +- Fix file formatting for end-to-end test plugin. ([28266](https://github.com/WordPress/gutenberg/pull/28266)) +- Fix backwards compatibility issue with Inline Image format. ([28223](https://github.com/WordPress/gutenberg/pull/28223)) +- Inserter: Fix left padding on Block Pattern Inserter dropdown. ([28150](https://github.com/WordPress/gutenberg/pull/28150)) +- Fix toolbar keyboard navigation after pressing alt+F10. ([28068](https://github.com/WordPress/gutenberg/pull/28068)) +- Image Block: Update linkDestination when editing image link URL. ([27801](https://github.com/WordPress/gutenberg/pull/27801)) +- Fix for: [Interface Skeleton] Limit the editor width to prevent some blocks to grow infinitely wide. ([27695](https://github.com/WordPress/gutenberg/pull/27695)) +- Button component: Add margin around the dash icon. ([27461](https://github.com/WordPress/gutenberg/pull/27461)) +- Fix issue where resetBlocks can result in an incorrect block selection. ([21598](https://github.com/WordPress/gutenberg/pull/21598)) + +### Experiments + +- Try: Fix menu item word wrap. ([28516](https://github.com/WordPress/gutenberg/pull/28516)) +- Fix URL cutoff. ([28515](https://github.com/WordPress/gutenberg/pull/28515)) +- Mark Post Comments Warning as block. ([28511](https://github.com/WordPress/gutenberg/pull/28511)) +- Add widget id to blocks in the widgets screen. ([28379](https://github.com/WordPress/gutenberg/pull/28379)) +- Remove new navigation block features in the navigation editor. ([28378](https://github.com/WordPress/gutenberg/pull/28378)) +- Full Site Editing: Update theme attribute injection and removal. ([28368](https://github.com/WordPress/gutenberg/pull/28368)) +- Template Part - fix labels shown - use title instead of slug. ([28330](https://github.com/WordPress/gutenberg/pull/28330)) +- Root element & border radius. ([28320](https://github.com/WordPress/gutenberg/pull/28320)) +- FSE: Parse the template before gets rendered. ([28319](https://github.com/WordPress/gutenberg/pull/28319)) +- Site Editor: Use correct title property in snackbar after inserting Template Part. ([28306](https://github.com/WordPress/gutenberg/pull/28306)) +- Edit Site: Fix templates export. ([28292](https://github.com/WordPress/gutenberg/pull/28292)) +- Hide query block toolbar settings if query is inherited. ([28290](https://github.com/WordPress/gutenberg/pull/28290)) +- Site Editor: Add template part missing state. ([28277](https://github.com/WordPress/gutenberg/pull/28277)) +- Site Editor: Hide resize handle. ([28272](https://github.com/WordPress/gutenberg/pull/28272)) +- Fix save, undo and redo keyboard shortcuts in navigation editor. ([28257](https://github.com/WordPress/gutenberg/pull/28257)) +- Fix template part border states. ([28241](https://github.com/WordPress/gutenberg/pull/28241)) +- Fix entity spotlight system. ([28239](https://github.com/WordPress/gutenberg/pull/28239)) +- Fix the nav menu justify controls menu style. ([28222](https://github.com/WordPress/gutenberg/pull/28222)) +- Polish the appender focus style. ([28219](https://github.com/WordPress/gutenberg/pull/28219)) +- Core Data: Add __experimentalBatch(). ([28210](https://github.com/WordPress/gutenberg/pull/28210)) +- Post Title block: Add placeholder state. ([28198](https://github.com/WordPress/gutenberg/pull/28198)) +- Fix navigation editor error. ([28190](https://github.com/WordPress/gutenberg/pull/28190)) +- Try: Allow space between on menu items. ([28169](https://github.com/WordPress/gutenberg/pull/28169)) +- Query pagination with InnerBlocks. ([28125](https://github.com/WordPress/gutenberg/pull/28125)) +- Template Parts: Fix loading issue. ([28088](https://github.com/WordPress/gutenberg/pull/28088)) +- Add support for border configuration via theme.json. ([28049](https://github.com/WordPress/gutenberg/pull/28049)) +- [Widgets screen] Fix categorization not showing in the global inserter. ([28036](https://github.com/WordPress/gutenberg/pull/28036)) +- Update the layout of the title in the top bar while template editing. ([27845](https://github.com/WordPress/gutenberg/pull/27845)) +- Expose group/ungroup buttons in site editor. ([27611](https://github.com/WordPress/gutenberg/pull/27611)) +- Disable alignment for innerBlocks of Nav Block. ([27365](https://github.com/WordPress/gutenberg/pull/27365)) +- Add thunk actions to replace rungen and controls. ([27276](https://github.com/WordPress/gutenberg/pull/27276)) +- Navigation Block: Placeholder empty state. ([26947](https://github.com/WordPress/gutenberg/pull/26947)) +- Open dropdown before focus on submenu item. ([25322](https://github.com/WordPress/gutenberg/pull/25322)) + +### Documentation + +- Docs: Add new page for i18n filters. ([28553](https://github.com/WordPress/gutenberg/pull/28553)) +- Docs: Update list of core block categories. ([28483](https://github.com/WordPress/gutenberg/pull/28483)) +- Fixed gramatical error. ([28452](https://github.com/WordPress/gutenberg/pull/28452)) +- Update the main readme with the current Gutenberg project phase. ([28359](https://github.com/WordPress/gutenberg/pull/28359)) +- Docs: Update links used in the developer portal. ([28354](https://github.com/WordPress/gutenberg/pull/28354)) +- Docs: Update links to reference HEAD instead of a specific branch. ([28331](https://github.com/WordPress/gutenberg/pull/28331)) +- Docs: Fix supports color gradient(s). ([28328](https://github.com/WordPress/gutenberg/pull/28328)) +- Chore: Add changelog for 28231. ([28232](https://github.com/WordPress/gutenberg/pull/28232)) +- Block Card: Update readme. ([28226](https://github.com/WordPress/gutenberg/pull/28226)) +- Improve the intro page of the Block Editor Handbook. ([28142](https://github.com/WordPress/gutenberg/pull/28142)) +- Update documentation to use allowedFormats instead of the deprecated formattingControls. ([25639](https://github.com/WordPress/gutenberg/pull/25639)) + +### Code Quality + +- Try: Polish block menu and show only fills when available. ([28486](https://github.com/WordPress/gutenberg/pull/28486)) +- Rename some template part icons. ([28458](https://github.com/WordPress/gutenberg/pull/28458)) +- Block Editor: Add hook: UseNoRecursiveRenders. ([28428](https://github.com/WordPress/gutenberg/pull/28428)) +- Coding Standards: Fix PHPCS warnings. ([28343](https://github.com/WordPress/gutenberg/pull/28343)) +- Change the way RTL styles get enqueued. ([28274](https://github.com/WordPress/gutenberg/pull/28274)) +- Remove code no longer necessary. ([28188](https://github.com/WordPress/gutenberg/pull/28188)) +- Update/simplify case transforms. ([28171](https://github.com/WordPress/gutenberg/pull/28171)) +- Fix non static method WP_Block_Parser::Freeform called statically. ([28017](https://github.com/WordPress/gutenberg/pull/28017)) +- Refactor out CSS gradient from custom-gradient-bar. ([27936](https://github.com/WordPress/gutenberg/pull/27936)) + +### Tools + +- Dependencies: Upgrade TypeScript. ([28586](https://github.com/WordPress/gutenberg/pull/28586)) +- ESLint Plugin: Add missing eslint-plugin-import dependency. ([28545](https://github.com/WordPress/gutenberg/pull/28545)) +- Wp-env: Add MySQL port info to start logs. ([28441](https://github.com/WordPress/gutenberg/pull/28441)) +- Run the load time indicator computation multiple times. ([28419](https://github.com/WordPress/gutenberg/pull/28419)) +- Don't add default-custom-properties styles to all compiled files. ([28395](https://github.com/WordPress/gutenberg/pull/28395)) +- Fix typewriter test by using mouse.wheel and waiting for scroll. ([28376](https://github.com/WordPress/gutenberg/pull/28376)) +- Fix end-to-end tests in widgets screen. ([28375](https://github.com/WordPress/gutenberg/pull/28375)) +- Replace deprecated waitFor in end-to-end tests. ([28360](https://github.com/WordPress/gutenberg/pull/28360)) +- Improve robustness of nav screen test. ([28344](https://github.com/WordPress/gutenberg/pull/28344)) +- Preferences modal redesign. ([28329](https://github.com/WordPress/gutenberg/pull/28329)) +- Site Editor: Add end-to-end tests for templates export. ([28324](https://github.com/WordPress/gutenberg/pull/28324)) +- Site Editor: Add unit test for site templates export. ([28323](https://github.com/WordPress/gutenberg/pull/28323)) +- Fix widgets screen end-to-end tests. ([28264](https://github.com/WordPress/gutenberg/pull/28264)) +- Add more tests for processing theme.json logic. ([28202](https://github.com/WordPress/gutenberg/pull/28202)) +- Update nosolosw notifs. ([28189](https://github.com/WordPress/gutenberg/pull/28189)) +- Remove @talldan from some codeowners paths. ([28182](https://github.com/WordPress/gutenberg/pull/28182)) +- Add stale issue workflow for issues with need info requested. ([28179](https://github.com/WordPress/gutenberg/pull/28179)) +- Custom script distclean to remove node_modules of all packages. ([28177](https://github.com/WordPress/gutenberg/pull/28177)) +- Add some basic end-to-end tests for the widgets screen. ([28160](https://github.com/WordPress/gutenberg/pull/28160)) +- Testing: Add CI workflow covering Node.js 12. ([28139](https://github.com/WordPress/gutenberg/pull/28139)) +- wp-env: Fix upload directory conflict in phpunit service. ([28120](https://github.com/WordPress/gutenberg/pull/28120)) +- Update issue templates. ([27570](https://github.com/WordPress/gutenberg/pull/27570)) + +### Various + +- Make custom spacing work with core. ([28548](https://github.com/WordPress/gutenberg/pull/28548)) +- Component System: Add Grid Component. ([28531](https://github.com/WordPress/gutenberg/pull/28531)) +- Block Validation: Allow unitless zero CSS lengths. ([28501](https://github.com/WordPress/gutenberg/pull/28501)) +- Add check for zero to the FocalPointPicker mediaRef which prevents a division by zero error. ([28499](https://github.com/WordPress/gutenberg/pull/28499)) +- Social Link: Add a class to the anchor element. ([28494](https://github.com/WordPress/gutenberg/pull/28494)) +- Components: Integrate G2 Text component. ([28475](https://github.com/WordPress/gutenberg/pull/28475)) +- Block Mover wording: 'Move block position' to 'Change block position'. ([28454](https://github.com/WordPress/gutenberg/pull/28454)) +- [Documentation] : Fixing grammar. ([28447](https://github.com/WordPress/gutenberg/pull/28447)) +- Docs: Update tree and raw-content links to reference HEAD instead of a specific branch. ([28431](https://github.com/WordPress/gutenberg/pull/28431)) +- Image: Add flow for converting to cover block from toolbar. ([28414](https://github.com/WordPress/gutenberg/pull/28414)) +- Cover: Improve various states. ([28384](https://github.com/WordPress/gutenberg/pull/28384)) +- Update HTML Anchor description to refer to block instead of heading. ([28367](https://github.com/WordPress/gutenberg/pull/28367)) +- Packages: Use canary flag for npm releases with next dist tag. ([28357](https://github.com/WordPress/gutenberg/pull/28357)) +- Packages: Fully automate npm publishing with the latest and next tags. ([28335](https://github.com/WordPress/gutenberg/pull/28335)) +- CODEOWNERS: Tweak for ella. ([28326](https://github.com/WordPress/gutenberg/pull/28326)) +- Block Transform: Fix isMultiBlock property name. ([28321](https://github.com/WordPress/gutenberg/pull/28321)) +- Warning component: Remove extra margin. ([28316](https://github.com/WordPress/gutenberg/pull/28316)) +- Block Directory: Silently avoid re-installing local blocks. ([28304](https://github.com/WordPress/gutenberg/pull/28304)) +- Inserter: Add description to content used in search. ([28301](https://github.com/WordPress/gutenberg/pull/28301)) +- Try: Show reusable block parent border when child selected. ([28283](https://github.com/WordPress/gutenberg/pull/28283)) +- Components: Update dependencies shared with G2 components. ([28280](https://github.com/WordPress/gutenberg/pull/28280)) +- Try: Zero width space in empty paragraph. ([28268](https://github.com/WordPress/gutenberg/pull/28268)) +- Alow setting the crossOrigin attribute for the image transform's image using a filter. ([28255](https://github.com/WordPress/gutenberg/pull/28255)) +- Navigation component: Fix button outline. ([28230](https://github.com/WordPress/gutenberg/pull/28230)) +- Components: Add truncate. ([28176](https://github.com/WordPress/gutenberg/pull/28176)) +- Add panel button props. ([28147](https://github.com/WordPress/gutenberg/pull/28147)) +- Add "Show block breadcrumbs" preference. ([28133](https://github.com/WordPress/gutenberg/pull/28133)) +- NavigationMenu component: Add isSearchDebouncing prop. ([28102](https://github.com/WordPress/gutenberg/pull/28102)) +- Try: Make empty paragraphs take up the same space on the frontend, as in the editor. ([27995](https://github.com/WordPress/gutenberg/pull/27995)) +- Change the block editor inserter quick inserter border color. ([27866](https://github.com/WordPress/gutenberg/pull/27866)) +- Save editors value on change. ([27717](https://github.com/WordPress/gutenberg/pull/27717)) +- Component System: Upgrade FontSizePicker. ([27594](https://github.com/WordPress/gutenberg/pull/27594)) +- Adjust borders on gallery to prevent overlap. ([27312](https://github.com/WordPress/gutenberg/pull/27312)) +- Pattern Directory: Create endpoints to proxy api.w.org/patterns. ([26578](https://github.com/WordPress/gutenberg/pull/26578)) +- Show text labels in block toolbars when option is set. ([26135](https://github.com/WordPress/gutenberg/pull/26135)) +- Block Directory: Filter out disallowed blocks before showing available blocks. ([25926](https://github.com/WordPress/gutenberg/pull/25926)) + + + + = 9.8.2 = ### Bug Fixes diff --git a/gutenberg.php b/gutenberg.php index a29903a341f3aa..3edf2723c8bc55 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.8.2 + * Version: 9.9.0-rc.1 * Author: Gutenberg Team * Text Domain: gutenberg * diff --git a/package-lock.json b/package-lock.json index 593b8323a19f60..eaff7a4fd13441 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "9.8.2", + "version": "9.9.0-rc.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 96df6b474a836e..c667de06a5e0eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "9.8.2", + "version": "9.9.0-rc.1", "private": true, "description": "A new WordPress editor experience.", "author": "The WordPress Contributors", diff --git a/readme.txt b/readme.txt index 46e099c5439155..9ea09cdf48d807 100644 --- a/readme.txt +++ b/readme.txt @@ -57,4 +57,4 @@ View release page. +To read the changelog for Gutenberg 9.9.0-rc.1, please navigate to the release page. From bff5496fef9a1278df98c096824c534055e12c58 Mon Sep 17 00:00:00 2001 From: flootr Date: Mon, 1 Feb 2021 17:37:15 +0100 Subject: [PATCH 02/23] add `minHeightUnit` to latest core/cover deprecation (#28627) Co-authored-by: Jon Surrell --- packages/block-library/CHANGELOG.md | 4 ++ .../block-library/src/cover/deprecated.js | 3 ++ .../blocks/core__cover__deprecated-6.html | 12 ++++++ .../blocks/core__cover__deprecated-6.json | 36 ++++++++++++++++ .../core__cover__deprecated-6.parsed.json | 41 +++++++++++++++++++ .../core__cover__deprecated-6.serialized.html | 6 +++ 6 files changed, 102 insertions(+) diff --git a/packages/block-library/CHANGELOG.md b/packages/block-library/CHANGELOG.md index 3a0624b02baa1f..29cb6c7cfd2517 100644 --- a/packages/block-library/CHANGELOG.md +++ b/packages/block-library/CHANGELOG.md @@ -6,6 +6,10 @@ - Allow setting the `crossOrigin` attribute so the `useTransformImage` hook can use cross-origin sources ([#28255](https://github.com/WordPress/gutenberg/pull/28255/)). +### Bug Fixes + +- Fix a regression where the Cover block migration would not work with custom units for `minHeight` ([#28627](https://github.com/WordPress/gutenberg/pull/28627)) + ## 2.27.0 (2020-12-17) ### Enhancement diff --git a/packages/block-library/src/cover/deprecated.js b/packages/block-library/src/cover/deprecated.js index b214f3e0ce3ae0..a3bab8926aba56 100644 --- a/packages/block-library/src/cover/deprecated.js +++ b/packages/block-library/src/cover/deprecated.js @@ -79,6 +79,9 @@ const deprecated = [ minHeight: { type: 'number', }, + minHeightUnit: { + type: 'string', + }, gradient: { type: 'string', }, diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html index 00094d59af0fa8..79f8a553b77af0 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html @@ -12,3 +12,15 @@ + +
+
+ +

+ +
+
+ diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json index 4709d0adb36708..5a2d306553d614 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json @@ -29,5 +29,41 @@ } ], "originalContent": "\n\t
\n\t\t\n\t
\n" + }, + { + "clientId": "_clientId_1", + "name": "core/cover", + "isValid": true, + "attributes": { + "url": "https://example.com/some-background-image.png", + "id": 1933, + "hasParallax": false, + "dimRatio": 0, + "backgroundType": "image", + "focalPoint": { + "x": "0.50", + "y": "0.40" + }, + "title": "", + "contentAlign": "center", + "isRepeated": false, + "minHeight": 48, + "minHeightUnit": "vw", + "className": "alignfull" + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "", + "dropCap": false + }, + "innerBlocks": [], + "originalContent": "

" + } + ], + "originalContent": "\n\t
\n\t\t\n\t
\n" } ] diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json index c38b616c41d0d7..cb1f14786bf34e 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json @@ -27,6 +27,47 @@ "\n\t\n\n" ] }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + }, + { + "blockName": "core/cover", + "attrs": { + "url": "https://example.com/some-background-image.png", + "id": 1933, + "dimRatio": 0, + "focalPoint": { + "x": "0.50", + "y": "0.40" + }, + "minHeight": 48, + "minHeightUnit": "vw", + "align": "full" + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\t\t

\n\t\t", + "innerContent": [ + "\n\t\t

\n\t\t" + ] + } + ], + "innerHTML": "\n\n\t
\n\t\t\n\t
\n\n", + "innerContent": [ + "\n\n\t
\n\t\t", + null, + "\n\t
\n\n" + ] + }, { "blockName": null, "attrs": {}, diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html index b9dfae00e3e660..f079f578eca39d 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html @@ -5,3 +5,9 @@

+ + +
+

+
+ From 34d83385a0b1095f3097b6e180d980c2a36e2719 Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Wed, 3 Feb 2021 13:49:33 +0100 Subject: [PATCH 03/23] Try: Cover position fix round 2 (#28653) --- packages/block-library/src/embed/style.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/block-library/src/embed/style.scss b/packages/block-library/src/embed/style.scss index 05b2f5f8081648..4099b1bda010f2 100644 --- a/packages/block-library/src/embed/style.scss +++ b/packages/block-library/src/embed/style.scss @@ -13,6 +13,12 @@ } } +// Supply a min-width when inside a cover block, to prevent it from collapsing. +.wp-block-cover .wp-block-embed { + min-width: 320px; + min-height: 240px; +} + .wp-block-embed { // Supply caption styles to embeds, even if the theme hasn't opted in. // Reason being: the new markup, figcaptions, are not likely to be styled in the majority of existing themes, From f7abb2272572a332d8f332c3b17fbf0a06a00047 Mon Sep 17 00:00:00 2001 From: Jeremy Yip Date: Thu, 4 Feb 2021 12:27:10 -0800 Subject: [PATCH 04/23] Full Site Editing: Fix template parts not loading in frontend (#28752) --- packages/block-library/src/template-part/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/template-part/index.php b/packages/block-library/src/template-part/index.php index a960aa969bc906..40e7312bcb8adc 100644 --- a/packages/block-library/src/template-part/index.php +++ b/packages/block-library/src/template-part/index.php @@ -19,7 +19,7 @@ function render_block_core_template_part( $attributes ) { // If we have a post ID and the post exists, which means this template part // is user-customized, render the corresponding post content. $content = get_post( $attributes['postId'] )->post_content; - } elseif ( isset( $attributes['theme'] ) && basename( wp_get_theme()->get_stylesheet() ) === $attributes['theme'] ) { + } elseif ( isset( $attributes['theme'] ) && wp_get_theme()->get_stylesheet() === $attributes['theme'] ) { $template_part_query = new WP_Query( array( 'post_type' => 'wp_template_part', From 44ace23de92169e1a6a41af9c96b311917d9e99e Mon Sep 17 00:00:00 2001 From: Addison Stavlo Date: Mon, 1 Feb 2021 13:41:02 -0500 Subject: [PATCH 05/23] Fix e2e failures on 'Front Page' template. (#28638) Attempting to fix e2e failures on a "Front Page" template selector. It looks like tt1-blocks no longer supplies a front-page template, and using Index should work as the tests were not reliant on the specific template. --- .../specs/experiments/multi-entity-editing.test.js | 6 +++--- .../e2e-tests/specs/experiments/multi-entity-saving.test.js | 4 ++-- packages/e2e-tests/specs/experiments/template-part.test.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js b/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js index f395fa223c03d2..fb200ce93a6b37 100644 --- a/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js +++ b/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js @@ -144,10 +144,10 @@ describe( 'Multi-entity editor states', () => { // Wait for blocks to load. await canvas().waitForSelector( '.wp-block' ); expect( await isEntityDirty( 'header' ) ).toBe( false ); - expect( await isEntityDirty( 'front-page' ) ).toBe( false ); + expect( await isEntityDirty( 'Index' ) ).toBe( false ); // Switch back and make sure it is still clean. - await clickTemplateItem( 'Templates', 'Front Page' ); + await clickTemplateItem( 'Templates', 'Index' ); await page.waitForFunction( () => Array.from( window.frames ).find( ( { name } ) => name === 'editor-canvas' @@ -155,7 +155,7 @@ describe( 'Multi-entity editor states', () => { ); await canvas().waitForSelector( '.wp-block' ); expect( await isEntityDirty( 'header' ) ).toBe( false ); - expect( await isEntityDirty( 'front-page' ) ).toBe( false ); + expect( await isEntityDirty( 'Index' ) ).toBe( false ); removeErrorMocks(); } ); diff --git a/packages/e2e-tests/specs/experiments/multi-entity-saving.test.js b/packages/e2e-tests/specs/experiments/multi-entity-saving.test.js index c1816b5b7b1ed2..dc494849089ad3 100644 --- a/packages/e2e-tests/specs/experiments/multi-entity-saving.test.js +++ b/packages/e2e-tests/specs/experiments/multi-entity-saving.test.js @@ -186,11 +186,11 @@ describe( 'Multi-entity save flow', () => { // Navigate to site editor. await siteEditor.visit(); - // Ensure we are on 'front-page' demo template. + // Ensure we are on 'index' template. await navigationPanel.open(); await navigationPanel.backToRoot(); await navigationPanel.navigate( 'Templates' ); - await navigationPanel.clickItemByText( 'Front Page' ); + await navigationPanel.clickItemByText( 'Index' ); await navigationPanel.close(); // Click the first block so that the template part inserts in the right place. diff --git a/packages/e2e-tests/specs/experiments/template-part.test.js b/packages/e2e-tests/specs/experiments/template-part.test.js index b346a5a9bcaced..14745607c5d253 100644 --- a/packages/e2e-tests/specs/experiments/template-part.test.js +++ b/packages/e2e-tests/specs/experiments/template-part.test.js @@ -53,11 +53,11 @@ describe( 'Template Part', () => { '.edit-site-save-button__button:not(.is-busy)' ); - // Switch back to the front page template. + // Switch back to the Index template. await navigationPanel.open(); await navigationPanel.backToRoot(); await navigationPanel.navigate( 'Templates' ); - await navigationPanel.clickItemByText( 'Front Page' ); + await navigationPanel.clickItemByText( 'Index' ); await navigationPanel.close(); } From d8b50ae42e2c158a34878a1c84385dcc3e100f9e Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Fri, 5 Feb 2021 16:28:49 +1100 Subject: [PATCH 06/23] Bump plugin version to 9.9.0 --- changelog.txt | 6 +++--- gutenberg.php | 2 +- package-lock.json | 2 +- package.json | 2 +- readme.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index 0f9f6e78e420a9..24d21f521330b3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ == Changelog == -= 9.9.0-rc.1 = += 9.9.0 = ### Enhancements @@ -92,6 +92,8 @@ After: - Fix for: [Interface Skeleton] Limit the editor width to prevent some blocks to grow infinitely wide. ([27695](https://github.com/WordPress/gutenberg/pull/27695)) - Button component: Add margin around the dash icon. ([27461](https://github.com/WordPress/gutenberg/pull/27461)) - Fix issue where resetBlocks can result in an incorrect block selection. ([21598](https://github.com/WordPress/gutenberg/pull/21598)) +- Fix Cover block position. ([28653](https://github.com/WordPress/gutenberg/pull/28653)) +- Add minHeightUnit to latest core/cover deprecation. ([28627](https://github.com/WordPress/gutenberg/pull/28627)) ### Experiments @@ -220,8 +222,6 @@ After: - Block Directory: Filter out disallowed blocks before showing available blocks. ([25926](https://github.com/WordPress/gutenberg/pull/25926)) - - = 9.8.2 = ### Bug Fixes diff --git a/gutenberg.php b/gutenberg.php index 3edf2723c8bc55..57d270016615fa 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.9.0-rc.1 + * Version: 9.9.0 * Author: Gutenberg Team * Text Domain: gutenberg * diff --git a/package-lock.json b/package-lock.json index eaff7a4fd13441..97b50f9db5eb01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "9.9.0-rc.1", + "version": "9.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c667de06a5e0eb..06838944e1f5a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "9.9.0-rc.1", + "version": "9.9.0", "private": true, "description": "A new WordPress editor experience.", "author": "The WordPress Contributors", diff --git a/readme.txt b/readme.txt index 9ea09cdf48d807..ec1f8451be7f63 100644 --- a/readme.txt +++ b/readme.txt @@ -57,4 +57,4 @@ View release page. +To read the changelog for Gutenberg 9.9.0, please navigate to the release page. From 9ac8c55a9cc3872a997a201784164fb916daf575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Fri, 5 Feb 2021 08:55:28 +0100 Subject: [PATCH 07/23] Fix global styles in iframed site editor (#28731) --- .../src/components/iframe/index.js | 37 ++++++++++++++++++- .../src/components/block-editor/index.js | 5 ++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/iframe/index.js b/packages/block-editor/src/components/iframe/index.js index 1407ad0bdc73d1..32366d1e3863ec 100644 --- a/packages/block-editor/src/components/iframe/index.js +++ b/packages/block-editor/src/components/iframe/index.js @@ -2,6 +2,8 @@ * External dependencies */ import mergeRefs from 'react-merge-refs'; +import { compact, map } from 'lodash'; +import tinycolor from 'tinycolor2'; /** * WordPress dependencies @@ -10,10 +12,16 @@ import { useState, createPortal, useCallback, + useEffect, forwardRef, } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; +/** + * Internal dependencies + */ +import transformStyles from '../../utils/transform-styles'; + const BODY_CLASS_NAME = 'editor-styles-wrapper'; const BLOCK_PREFIX = 'wp-block'; @@ -136,9 +144,35 @@ function setHead( doc, head ) { '' + head; } -function Iframe( { contentRef, children, head, ...props }, ref ) { +function updateEditorStyles( doc, styles ) { + if ( ! doc ) { + return; + } + + const backgroundColor = window + .getComputedStyle( doc.body, null ) + .getPropertyValue( 'background-color' ); + if ( tinycolor( backgroundColor ).getLuminance() > 0.5 ) { + doc.body.classList.remove( 'is-dark-theme' ); + } else { + doc.body.classList.add( 'is-dark-theme' ); + } + + const updatedStyles = transformStyles( styles, '.editor-styles-wrapper' ); + map( compact( updatedStyles ), ( updatedStyle ) => { + const styleElement = doc.createElement( 'style' ); + styleElement.innerHTML = updatedStyle; + doc.body.appendChild( styleElement ); + } ); +} + +function Iframe( { contentRef, editorStyles, children, head, ...props }, ref ) { const [ iframeDocument, setIframeDocument ] = useState(); + useEffect( () => { + updateEditorStyles( iframeDocument, editorStyles ); + }, [ editorStyles ] ); + const setRef = useCallback( ( node ) => { if ( ! node ) { return; @@ -157,6 +191,7 @@ function Iframe( { contentRef, children, head, ...props }, ref ) { setHead( contentDocument, head ); setBodyClassName( contentDocument ); styleSheetsCompat( contentDocument ); + updateEditorStyles( contentDocument, editorStyles ); bubbleEvents( contentDocument ); setBodyClassName( contentDocument ); diff --git a/packages/edit-site/src/components/block-editor/index.js b/packages/edit-site/src/components/block-editor/index.js index c0b1ca9e00180e..dcc210d4a609d2 100644 --- a/packages/edit-site/src/components/block-editor/index.js +++ b/packages/edit-site/src/components/block-editor/index.js @@ -69,7 +69,9 @@ export default function BlockEditor( { setIsInserterOpen } ) { const contentRef = useRef(); useMouseMoveTypingReset( ref ); - // Ideally this should be moved to the place where the styles are applied (iframe) + // This updates the host document styles. + // It is necessary to make sure the preset CSS Custom Properties + // are in scope for the sidebar UI controls that use them. const editorStylesRef = useEditorStyles( settings.styles ); // Allow scrolling "through" popovers over the canvas. This is only called @@ -111,6 +113,7 @@ export default function BlockEditor( { setIsInserterOpen } ) { ); } diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index 2d92fe962aadef..6673cc4cc6bc01 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -95,7 +95,7 @@ export { useClipboardHandler as __unstableUseClipboardHandler, } from './copy-handler'; export { default as DefaultBlockAppender } from './default-block-appender'; -export { default as __unstableUseEditorStyles } from './editor-styles'; +export { default as __unstableEditorStyles } from './editor-styles'; export { default as Inserter } from './inserter'; export { default as __experimentalLibrary } from './inserter/library'; export { default as __experimentalSearchForm } from './inserter/search-form'; diff --git a/packages/edit-post/src/components/visual-editor/index.js b/packages/edit-post/src/components/visual-editor/index.js index 085e2b4233fb02..d28ce6fcf122b5 100644 --- a/packages/edit-post/src/components/visual-editor/index.js +++ b/packages/edit-post/src/components/visual-editor/index.js @@ -16,11 +16,10 @@ import { __experimentalBlockSettingsMenuFirstItem, __experimentalUseResizeCanvas as useResizeCanvas, __unstableUseCanvasClickRedirect as useCanvasClickRedirect, - __unstableUseEditorStyles as useEditorStyles, + __unstableEditorStyles as EditorStyles, } from '@wordpress/block-editor'; import { Popover } from '@wordpress/components'; import { useRef } from '@wordpress/element'; -import { useMergeRefs } from '@wordpress/compose'; /** * Internal dependencies @@ -59,14 +58,14 @@ export default function VisualEditor( { styles } ) { useClipboardHandler( ref ); useTypingObserver( ref ); useCanvasClickRedirect( ref ); - const editorStylesRef = useEditorStyles( styles ); return (
+
diff --git a/packages/edit-site/src/components/block-editor/index.js b/packages/edit-site/src/components/block-editor/index.js index dcc210d4a609d2..ac46ec0005da80 100644 --- a/packages/edit-site/src/components/block-editor/index.js +++ b/packages/edit-site/src/components/block-editor/index.js @@ -15,7 +15,7 @@ import { __unstableUseBlockSelectionClearer as useBlockSelectionClearer, __unstableUseTypingObserver as useTypingObserver, __unstableUseMouseMoveTypingReset as useMouseMoveTypingReset, - __unstableUseEditorStyles as useEditorStyles, + __unstableEditorStyles as EditorStyles, __unstableIframe as Iframe, } from '@wordpress/block-editor'; import { DropZoneProvider, Popover } from '@wordpress/components'; @@ -69,10 +69,6 @@ export default function BlockEditor( { setIsInserterOpen } ) { const contentRef = useRef(); useMouseMoveTypingReset( ref ); - // This updates the host document styles. - // It is necessary to make sure the preset CSS Custom Properties - // are in scope for the sidebar UI controls that use them. - const editorStylesRef = useEditorStyles( settings.styles ); // Allow scrolling "through" popovers over the canvas. This is only called // for as long as the pointer is over a popover. @@ -105,20 +101,16 @@ export default function BlockEditor( { setIsInserterOpen } ) { -
+
diff --git a/packages/edit-widgets/src/components/layout/interface.js b/packages/edit-widgets/src/components/layout/interface.js index 9b5211c13c9aac..3955abd4269469 100644 --- a/packages/edit-widgets/src/components/layout/interface.js +++ b/packages/edit-widgets/src/components/layout/interface.js @@ -7,10 +7,7 @@ import { useViewportMatch, } from '@wordpress/compose'; import { close } from '@wordpress/icons'; -import { - __experimentalLibrary as Library, - __unstableUseEditorStyles as useEditorStyles, -} from '@wordpress/block-editor'; +import { __experimentalLibrary as Library } from '@wordpress/block-editor'; import { useEffect } from '@wordpress/element'; import { useDispatch, useSelect } from '@wordpress/data'; import { @@ -45,13 +42,15 @@ function Interface( { blockEditorSettings } ) { ); const { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint(); - const { hasSidebarEnabled, isInserterOpened } = useSelect( ( select ) => ( { - hasSidebarEnabled: !! select( - interfaceStore - ).getActiveComplementaryArea( editWidgetsStore ), - isInserterOpened: !! select( editWidgetsStore ).isInserterOpened(), - } ) ); - const editorStylesRef = useEditorStyles( blockEditorSettings.styles ); + const { hasSidebarEnabled, isInserterOpened } = useSelect( + ( select ) => ( { + hasSidebarEnabled: !! select( + interfaceStore + ).getActiveComplementaryArea( editWidgetsStore.name ), + isInserterOpened: !! select( editWidgetsStore ).isInserterOpened(), + } ), + [] + ); // Inserter and Sidebars are mutually exclusive useEffect( () => { @@ -72,7 +71,6 @@ function Interface( { blockEditorSettings } ) { return ( } secondarySidebar={ diff --git a/packages/edit-widgets/src/components/widget-areas-block-editor-content/index.js b/packages/edit-widgets/src/components/widget-areas-block-editor-content/index.js index d8b6348c612b8b..5b878f3b7d93ef 100644 --- a/packages/edit-widgets/src/components/widget-areas-block-editor-content/index.js +++ b/packages/edit-widgets/src/components/widget-areas-block-editor-content/index.js @@ -8,6 +8,7 @@ import { BlockSelectionClearer, WritingFlow, ObserveTyping, + __unstableEditorStyles as EditorStyles, } from '@wordpress/block-editor'; /** @@ -16,9 +17,12 @@ import { import Notices from '../notices'; import KeyboardShortcuts from '../keyboard-shortcuts'; -export default function WidgetAreasBlockEditorContent() { +export default function WidgetAreasBlockEditorContent( { + blockEditorSettings, +} ) { return (
+ From 619d9f9ed03004a7269af409e92304836afbf609 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 11 Feb 2021 11:52:37 +0100 Subject: [PATCH 12/23] Cover: Add missing align support to deprecation (#28796) --- packages/block-library/src/cover/deprecated.js | 9 +++++++++ .../fixtures/blocks/core__cover__deprecated-6.json | 2 +- .../blocks/core__cover__deprecated-6.serialized.html | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/cover/deprecated.js b/packages/block-library/src/cover/deprecated.js index a3bab8926aba56..d3f1588944c1b9 100644 --- a/packages/block-library/src/cover/deprecated.js +++ b/packages/block-library/src/cover/deprecated.js @@ -89,6 +89,9 @@ const deprecated = [ type: 'string', }, }, + supports: { + align: true, + }, save( { attributes } ) { const { backgroundType, @@ -219,6 +222,9 @@ const deprecated = [ type: 'string', }, }, + supports: { + align: true, + }, save( { attributes } ) { const { backgroundType, @@ -322,6 +328,9 @@ const deprecated = [ type: 'string', }, }, + supports: { + align: true, + }, save( { attributes } ) { const { backgroundType, diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json index 5a2d306553d614..08423dc54bfb97 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json @@ -49,7 +49,7 @@ "isRepeated": false, "minHeight": 48, "minHeightUnit": "vw", - "className": "alignfull" + "align": "full" }, "innerBlocks": [ { diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html index f079f578eca39d..e2b0d685154624 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html @@ -6,7 +6,7 @@
- +

From 5ebb63b9b001a4967f1e0fac12499e5dd8efe9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Thu, 11 Feb 2021 14:52:46 +0100 Subject: [PATCH 13/23] Bump plugin version to 9.9.2 --- changelog.txt | 8 ++++++++ gutenberg.php | 2 +- package-lock.json | 2 +- package.json | 2 +- readme.txt | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 02683255bd17c3..860f5601399889 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,13 @@ == Changelog == += 9.9.2 = + +### Bug fixes + +- Remove duplication of editor styles ([28837](https://github.com/WordPress/gutenberg/pull/28837)) +- Add useMergeRefs hook ([27768](https://github.com/WordPress/gutenberg/pull/27768)) (dependency of 28837) +- Cover: add missing align attr to deprecation ([28796](https://github.com/WordPress/gutenberg/pull/28796)) + = 9.9.1 = ### Bug fixes diff --git a/gutenberg.php b/gutenberg.php index 9e50c6ca4a36f3..731127c427f249 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.9.1 + * Version: 9.9.2 * Author: Gutenberg Team * Text Domain: gutenberg * diff --git a/package-lock.json b/package-lock.json index 22c96db849cbb3..c1dd1512aced0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "9.9.1", + "version": "9.9.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bbfc8cf3e643c1..5caecca7f73c90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "9.9.1", + "version": "9.9.2", "private": true, "description": "A new WordPress editor experience.", "author": "The WordPress Contributors", diff --git a/readme.txt b/readme.txt index b1379cac55b05b..f47c2d56584ced 100644 --- a/readme.txt +++ b/readme.txt @@ -57,4 +57,4 @@ View release page. +To read the changelog for Gutenberg 9.9.2, please navigate to the release page. From c19973685fcd5afa195330e5565bd2b6d7bbb5b5 Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Mon, 1 Feb 2021 20:13:31 -0300 Subject: [PATCH 14/23] Add react-merge-refs to block-library --- packages/block-library/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/package.json b/packages/block-library/package.json index 7ec7394a5d8988..64cdec7d410ce0 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -61,6 +61,7 @@ "memize": "^1.1.0", "moment": "^2.22.1", "react-easy-crop": "^3.0.0", + "react-merge-refs": "^1.1.0", "tinycolor2": "^1.4.2" }, "publishConfig": { From d1b963d511899e412662fe6b86880b53481f3983 Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Mon, 1 Feb 2021 20:26:34 -0300 Subject: [PATCH 15/23] Add autohide hook to handle 'flex-wrapped' element --- packages/block-library/src/navigation/edit.js | 35 ++++++++++- .../block-library/src/navigation/style.scss | 41 ++++++++++++- .../src/navigation/use-autohide.js | 61 +++++++++++++++++++ 3 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 packages/block-library/src/navigation/use-autohide.js diff --git a/packages/block-library/src/navigation/edit.js b/packages/block-library/src/navigation/edit.js index c22be04525c8cd..f664745f80cf01 100644 --- a/packages/block-library/src/navigation/edit.js +++ b/packages/block-library/src/navigation/edit.js @@ -2,11 +2,12 @@ * External dependencies */ import classnames from 'classnames'; +import mergeRefs from 'react-merge-refs'; /** * WordPress dependencies */ -import { useState } from '@wordpress/element'; +import { useCallback, useRef, useState } from '@wordpress/element'; import { InnerBlocks, __experimentalUseInnerBlocksProps as useInnerBlocksProps, @@ -29,6 +30,7 @@ import { justifyRight, justifySpaceBetween, } from '@wordpress/icons'; +import useAutohide from './use-autohide'; import NavigationPlaceholder from './placeholder'; import PlaceholderPreview from './placeholder-preview'; @@ -57,12 +59,18 @@ function Navigation( { ! hasExistingNavItems ); + const navElement = useRef( null ); + const wrappedElementsContainer = useRef( null ); + const { selectBlock } = useDispatch( 'core/block-editor' ); + const [ isWrapping ] = useAutohide( navElement, wrappedElementsContainer ); + const blockProps = useBlockProps( { className: classnames( className, { [ `items-justified-${ attributes.itemsJustification }` ]: attributes.itemsJustification, 'is-vertical': attributes.orientation === 'vertical', + wrapping: isWrapping, } ), } ); @@ -101,6 +109,15 @@ function Navigation( { } ); + const mergedNavRefs = useCallback( + mergeRefs( [ blockProps.ref, navElement ] ), + [ blockProps.ref, navElement ] + ); + const mergedInnerBlocksRefs = useCallback( + mergeRefs( [ innerBlocksProps.ref, wrappedElementsContainer ] ), + [ innerBlocksProps.ref, wrappedElementsContainer ] + ); + if ( isPlaceholderShown ) { return (
@@ -200,8 +217,20 @@ function Navigation( { ) } -