Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/13.6" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gutenbergplugin committed Jun 29, 2022
1 parent 48d5f37 commit 84f2fe6
Show file tree
Hide file tree
Showing 515 changed files with 10,497 additions and 5,235 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,49 @@ module.exports = {
{
name: 'lodash',
importNames: [
'chunk',
'clamp',
'concat',
'defaultTo',
'differenceWith',
'dropRight',
'each',
'extend',
'findIndex',
'findKey',
'findLast',
'flatten',
'flattenDeep',
'isArray',
'isFinite',
'isFunction',
'isNil',
'isNumber',
'isObjectLike',
'isUndefined',
'keys',
'lowerCase',
'memoize',
'negate',
'noop',
'nth',
'once',
'overEvery',
'partialRight',
'random',
'reverse',
'size',
'stubFalse',
'stubTrue',
'sum',
'sumBy',
'take',
'toString',
'trim',
'truncate',
'uniqueId',
'uniqWith',
'values',
],
message:
'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.',
Expand Down
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"wp-content/plugins/gutenberg": ".",
"wp-content/mu-plugins": "./packages/e2e-tests/mu-plugins",
"wp-content/plugins/gutenberg-test-plugins": "./packages/e2e-tests/plugins",
"wp-content/themes/gutenberg-test-themes": "./packages/e2e-tests/themes"
"wp-content/themes/gutenberg-test-themes": "./test/gutenberg-test-themes"
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions bin/api-docs/gen-block-lib-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
const path = require( 'path' );
const glob = require( 'fast-glob' );
const fs = require( 'fs' );
const { keys } = require( 'lodash' );
/**
* Path to root project directory.
*
Expand Down Expand Up @@ -68,7 +67,11 @@ const TOKEN_PATTERN = new RegExp( START_TOKEN + '[^]*' + END_TOKEN );
* @return {string[]} Array of truthy keys
*/
function getTruthyKeys( obj ) {
return keys( obj )
if ( ! obj ) {
return [];
}

return Object.keys( obj )
.filter( ( key ) => ! key.startsWith( '__exp' ) )
.map( ( key ) => ( obj[ key ] ? key : `~~${ key }~~` ) );
}
Expand Down
15 changes: 14 additions & 1 deletion bin/api-docs/gen-theme-reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
const path = require( 'path' );
const fs = require( 'fs' );
const { keys } = require( 'lodash' );
/**
* Path to root project directory.
*
Expand Down Expand Up @@ -61,6 +60,20 @@ const TOKEN_PATTERN = new RegExp( START_TOKEN + '[^]*' + END_TOKEN );

const themejson = require( THEME_JSON_SCHEMA_FILE );

/**
* Convert object keys to an array.
* Gracefully handles non-object values.
*
* @param {*} maybeObject
* @return {Array} Object keys
*/
const keys = ( maybeObject ) => {
if ( typeof maybeObject !== 'object' ) {
return [];
}
return Object.keys( maybeObject );
};

/**
* Convert settings properties to markup.
*
Expand Down
6 changes: 4 additions & 2 deletions bin/packages/get-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
const fs = require( 'fs' );
const path = require( 'path' );
const { isEmpty, overEvery } = require( 'lodash' );
const { isEmpty } = require( 'lodash' );

/**
* Absolute path to packages directory.
Expand Down Expand Up @@ -54,7 +54,9 @@ function hasModuleField( file ) {
*
* @return {boolean} Whether to include file in build.
*/
const filterPackages = overEvery( isDirectory, hasModuleField );
function filterPackages( pkg ) {
return [ isDirectory, hasModuleField ].every( ( check ) => check( pkg ) );
}

/**
* Returns the absolute path of all WordPress packages
Expand Down
177 changes: 177 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,182 @@
== Changelog ==

= 13.5.1 =



## Changelog

### Bug Fixes

### Block Themes

- Global Styles: Add block CSS rules after the Global Styles rules. ([41934](https://github.com/WordPress/gutenberg/pull/41934))

## Contributors

The following contributors merged PRs in this release:

@scruffian


= 13.5.0 =

## Changelog

### Enhancements

#### Components
- Use NumberControl as input field. ([41472](https://github.com/WordPress/gutenberg/pull/41472))
- Convert component to TypeScript. ([41681](https://github.com/WordPress/gutenberg/pull/41681))
- RadioControl: Convert component to TypeScript. ([41568](https://github.com/WordPress/gutenberg/pull/41568))

#### Media
- Adds featured image toggle to media replace flow. ([41476](https://github.com/WordPress/gutenberg/pull/41476))
- Add tooltip on replace image's URL. ([41504](https://github.com/WordPress/gutenberg/pull/41504))

#### Block Library
- Cover: Adds placeholder when feature image is in use. ([41460](https://github.com/WordPress/gutenberg/pull/41460))
- Post Navigation Link: Add design controls (color, text decoration, and font family). ([41378](https://github.com/WordPress/gutenberg/pull/41378))

#### Block Editor
- Copy plain text variant of blocks. ([41366](https://github.com/WordPress/gutenberg/pull/41366))
- Adds CTA and external link to block inserter flow. ([41112](https://github.com/WordPress/gutenberg/pull/41112))

#### Global Styles
- Move CSS from the stylesheet to the block definition. ([41689](https://github.com/WordPress/gutenberg/pull/41689))

#### Document Settings
- Highlight today's date in DatePicker. ([41647](https://github.com/WordPress/gutenberg/pull/41647))

#### Design Tools
- Cover: Move overlay and opacity controls to color panel. ([41102](https://github.com/WordPress/gutenberg/pull/41102))

### Bug Fixes

#### Block Editor
- Preferences Panel: Filters hidden blocks to only count those which are still registered. ([41454](https://github.com/WordPress/gutenberg/pull/41454))

#### Components
- Avoid including null values in blocks list. ([41496](https://github.com/WordPress/gutenberg/pull/41496))
- CustomGradientBar: Fix insertion and control point positioning to more closely follow cursor. ([41492](https://github.com/WordPress/gutenberg/pull/41492))
- Fix `ComboboxControl` post-reset focus. ([41737](https://github.com/WordPress/gutenberg/pull/41737))
- FormTokenField: Added Padding to resolve close button overlap issue. ([41556](https://github.com/WordPress/gutenberg/pull/41556))
- Tooltip: Fix jitter at edge of screen by enabling __unstableShift. ([41524](https://github.com/WordPress/gutenberg/pull/41524))

#### Block Library
- Fix JS Error in Avatar Block. ([41354](https://github.com/WordPress/gutenberg/pull/41354))
- Query Loop: Render `replace` button only if eligible patterns exist. ([41690](https://github.com/WordPress/gutenberg/pull/41690))
- Comments Title: Plural has been used instead of single in 1st parameter. ([41521](https://github.com/WordPress/gutenberg/pull/41521))

#### Design Tools
- Fix CSS Selectors rendered by theme.json duotone/filter settings for blocks on public pages. ([41335](https://github.com/WordPress/gutenberg/pull/41335))
- Webfonts: Increase priority of init hook to account for block reregistration. ([41569](https://github.com/WordPress/gutenberg/pull/41569))

#### Template Editor
- Include theme's templates in template list in post editor. ([41630](https://github.com/WordPress/gutenberg/pull/41630))

#### Site Editor
- Theme variations UI: Ensure that equality check takes into account all default theme properties. ([41591](https://github.com/WordPress/gutenberg/pull/41591))

#### CSS & Styling
- Add utility classnames back to blocks that have layout attributes specified. ([41487](https://github.com/WordPress/gutenberg/pull/41487))
- Allow for zero values for CSS properties in the style engine. ([41561](https://github.com/WordPress/gutenberg/pull/41561))

### Accessibility

- Fix lack of context on action buttons and improve A11Y for the template action buttons Edit/New. ([41615](https://github.com/WordPress/gutenberg/pull/41615))
- Fix focus trap on certain input types. ([41538](https://github.com/WordPress/gutenberg/pull/41538))
- Add label to Preview options dropdown menu. ([41566](https://github.com/WordPress/gutenberg/pull/41566))

### Experiments

- Style engine: Add border to backend. ([40531](https://github.com/WordPress/gutenberg/pull/40531))
- Style engine: Elements backend support. ([40987](https://github.com/WordPress/gutenberg/pull/40987))
- Global styles: Merge block CSS with `theme.json` styles. ([34180](https://github.com/WordPress/gutenberg/pull/34180))

### Documentation

- Add missing CHANGELOG entry. ([41745](https://github.com/WordPress/gutenberg/pull/41745))
- Enhancements to TypeScript migration guidelines. ([41669](https://github.com/WordPress/gutenberg/pull/41669))
- Add step for build and asset file. ([41511](https://github.com/WordPress/gutenberg/pull/41511))
- Feature flag refresh. ([41522](https://github.com/WordPress/gutenberg/pull/41522))
- Update link title and add the correct URL. ([41666](https://github.com/WordPress/gutenberg/pull/41666))
- Fix typo in block schema description. ([41570](https://github.com/WordPress/gutenberg/pull/41570))

### Code Quality

- Entity-aware type signature for getEntityRecord and getEntityRecords. ([41235](https://github.com/WordPress/gutenberg/pull/41235))
- Improves the types of createHigherOrderComponent and its usages. ([41138](https://github.com/WordPress/gutenberg/pull/41138))
- ESLint: Restrict removed Lodash functions. ([41651](https://github.com/WordPress/gutenberg/pull/41651))
- TypeScript: Add default context types to Entity Records in core-data. ([41595](https://github.com/WordPress/gutenberg/pull/41595))
- TypeScript: Improve type definitions in @wordpress/core-data. ([41593](https://github.com/WordPress/gutenberg/pull/41593))
- RNMobile: Update clicks to use clickIfClickable() when possible. ([41367](https://github.com/WordPress/gutenberg/pull/41367))

#### Components
- Draggable: Add clarifying inline comment after the recent hook dependency changes. ([41658](https://github.com/WordPress/gutenberg/pull/41658))
- Limit `Dropdown` cleanup to renders where the menu has actually been opened. ([41604](https://github.com/WordPress/gutenberg/pull/41604))
- Placeholder: Add an illustration option to the Placeholder component. ([41605](https://github.com/WordPress/gutenberg/pull/41605))
- Refactor `CustomGradientBar` to pass `exhaustive-deps`. ([41463](https://github.com/WordPress/gutenberg/pull/41463))
- Refactor `DateDayPicker` to pass `exhaustive-deps`. ([41470](https://github.com/WordPress/gutenberg/pull/41470))
- Refactor `Flex` to pass `exhaustive-deps`. ([41507](https://github.com/WordPress/gutenberg/pull/41507))
- Refactor `FontSizePicker` to pass `exhaustive-deps`. ([41600](https://github.com/WordPress/gutenberg/pull/41600))
- Refactor `InputControl` to pass `exhaustive-deps`. ([41601](https://github.com/WordPress/gutenberg/pull/41601))
- Refactor `Modal` to pass `exhaustive-deps`. ([41610](https://github.com/WordPress/gutenberg/pull/41610))
- Refactor`Draggable` to pass `exhaustive-deps`. ([41499](https://github.com/WordPress/gutenberg/pull/41499))
- Refactor`Dropdown` to pass `exhaustive-deps`. ([41505](https://github.com/WordPress/gutenberg/pull/41505))
- Rewrite `<FormTokenField>` to functional component and Typescript. ([41216](https://github.com/WordPress/gutenberg/pull/41216))
- TreeSelect Convert to Typescript. ([41536](https://github.com/WordPress/gutenberg/pull/41536))
- ZStack: Convert component story to TypeScript and add inline documentation. ([41694](https://github.com/WordPress/gutenberg/pull/41694))

#### Block Library
- Clarify updateNavigationLinkBlockAttributes. ([41657](https://github.com/WordPress/gutenberg/pull/41657))
- Comment Author and Date blocks: Aligned editor markup with the frontend. ([41631](https://github.com/WordPress/gutenberg/pull/41631))
- Cover Block: Move components to variables so they can be shared. ([41742](https://github.com/WordPress/gutenberg/pull/41742))
- Split useNavigationMenu into bite-size functions and add unit tests. ([41139](https://github.com/WordPress/gutenberg/pull/41139))
- File, Search Blocks: Lower CSS specificity. ([41393](https://github.com/WordPress/gutenberg/pull/41393))

#### Document Settings
- Extract header used in PostVisibility and PublishDateTimePicker to a new InspectorPopoverHeader component. ([41362](https://github.com/WordPress/gutenberg/pull/41362))

#### Lodash
- Refactor various Lodash methods. ([41701](https://github.com/WordPress/gutenberg/pull/41701)), ([41626](https://github.com/WordPress/gutenberg/pull/41626)), ([41731](https://github.com/WordPress/gutenberg/pull/41731)), ([41635](https://github.com/WordPress/gutenberg/pull/41635)), ([41672](https://github.com/WordPress/gutenberg/pull/41672)), ([41703](https://github.com/WordPress/gutenberg/pull/41703)), ([41692](https://github.com/WordPress/gutenberg/pull/41692)), ([41653](https://github.com/WordPress/gutenberg/pull/41653)), ([41654](https://github.com/WordPress/gutenberg/pull/41654)), ([41624](https://github.com/WordPress/gutenberg/pull/41624)), ([41688](https://github.com/WordPress/gutenberg/pull/41688)), ([41702](https://github.com/WordPress/gutenberg/pull/41702)), ([41652](https://github.com/WordPress/gutenberg/pull/41652)), ([41674](https://github.com/WordPress/gutenberg/pull/41674)), ([41634](https://github.com/WordPress/gutenberg/pull/41634)), ([41633](https://github.com/WordPress/gutenberg/pull/41633)), ([41632](https://github.com/WordPress/gutenberg/pull/41632)), ([41629](https://github.com/WordPress/gutenberg/pull/41629)), ([41706](https://github.com/WordPress/gutenberg/pull/41706)), ([41625](https://github.com/WordPress/gutenberg/pull/41625)), ([41701](https://github.com/WordPress/gutenberg/pull/41701))
- Remove various lodash usages. ([41719](https://github.com/WordPress/gutenberg/pull/41719)), ([41687](https://github.com/WordPress/gutenberg/pull/41687))


### Tools

#### Build Tooling
- Bump caniuse-lite version. ([41675](https://github.com/WordPress/gutenberg/pull/41675))
- Update testing-library dependencies to latest version. ([41710](https://github.com/WordPress/gutenberg/pull/41710))
- Upgrade wp-prettier to 2.6.2. ([40542](https://github.com/WordPress/gutenberg/pull/40542))
- Package.json: Bump engines.node version to >=14. ([41599](https://github.com/WordPress/gutenberg/pull/41599))

#### Testing
- Fixed failing DateTimePicker Unit test. ([41483](https://github.com/WordPress/gutenberg/pull/41483))
- Remove snapshot from Post Editor Template Mode test and target expected string instead. ([41563](https://github.com/WordPress/gutenberg/pull/41563))
- Skip some of the Drag & Drop end-to-end on iOS. ([41529](https://github.com/WordPress/gutenberg/pull/41529))
- Add controlled unit test, use modern Testing Library features. ([41668](https://github.com/WordPress/gutenberg/pull/41668))

#### Components
- Storybook: Update to the version 6.5. ([41585](https://github.com/WordPress/gutenberg/pull/41585))

## First time contributors

The following PRs were merged by first time contributors:

- @FilipposZ: Block-Editor: Add tooltip on replace image's URL. ([41504](https://github.com/WordPress/gutenberg/pull/41504))
- @manzurahammed: Block Library: Fix JS Error in Avatar Block. ([41354](https://github.com/WordPress/gutenberg/pull/41354))
- @msurdi: Avoid including null values in blocks list. ([41496](https://github.com/WordPress/gutenberg/pull/41496))
- @sebastienserre: Plural has been used instead of single in 1st parameter. ([41521](https://github.com/WordPress/gutenberg/pull/41521))
- @tharsheblows: Docs: Add step for build and asset file. ([41511](https://github.com/WordPress/gutenberg/pull/41511))

## Contributors

The following contributors merged PRs in this release:

@aaronrobertshaw @adamziel @alexstine @andrewserong @chad1008 @ciampo @derekblank @draganescu @FilipposZ @fluiddot @geriux @glendaviesnz @jffng @jostnes @jsnajdr @MaggieCabrera @Mamaduka @manzurahammed @matiasbenedetto @mburridge @mcsf @mirka @msurdi @noisysocks @ntsekouras @oandregal @ramonjd @SavPhill @scruffian @sebastienserre @sunil25393 @t-hamano @tharsheblows @torounit @tyxla @walbo


= 13.4.0 =

## Changelog
Expand Down
Binary file modified docs/assets/inspector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/toolbar-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/contributors/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Real-time discussions for development take place in `#core-editor` and `#core-js

The Gutenberg project uses GitHub for managing code and tracking issues. The main repository is at: [https://github.com/WordPress/gutenberg](https://github.com/WordPress/gutenberg).

Browse [the issues list](https://github.com/wordpress/gutenberg/issues) to find issues to work on. The [good first issue](https://github.com/wordpress/gutenberg/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22) and [good first review](https://github.com/wordpress/gutenberg/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22) labels are good starting points.
Browse [the issues list](https://github.com/wordpress/gutenberg/issues) to find issues to work on. The [good first issue](https://github.com/wordpress/gutenberg/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22) and [good first review](https://github.com/WordPress/gutenberg/pulls?q=is%3Aopen+is%3Apr+label%3A%22Good+First+Review%22) labels are good starting points.

## Contributor Resources

Expand Down
5 changes: 5 additions & 0 deletions docs/contributors/code/react-native/integration-test-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ A test can be structured with the following parts:

We also include examples of common tasks as well as tips in the following sections:

- [Helpers](#helpers)
- [Common flows](#common-flows)
- [Tools](#tools)
- [Common pitfalls and caveats](#common-pitfalls-and-caveats)
Expand Down Expand Up @@ -211,6 +212,10 @@ afterAll( () => {
} );
```

## Helpers

In the spirit of making easier writing integration tests for the native version, you can find a list of helper functions in [this README](https://github.com/WordPress/gutenberg/blob/HEAD/test/native/integration-test-helpers/README.md).

## Common flows

### Query a block
Expand Down
18 changes: 17 additions & 1 deletion docs/contributors/code/testing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ However, if the change was intentional, follow these steps to update the snapsho
```sh
# --testPathPattern is optional but will be much faster by only running matching tests
npm run test-unit -- --updateSnapshot --testPathPattern path/to/tests

# Update snapshot for e2e tests
npm run test-e2e -- --updateSnapshot --testPathPattern path/to/e2e-tests

# Update snapshot for Playwright
npm run test-e2e:playwright -- --update-snapshots path/to/spec
```
1. Review the diff and ensure the changes are expected and intentional.
Expand Down Expand Up @@ -604,7 +610,17 @@ To ensure that the editor stays performant as we add features, we monitor the im
- The time it takes for the browser to respond when typing.
- The time it takes to select a block.

Performance tests are end-to-end tests running the editor and capturing these measures. To run the tests, make sure you have an e2e testing environment ready and run the following command:
Performance tests are end-to-end tests running the editor and capturing these measures. Make sure you have an e2e testing environment ready.

To set up the e2e testing environment, checkout the Gutenberg repository and switch to the branch that you would like to test. Run the following command to prepare the environment.

```
nvm use && npm install
npm run build:packages
npm run wp-env start
```

To run the tests run the following command:

```
npm run test-performance
Expand Down
Loading

0 comments on commit 84f2fe6

Please sign in to comment.