Skip to content

Commit

Permalink
Merge pull request #9 from WordPress/master
Browse files Browse the repository at this point in the history
Update master branch from original repo
  • Loading branch information
fluiddot authored Dec 30, 2020
2 parents ff8d204 + ab33643 commit 8458b75
Show file tree
Hide file tree
Showing 110 changed files with 1,567 additions and 974 deletions.
4 changes: 0 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ module.exports = {
'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
},
],
// Temporarily converted to warning until all errors are resolved.
// See https://github.com/WordPress/gutenberg/pull/22771 for the eslint-plugin-jsdoc update.
'jsdoc/check-param-names': 'warn',
'jsdoc/require-param': 'warn',
},
overrides: [
{
Expand Down
7 changes: 5 additions & 2 deletions bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ 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/edit-widgets/blocks/*.php build/edit-widgets/blocks/*/block.json \
build/block-library/blocks/*.php \
build/block-library/blocks/*/block.json \
build/block-library/blocks/*/*.css \
build/edit-widgets/blocks/*.php \
build/edit-widgets/blocks/*/block.json \
)


Expand Down
92 changes: 68 additions & 24 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,51 @@ const manifest = require( '../../../package.json' );
*/

/**
* Mapping of label names to grouping heading text to be used in release notes,
* intended to be more readable in the context of release notes. Also used in
* merging multiple related groupings to a single heading.
* Mapping of label names to sections in the release notes.
*
* Labels are sorted by the priority they have when there are
* multiple candidates. For example, if an issue has the labels
* "[Block] Navigation" and "[Type] Bug", it'll be assigned the
* section declared by "[Block] Navigation".
*
* @type {Record<string,string>}
*/
const LABEL_TYPE_MAPPING = {
Bug: 'Bug Fixes',
Regression: 'Bug Fixes',
Feature: 'Features',
Enhancement: 'Enhancements',
'New API': 'New APIs',
Experimental: 'Experiments',
Task: 'Various',
'[Block] Navigation': 'Experiments',
'[Block] Query': 'Experiments',
'[Block] Post Comments Count': 'Experiments',
'[Block] Post Comments Form': 'Experiments',
'[Block] Post Comments': 'Experiments',
'[Block] Post Featured Image': 'Experiments',
'[Block] Post Hierarchical Terms': 'Experiments',
'[Block] Post Title': 'Experiments',
'[Block] Site Logo': 'Experiments',
'[Feature] Full Site Editing': 'Experiments',
'Global Styles': 'Experiments',
'[Feature] Navigation Screen': 'Experiments',
'[Feature] Widgets Screen': 'Experiments',
'[Package] Dependency Extraction Webpack Plugin': 'Tools',
'[Package] Jest Puppeteer aXe': 'Tools',
'[Package] E2E Tests': 'Tools',
'[Package] E2E Test Utils': 'Tools',
'[Package] Env': 'Tools',
'[Package] ESLint plugin': 'Tools',
'[Package] stylelint config': 'Tools',
'[Package] Project management automation': 'Tools',
'[Type] Project Management': 'Tools',
'[Package] Scripts': 'Tools',
'[Type] Build Tooling': 'Tools',
'Automated Testing': 'Tools',
'[Type] Experimental': 'Experiments',
'[Type] Bug': 'Bug Fixes',
'[Type] Regression': 'Bug Fixes',
'[Type] Feature': 'Features',
'[Type] Enhancement': 'Enhancements',
'[Type] New API': 'New APIs',
'[Type] Performance': 'Performance',
'[Type] Documentation': 'Documentation',
'[Type] Code Quality': 'Code Quality',
'[Type] Security': 'Security',
};

/**
Expand All @@ -78,6 +109,7 @@ const GROUP_TITLE_ORDER = [
'Experiments',
'Documentation',
'Code Quality',
'Tools',
undefined,
'Various',
];
Expand Down Expand Up @@ -105,7 +137,8 @@ const REWORD_TERMS = {
};

/**
* Returns type candidates based on given issue label names.
* Returns candidates based on whether the given labels
* are part of the allowed list.
*
* @param {string[]} labels Label names.
*
Expand All @@ -114,13 +147,10 @@ const REWORD_TERMS = {
function getTypesByLabels( labels ) {
return uniq(
labels
.filter( ( label ) => label.startsWith( '[Type] ' ) )
.map( ( label ) => label.slice( '[Type] '.length ) )
.map( ( label ) =>
LABEL_TYPE_MAPPING.hasOwnProperty( label )
? LABEL_TYPE_MAPPING[ label ]
: label
.filter( ( label ) =>
Object.keys( LABEL_TYPE_MAPPING ).includes( label )
)
.map( ( label ) => LABEL_TYPE_MAPPING[ label ] )
);
}

Expand Down Expand Up @@ -151,12 +181,29 @@ function getTypesByTitle( title ) {
* @return {string} Type label.
*/
function getIssueType( issue ) {
const labels = issue.labels.map( ( { name } ) => name );
const candidates = [
...getTypesByLabels( issue.labels.map( ( { name } ) => name ) ),
...getTypesByLabels( labels ),
...getTypesByTitle( issue.title ),
];

return candidates.length ? candidates.sort( sortGroup )[ 0 ] : 'Various';
return candidates.length ? candidates.sort( sortType )[ 0 ] : 'Various';
}

/**
* Sort comparator, comparing two label candidates.
*
* @param {string} a First candidate.
* @param {string} b Second candidate.
*
* @return {number} Sort result.
*/
function sortType( a, b ) {
const [ aIndex, bIndex ] = [ a, b ].map( ( title ) => {
return Object.keys( LABEL_TYPE_MAPPING ).indexOf( title );
} );

return aIndex - bIndex;
}

/**
Expand Down Expand Up @@ -287,11 +334,8 @@ function removeRedundantTypePrefix( title, issue ) {
* @type {Array<WPChangelogNormalization>}
*/
const TITLE_NORMALIZATIONS = [
createOmitByTitlePrefix( [ '[rnmobile]' ] ),
createOmitByLabel( [
'Mobile App Compatibility',
'[Type] Project Management',
] ),
createOmitByLabel( [ 'Mobile App Android/iOS' ] ),
createOmitByTitlePrefix( [ '[rnmobile]', '[mobile]', 'Mobile Release' ] ),
removeRedundantTypePrefix,
reword,
capitalizeAfterColonSeparatedPrefix,
Expand Down
2 changes: 1 addition & 1 deletion bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ async function runTestSuite( testSuite, performanceTestDirectory ) {
/**
* Runs the performances tests on an array of branches and output the result.
*
* @param {WPPerformanceCommandOptions} options Command options.
* @param {string[]} branches Branches to compare
* @param {WPPerformanceCommandOptions} options Command options.
*/
async function runPerformanceTests( branches, options ) {
// The default value doesn't work because commander provides an array.
Expand Down
19 changes: 17 additions & 2 deletions bin/plugin/commands/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const fs = require( 'fs' );
const semver = require( 'semver' );
const Octokit = require( '@octokit/rest' );
const { sprintf } = require( 'sprintf-js' );
const os = require( 'os' );

/**
* Internal dependencies
Expand Down Expand Up @@ -518,13 +519,27 @@ async function runUpdateTrunkContentStep(
newReadmeFileContent.replace( STABLE_TAG_PLACEHOLDER, stableTag )
);

let xargsOpts = '';
if ( os.platform === 'linux' ) {
// When xargs receives no arguments, it behaves differently in macOS and linux:
// - macOS: doesn't run
// - linux: run without arguments
//
// In linux, the -r option teaches xargs not to run if it receives no arguments.
xargsOpts = '-r';
}

// Commit the content changes
runShellScript(
"svn st | grep '^?' | awk '{print $2}' | xargs svn add",
"svn st | grep '^?' | awk '{print $2}' | xargs " +
xargsOpts +
' svn add',
svnWorkingDirectoryPath
);
runShellScript(
"svn st | grep '^!' | awk '{print $2}' | xargs svn rm",
"svn st | grep '^!' | awk '{print $2}' | xargs " +
xargsOpts +
' svn rm',
svnWorkingDirectoryPath
);
await askForConfirmation(
Expand Down
11 changes: 1 addition & 10 deletions bin/plugin/commands/test/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,7 @@ describe( 'getNormalizedTitle', () => {
undefined,
{
...DEFAULT_ISSUE,
labels: [ { name: 'Mobile App Compatibility' } ],
},
],
[
'omits project management',
'Add codeowner',
undefined,
{
...DEFAULT_ISSUE,
labels: [ { name: '[Type] Project Management' } ],
labels: [ { name: 'Mobile App Android/iOS' } ],
},
],
[
Expand Down
101 changes: 101 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,106 @@
== Changelog ==

= 9.7.0-rc.1 =

### Features

- Support drag and dropping block patterns from the inserter. ([27927](https://github.com/WordPress/gutenberg/pull/27927))

### Enhancements

- Improve the Reusable Blocks UI by relying on multi entity save flow. ([27887](https://github.com/WordPress/gutenberg/pull/27887))
- Show the insertion point indicator bellow the inbetween inserter. ([27842](https://github.com/WordPress/gutenberg/pull/27842))
- URL: RemoveQueryArgs should remove the ? char after removing all args. ([27812](https://github.com/WordPress/gutenberg/pull/27812))
- URL: Enhance the way long URLs are handled in filterURLForDisplay. ([27530](https://github.com/WordPress/gutenberg/pull/27530))
- ComboboxControl: Updated component to deburr options labels before filter. ([26611](https://github.com/WordPress/gutenberg/pull/26611))

### New APIs

- Create block: Allow to list npm packages to be installed in the template. ([27880](https://github.com/WordPress/gutenberg/pull/27880))
- Display Block Information by matching block variations. ([27469](https://github.com/WordPress/gutenberg/pull/27469))

### Bug Fixes

- Don't ignore extra edits made in the server when saving posts. ([27929](https://github.com/WordPress/gutenberg/pull/27929))
- Allow using multiple controlled inner blocks refering to the same entity. ([27885](https://github.com/WordPress/gutenberg/pull/27885))
- Remove the animation of post publish button during autosaving. ([27874](https://github.com/WordPress/gutenberg/pull/27874))
- Remove default style information from the documentation. ([27811](https://github.com/WordPress/gutenberg/pull/27811))
- Storybook: Fix broken import statements for DateTime component. ([27794](https://github.com/WordPress/gutenberg/pull/27794))
- Pattern Inserter: Fix bug where the inserter cannot be closed if the user changes pattern category. ([27792](https://github.com/WordPress/gutenberg/pull/27792))
- Create Block: Another try to fix support for external templates. ([27784](https://github.com/WordPress/gutenberg/pull/27784))
- LinkControl: Fix horizontal scrollbar within block toolbar. ([27777](https://github.com/WordPress/gutenberg/pull/27777))
- Create Block: Fix support for external templates hosted on npm. ([27776](https://github.com/WordPress/gutenberg/pull/27776))
- Fix for bug #21989, #21650. ([27691](https://github.com/WordPress/gutenberg/pull/27691))
- HTML Block: Fix editor styles. ([27627](https://github.com/WordPress/gutenberg/pull/27627))
- Fix: Text color dropdown not showing up after clicking for the first time. ([27596](https://github.com/WordPress/gutenberg/pull/27596))

### Experiments

- Site Logo: Remove duplicate link. ([27924](https://github.com/WordPress/gutenberg/pull/27924))
- Post excerpt block: Fix incorrect quotes for the class attribute in the wrapper. ([27895](https://github.com/WordPress/gutenberg/pull/27895))
- Refactor the edit-site store to clarify the purpose of templateId and templatePartId. ([27839](https://github.com/WordPress/gutenberg/pull/27839))
- Add support for custom templates in FSE themes. ([27778](https://github.com/WordPress/gutenberg/pull/27778))
- RSS Block: Add border-box CSS. ([27767](https://github.com/WordPress/gutenberg/pull/27767))
- Add padding control to the Global Styles sidebar. ([27154](https://github.com/WordPress/gutenberg/pull/27154))
- Navigation block: Fix the text color for links in the navigation block. ([26698](https://github.com/WordPress/gutenberg/pull/26698))

### Documentation

- Fix: OpenURLPopover bind typo (DOCS). ([27909](https://github.com/WordPress/gutenberg/pull/27909))
- Improve documentation for withNotices HOC in components package. ([27863](https://github.com/WordPress/gutenberg/pull/27863))
- Docs: Fix typos in components package. ([27799](https://github.com/WordPress/gutenberg/pull/27799))
- Add ContrastChecker component readme (block-editor). ([25570](https://github.com/WordPress/gutenberg/pull/25570))

### Code Quality

- Use a consistent way to check isRTL. ([27838](https://github.com/WordPress/gutenberg/pull/27838))
- Update the minimum required WordPress version to 5.5. ([27807](https://github.com/WordPress/gutenberg/pull/27807))
- Remove unused redux-optimist dependency. ([27798](https://github.com/WordPress/gutenberg/pull/27798))
- Storybook: Perform cleanup in the Storybook setup. ([27786](https://github.com/WordPress/gutenberg/pull/27786))
- Raw handling: Remove duplicate code. ([27758](https://github.com/WordPress/gutenberg/pull/27758))
- Refactor BlockSwitcher - make function component and new specific selector `getBlockTransformItems`. ([27674](https://github.com/WordPress/gutenberg/pull/27674))

### Tools

- Code quality: Remove overrides for JSDoc rules downgraded to warnings (take 2). ([27912](https://github.com/WordPress/gutenberg/pull/27912))
- Fix svn add/rm commands for release tool. ([27886](https://github.com/WordPress/gutenberg/pull/27886))
- Include block CSS in the plugin ZIP. ([27884](https://github.com/WordPress/gutenberg/pull/27884))
- Code quality: Remove overrides for JSDoc rules downgraded to warnings. ([27879](https://github.com/WordPress/gutenberg/pull/27879))
- Make end to end tests do not rely on font size picker classes. ([27825](https://github.com/WordPress/gutenberg/pull/27825))
- Remove expect.assertions count from multi-entity-saving tests. ([27818](https://github.com/WordPress/gutenberg/pull/27818))
- [e2e tests]: Fix assertions number check. ([27802](https://github.com/WordPress/gutenberg/pull/27802))
- Testing: Remove axe verification executed after every test case. ([26626](https://github.com/WordPress/gutenberg/pull/26626))
- Add new package `@wordpress/stylelint config`. ([22777](https://github.com/WordPress/gutenberg/pull/22777))
- Keycodes: Add, enhance types. ([19520](https://github.com/WordPress/gutenberg/pull/19520))

### Various

- Show all taxonomies in Tag Cloud block. ([27930](https://github.com/WordPress/gutenberg/pull/27930))
- Revert "Code quality: Remove overrides for JSDoc rules downgraded to warnings". ([27908](https://github.com/WordPress/gutenberg/pull/27908))
- Update: Improve font size end to end tests to work with input changes on blur. ([27871](https://github.com/WordPress/gutenberg/pull/27871))
- Add block transforms preview. ([27861](https://github.com/WordPress/gutenberg/pull/27861))
- Add additional information about lock inheritance. ([27834](https://github.com/WordPress/gutenberg/pull/27834))
- Rich Text: Replace store name string with exposed store definition. ([27820](https://github.com/WordPress/gutenberg/pull/27820))
- Storybook: Updgrade to the latest version. ([27813](https://github.com/WordPress/gutenberg/pull/27813))
- Update Twenty Twenty-One theme references. ([27770](https://github.com/WordPress/gutenberg/pull/27770))



= 9.6.2 =

### Bug Fixes

- Fix toolbar controls in the widgets screen.
- Fix the slash inserter in the widgets screen.


= 9.6.1 =

### Bugfixes

- Include block's CSS in the release for FSE themes ([27884](https://github.com/WordPress/gutenberg/pull/27884))


= 9.6.0 =


Expand Down
4 changes: 2 additions & 2 deletions docs/contributors/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ You'll need to use Subversion to publish the plugin to WordPress.org.
6. Add new files/remove deleted files from the repository:
```bash
# Add new files:
svn st | grep '^\?' | awk '{print $2}' | xargs svn add
svn st | grep '^\?' | awk '{print $2}' | xargs svn add # add the -r option to xargs if you use a linux-based OS
# Delete old files:
svn st | grep '^!' | awk '{print $2}' | xargs svn rm
svn st | grep '^!' | awk '{print $2}' | xargs svn rm # add the -r option to xargs if you use a linux-based OS
```
7. Commit the new version:
```bash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Templates

A block template is defined as a list of block items. Such blocks can have predefined attributes, placeholder content, and be static or dynamic. Block templates allow to specify a default initial state for an editor session.
A block template is defined as a list of block items. Such blocks can have predefined attributes, placeholder content, and be static or dynamic. Block templates allow specifying a default initial state for an editor session.

The scope of templates include:

Expand Down Expand Up @@ -110,6 +110,8 @@ add_action( 'init', 'myplugin_register_template' );
- `all` — prevents all operations. It is not possible to insert new blocks, move existing blocks, or delete blocks.
- `insert` — prevents inserting or removing blocks, but allows moving existing blocks.

Lock settings can be inherited by InnerBlocks. If `templateLock` is not set in an InnerBlocks area, the locking of the parent InnerBlocks area is used. If the block is a top level block, the locking configuration of the current post type is used.

## Nested Templates

Container blocks like the columns blocks also support templates. This is achieved by assigning a nested template to the block.
Expand Down
3 changes: 2 additions & 1 deletion docs/designers-developers/developers/data/data-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ _Parameters_
- _name_ `string`: Name of the received entity.
- _records_ `(Array|Object)`: Records received.
- _query_ `?Object`: Query Object.
- _invalidateCache_ `?boolean`: Should invalidate query caches
- _invalidateCache_ `?boolean`: Should invalidate query caches.
- _edits_ `?Object`: Edits to reset.

_Returns_

Expand Down
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.0
* Version: 9.7.0-rc.1
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
Loading

0 comments on commit 8458b75

Please sign in to comment.