Skip to content

Commit 8458b75

Browse files
authored
Merge pull request #9 from WordPress/master
Update master branch from original repo
2 parents ff8d204 + ab33643 commit 8458b75

File tree

110 files changed

+1567
-974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1567
-974
lines changed

.eslintrc.js

-4
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ module.exports = {
121121
'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
122122
},
123123
],
124-
// Temporarily converted to warning until all errors are resolved.
125-
// See https://github.com/WordPress/gutenberg/pull/22771 for the eslint-plugin-jsdoc update.
126-
'jsdoc/check-param-names': 'warn',
127-
'jsdoc/require-param': 'warn',
128124
},
129125
overrides: [
130126
{

bin/build-plugin-zip.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@ mv gutenberg.tmp.php gutenberg.php
111111

112112
build_files=$(
113113
ls build/*/*.{js,css,asset.php} \
114-
build/block-library/blocks/*.php build/block-library/blocks/*/block.json \
115-
build/edit-widgets/blocks/*.php build/edit-widgets/blocks/*/block.json \
114+
build/block-library/blocks/*.php \
115+
build/block-library/blocks/*/block.json \
116+
build/block-library/blocks/*/*.css \
117+
build/edit-widgets/blocks/*.php \
118+
build/edit-widgets/blocks/*/block.json \
116119
)
117120

118121

bin/plugin/commands/changelog.js

+68-24
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,51 @@ const manifest = require( '../../../package.json' );
4747
*/
4848

4949
/**
50-
* Mapping of label names to grouping heading text to be used in release notes,
51-
* intended to be more readable in the context of release notes. Also used in
52-
* merging multiple related groupings to a single heading.
50+
* Mapping of label names to sections in the release notes.
51+
*
52+
* Labels are sorted by the priority they have when there are
53+
* multiple candidates. For example, if an issue has the labels
54+
* "[Block] Navigation" and "[Type] Bug", it'll be assigned the
55+
* section declared by "[Block] Navigation".
5356
*
5457
* @type {Record<string,string>}
5558
*/
5659
const LABEL_TYPE_MAPPING = {
57-
Bug: 'Bug Fixes',
58-
Regression: 'Bug Fixes',
59-
Feature: 'Features',
60-
Enhancement: 'Enhancements',
61-
'New API': 'New APIs',
62-
Experimental: 'Experiments',
63-
Task: 'Various',
60+
'[Block] Navigation': 'Experiments',
61+
'[Block] Query': 'Experiments',
62+
'[Block] Post Comments Count': 'Experiments',
63+
'[Block] Post Comments Form': 'Experiments',
64+
'[Block] Post Comments': 'Experiments',
65+
'[Block] Post Featured Image': 'Experiments',
66+
'[Block] Post Hierarchical Terms': 'Experiments',
67+
'[Block] Post Title': 'Experiments',
68+
'[Block] Site Logo': 'Experiments',
69+
'[Feature] Full Site Editing': 'Experiments',
70+
'Global Styles': 'Experiments',
71+
'[Feature] Navigation Screen': 'Experiments',
72+
'[Feature] Widgets Screen': 'Experiments',
73+
'[Package] Dependency Extraction Webpack Plugin': 'Tools',
74+
'[Package] Jest Puppeteer aXe': 'Tools',
75+
'[Package] E2E Tests': 'Tools',
76+
'[Package] E2E Test Utils': 'Tools',
77+
'[Package] Env': 'Tools',
78+
'[Package] ESLint plugin': 'Tools',
79+
'[Package] stylelint config': 'Tools',
80+
'[Package] Project management automation': 'Tools',
81+
'[Type] Project Management': 'Tools',
82+
'[Package] Scripts': 'Tools',
83+
'[Type] Build Tooling': 'Tools',
84+
'Automated Testing': 'Tools',
85+
'[Type] Experimental': 'Experiments',
86+
'[Type] Bug': 'Bug Fixes',
87+
'[Type] Regression': 'Bug Fixes',
88+
'[Type] Feature': 'Features',
89+
'[Type] Enhancement': 'Enhancements',
90+
'[Type] New API': 'New APIs',
91+
'[Type] Performance': 'Performance',
92+
'[Type] Documentation': 'Documentation',
93+
'[Type] Code Quality': 'Code Quality',
94+
'[Type] Security': 'Security',
6495
};
6596

6697
/**
@@ -78,6 +109,7 @@ const GROUP_TITLE_ORDER = [
78109
'Experiments',
79110
'Documentation',
80111
'Code Quality',
112+
'Tools',
81113
undefined,
82114
'Various',
83115
];
@@ -105,7 +137,8 @@ const REWORD_TERMS = {
105137
};
106138

107139
/**
108-
* Returns type candidates based on given issue label names.
140+
* Returns candidates based on whether the given labels
141+
* are part of the allowed list.
109142
*
110143
* @param {string[]} labels Label names.
111144
*
@@ -114,13 +147,10 @@ const REWORD_TERMS = {
114147
function getTypesByLabels( labels ) {
115148
return uniq(
116149
labels
117-
.filter( ( label ) => label.startsWith( '[Type] ' ) )
118-
.map( ( label ) => label.slice( '[Type] '.length ) )
119-
.map( ( label ) =>
120-
LABEL_TYPE_MAPPING.hasOwnProperty( label )
121-
? LABEL_TYPE_MAPPING[ label ]
122-
: label
150+
.filter( ( label ) =>
151+
Object.keys( LABEL_TYPE_MAPPING ).includes( label )
123152
)
153+
.map( ( label ) => LABEL_TYPE_MAPPING[ label ] )
124154
);
125155
}
126156

@@ -151,12 +181,29 @@ function getTypesByTitle( title ) {
151181
* @return {string} Type label.
152182
*/
153183
function getIssueType( issue ) {
184+
const labels = issue.labels.map( ( { name } ) => name );
154185
const candidates = [
155-
...getTypesByLabels( issue.labels.map( ( { name } ) => name ) ),
186+
...getTypesByLabels( labels ),
156187
...getTypesByTitle( issue.title ),
157188
];
158189

159-
return candidates.length ? candidates.sort( sortGroup )[ 0 ] : 'Various';
190+
return candidates.length ? candidates.sort( sortType )[ 0 ] : 'Various';
191+
}
192+
193+
/**
194+
* Sort comparator, comparing two label candidates.
195+
*
196+
* @param {string} a First candidate.
197+
* @param {string} b Second candidate.
198+
*
199+
* @return {number} Sort result.
200+
*/
201+
function sortType( a, b ) {
202+
const [ aIndex, bIndex ] = [ a, b ].map( ( title ) => {
203+
return Object.keys( LABEL_TYPE_MAPPING ).indexOf( title );
204+
} );
205+
206+
return aIndex - bIndex;
160207
}
161208

162209
/**
@@ -287,11 +334,8 @@ function removeRedundantTypePrefix( title, issue ) {
287334
* @type {Array<WPChangelogNormalization>}
288335
*/
289336
const TITLE_NORMALIZATIONS = [
290-
createOmitByTitlePrefix( [ '[rnmobile]' ] ),
291-
createOmitByLabel( [
292-
'Mobile App Compatibility',
293-
'[Type] Project Management',
294-
] ),
337+
createOmitByLabel( [ 'Mobile App Android/iOS' ] ),
338+
createOmitByTitlePrefix( [ '[rnmobile]', '[mobile]', 'Mobile Release' ] ),
295339
removeRedundantTypePrefix,
296340
reword,
297341
capitalizeAfterColonSeparatedPrefix,

bin/plugin/commands/performance.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ async function runTestSuite( testSuite, performanceTestDirectory ) {
205205
/**
206206
* Runs the performances tests on an array of branches and output the result.
207207
*
208-
* @param {WPPerformanceCommandOptions} options Command options.
209208
* @param {string[]} branches Branches to compare
209+
* @param {WPPerformanceCommandOptions} options Command options.
210210
*/
211211
async function runPerformanceTests( branches, options ) {
212212
// The default value doesn't work because commander provides an array.

bin/plugin/commands/release.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const fs = require( 'fs' );
66
const semver = require( 'semver' );
77
const Octokit = require( '@octokit/rest' );
88
const { sprintf } = require( 'sprintf-js' );
9+
const os = require( 'os' );
910

1011
/**
1112
* Internal dependencies
@@ -518,13 +519,27 @@ async function runUpdateTrunkContentStep(
518519
newReadmeFileContent.replace( STABLE_TAG_PLACEHOLDER, stableTag )
519520
);
520521

522+
let xargsOpts = '';
523+
if ( os.platform === 'linux' ) {
524+
// When xargs receives no arguments, it behaves differently in macOS and linux:
525+
// - macOS: doesn't run
526+
// - linux: run without arguments
527+
//
528+
// In linux, the -r option teaches xargs not to run if it receives no arguments.
529+
xargsOpts = '-r';
530+
}
531+
521532
// Commit the content changes
522533
runShellScript(
523-
"svn st | grep '^?' | awk '{print $2}' | xargs svn add",
534+
"svn st | grep '^?' | awk '{print $2}' | xargs " +
535+
xargsOpts +
536+
' svn add',
524537
svnWorkingDirectoryPath
525538
);
526539
runShellScript(
527-
"svn st | grep '^!' | awk '{print $2}' | xargs svn rm",
540+
"svn st | grep '^!' | awk '{print $2}' | xargs " +
541+
xargsOpts +
542+
' svn rm',
528543
svnWorkingDirectoryPath
529544
);
530545
await askForConfirmation(

bin/plugin/commands/test/changelog.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,7 @@ describe( 'getNormalizedTitle', () => {
3333
undefined,
3434
{
3535
...DEFAULT_ISSUE,
36-
labels: [ { name: 'Mobile App Compatibility' } ],
37-
},
38-
],
39-
[
40-
'omits project management',
41-
'Add codeowner',
42-
undefined,
43-
{
44-
...DEFAULT_ISSUE,
45-
labels: [ { name: '[Type] Project Management' } ],
36+
labels: [ { name: 'Mobile App Android/iOS' } ],
4637
},
4738
],
4839
[

changelog.txt

+101
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,106 @@
11
== Changelog ==
22

3+
= 9.7.0-rc.1 =
4+
5+
### Features
6+
7+
- Support drag and dropping block patterns from the inserter. ([27927](https://github.com/WordPress/gutenberg/pull/27927))
8+
9+
### Enhancements
10+
11+
- Improve the Reusable Blocks UI by relying on multi entity save flow. ([27887](https://github.com/WordPress/gutenberg/pull/27887))
12+
- Show the insertion point indicator bellow the inbetween inserter. ([27842](https://github.com/WordPress/gutenberg/pull/27842))
13+
- URL: RemoveQueryArgs should remove the ? char after removing all args. ([27812](https://github.com/WordPress/gutenberg/pull/27812))
14+
- URL: Enhance the way long URLs are handled in filterURLForDisplay. ([27530](https://github.com/WordPress/gutenberg/pull/27530))
15+
- ComboboxControl: Updated component to deburr options labels before filter. ([26611](https://github.com/WordPress/gutenberg/pull/26611))
16+
17+
### New APIs
18+
19+
- Create block: Allow to list npm packages to be installed in the template. ([27880](https://github.com/WordPress/gutenberg/pull/27880))
20+
- Display Block Information by matching block variations. ([27469](https://github.com/WordPress/gutenberg/pull/27469))
21+
22+
### Bug Fixes
23+
24+
- Don't ignore extra edits made in the server when saving posts. ([27929](https://github.com/WordPress/gutenberg/pull/27929))
25+
- Allow using multiple controlled inner blocks refering to the same entity. ([27885](https://github.com/WordPress/gutenberg/pull/27885))
26+
- Remove the animation of post publish button during autosaving. ([27874](https://github.com/WordPress/gutenberg/pull/27874))
27+
- Remove default style information from the documentation. ([27811](https://github.com/WordPress/gutenberg/pull/27811))
28+
- Storybook: Fix broken import statements for DateTime component. ([27794](https://github.com/WordPress/gutenberg/pull/27794))
29+
- Pattern Inserter: Fix bug where the inserter cannot be closed if the user changes pattern category. ([27792](https://github.com/WordPress/gutenberg/pull/27792))
30+
- Create Block: Another try to fix support for external templates. ([27784](https://github.com/WordPress/gutenberg/pull/27784))
31+
- LinkControl: Fix horizontal scrollbar within block toolbar. ([27777](https://github.com/WordPress/gutenberg/pull/27777))
32+
- Create Block: Fix support for external templates hosted on npm. ([27776](https://github.com/WordPress/gutenberg/pull/27776))
33+
- Fix for bug #21989, #21650. ([27691](https://github.com/WordPress/gutenberg/pull/27691))
34+
- HTML Block: Fix editor styles. ([27627](https://github.com/WordPress/gutenberg/pull/27627))
35+
- Fix: Text color dropdown not showing up after clicking for the first time. ([27596](https://github.com/WordPress/gutenberg/pull/27596))
36+
37+
### Experiments
38+
39+
- Site Logo: Remove duplicate link. ([27924](https://github.com/WordPress/gutenberg/pull/27924))
40+
- Post excerpt block: Fix incorrect quotes for the class attribute in the wrapper. ([27895](https://github.com/WordPress/gutenberg/pull/27895))
41+
- Refactor the edit-site store to clarify the purpose of templateId and templatePartId. ([27839](https://github.com/WordPress/gutenberg/pull/27839))
42+
- Add support for custom templates in FSE themes. ([27778](https://github.com/WordPress/gutenberg/pull/27778))
43+
- RSS Block: Add border-box CSS. ([27767](https://github.com/WordPress/gutenberg/pull/27767))
44+
- Add padding control to the Global Styles sidebar. ([27154](https://github.com/WordPress/gutenberg/pull/27154))
45+
- Navigation block: Fix the text color for links in the navigation block. ([26698](https://github.com/WordPress/gutenberg/pull/26698))
46+
47+
### Documentation
48+
49+
- Fix: OpenURLPopover bind typo (DOCS). ([27909](https://github.com/WordPress/gutenberg/pull/27909))
50+
- Improve documentation for withNotices HOC in components package. ([27863](https://github.com/WordPress/gutenberg/pull/27863))
51+
- Docs: Fix typos in components package. ([27799](https://github.com/WordPress/gutenberg/pull/27799))
52+
- Add ContrastChecker component readme (block-editor). ([25570](https://github.com/WordPress/gutenberg/pull/25570))
53+
54+
### Code Quality
55+
56+
- Use a consistent way to check isRTL. ([27838](https://github.com/WordPress/gutenberg/pull/27838))
57+
- Update the minimum required WordPress version to 5.5. ([27807](https://github.com/WordPress/gutenberg/pull/27807))
58+
- Remove unused redux-optimist dependency. ([27798](https://github.com/WordPress/gutenberg/pull/27798))
59+
- Storybook: Perform cleanup in the Storybook setup. ([27786](https://github.com/WordPress/gutenberg/pull/27786))
60+
- Raw handling: Remove duplicate code. ([27758](https://github.com/WordPress/gutenberg/pull/27758))
61+
- Refactor BlockSwitcher - make function component and new specific selector `getBlockTransformItems`. ([27674](https://github.com/WordPress/gutenberg/pull/27674))
62+
63+
### Tools
64+
65+
- Code quality: Remove overrides for JSDoc rules downgraded to warnings (take 2). ([27912](https://github.com/WordPress/gutenberg/pull/27912))
66+
- Fix svn add/rm commands for release tool. ([27886](https://github.com/WordPress/gutenberg/pull/27886))
67+
- Include block CSS in the plugin ZIP. ([27884](https://github.com/WordPress/gutenberg/pull/27884))
68+
- Code quality: Remove overrides for JSDoc rules downgraded to warnings. ([27879](https://github.com/WordPress/gutenberg/pull/27879))
69+
- Make end to end tests do not rely on font size picker classes. ([27825](https://github.com/WordPress/gutenberg/pull/27825))
70+
- Remove expect.assertions count from multi-entity-saving tests. ([27818](https://github.com/WordPress/gutenberg/pull/27818))
71+
- [e2e tests]: Fix assertions number check. ([27802](https://github.com/WordPress/gutenberg/pull/27802))
72+
- Testing: Remove axe verification executed after every test case. ([26626](https://github.com/WordPress/gutenberg/pull/26626))
73+
- Add new package `@wordpress/stylelint config`. ([22777](https://github.com/WordPress/gutenberg/pull/22777))
74+
- Keycodes: Add, enhance types. ([19520](https://github.com/WordPress/gutenberg/pull/19520))
75+
76+
### Various
77+
78+
- Show all taxonomies in Tag Cloud block. ([27930](https://github.com/WordPress/gutenberg/pull/27930))
79+
- Revert "Code quality: Remove overrides for JSDoc rules downgraded to warnings". ([27908](https://github.com/WordPress/gutenberg/pull/27908))
80+
- Update: Improve font size end to end tests to work with input changes on blur. ([27871](https://github.com/WordPress/gutenberg/pull/27871))
81+
- Add block transforms preview. ([27861](https://github.com/WordPress/gutenberg/pull/27861))
82+
- Add additional information about lock inheritance. ([27834](https://github.com/WordPress/gutenberg/pull/27834))
83+
- Rich Text: Replace store name string with exposed store definition. ([27820](https://github.com/WordPress/gutenberg/pull/27820))
84+
- Storybook: Updgrade to the latest version. ([27813](https://github.com/WordPress/gutenberg/pull/27813))
85+
- Update Twenty Twenty-One theme references. ([27770](https://github.com/WordPress/gutenberg/pull/27770))
86+
87+
88+
89+
= 9.6.2 =
90+
91+
### Bug Fixes
92+
93+
- Fix toolbar controls in the widgets screen.
94+
- Fix the slash inserter in the widgets screen.
95+
96+
97+
= 9.6.1 =
98+
99+
### Bugfixes
100+
101+
- Include block's CSS in the release for FSE themes ([27884](https://github.com/WordPress/gutenberg/pull/27884))
102+
103+
3104
= 9.6.0 =
4105

5106

docs/contributors/release.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ You'll need to use Subversion to publish the plugin to WordPress.org.
199199
6. Add new files/remove deleted files from the repository:
200200
```bash
201201
# Add new files:
202-
svn st | grep '^\?' | awk '{print $2}' | xargs svn add
202+
svn st | grep '^\?' | awk '{print $2}' | xargs svn add # add the -r option to xargs if you use a linux-based OS
203203
# Delete old files:
204-
svn st | grep '^!' | awk '{print $2}' | xargs svn rm
204+
svn st | grep '^!' | awk '{print $2}' | xargs svn rm # add the -r option to xargs if you use a linux-based OS
205205
```
206206
7. Commit the new version:
207207
```bash

docs/designers-developers/developers/block-api/block-templates.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Templates
22

3-
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.
3+
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.
44

55
The scope of templates include:
66

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

113+
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.
114+
113115
## Nested Templates
114116

115117
Container blocks like the columns blocks also support templates. This is achieved by assigning a nested template to the block.

docs/designers-developers/developers/data/data-core.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,8 @@ _Parameters_
612612
- _name_ `string`: Name of the received entity.
613613
- _records_ `(Array|Object)`: Records received.
614614
- _query_ `?Object`: Query Object.
615-
- _invalidateCache_ `?boolean`: Should invalidate query caches
615+
- _invalidateCache_ `?boolean`: Should invalidate query caches.
616+
- _edits_ `?Object`: Edits to reset.
616617

617618
_Returns_
618619

gutenberg.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
66
* Requires at least: 5.3
77
* Requires PHP: 5.6
8-
* Version: 9.6.0
8+
* Version: 9.7.0-rc.1
99
* Author: Gutenberg Team
1010
* Text Domain: gutenberg
1111
*

0 commit comments

Comments
 (0)