Skip to content

Commit

Permalink
Merge branch 'trunk' into try/multiple-themes-support
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Dec 13, 2022
2 parents 43c0f5a + dd0504b commit b5c2eec
Show file tree
Hide file tree
Showing 264 changed files with 4,498 additions and 4,813 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const restrictedImports = [
'nth',
'omitBy',
'once',
'orderby',
'overEvery',
'partial',
'partialRight',
Expand Down
81 changes: 46 additions & 35 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
== Changelog ==

= 14.7.0-rc.1 =
= 14.7.1 =



## Changelog

### Bug Fixes

#### Layout
- Only pass parentLayout to block edit if not empty. ([46390](https://github.com/WordPress/gutenberg/pull/46390))

## Contributors

The following contributors merged PRs in this release:

@tellthemachines


= 14.7.0 =



Expand All @@ -12,18 +30,18 @@
- Style engine: Trim multiple selector strings. ([45873](https://github.com/WordPress/gutenberg/pull/45873))

#### Block Library
- Add a starting page for page list block's hierarchy. ([45861](https://github.com/WordPress/gutenberg/pull/45861))
- Clarify explanation of how 'Convert to Links' works in Page List block. ([45394](https://github.com/WordPress/gutenberg/pull/45394))
- Colorize template parts and Reusable blocks. ([45473](https://github.com/WordPress/gutenberg/pull/45473))
- Enable page list to expand in list view. ([45776](https://github.com/WordPress/gutenberg/pull/45776))
- Fix for navigation anchor links to close modal. ([45829](https://github.com/WordPress/gutenberg/pull/45829))
- Heading Block: Add a wp-block-heading CSS class. ([42122](https://github.com/WordPress/gutenberg/pull/42122))
- Nav Block: Clarify explanation of how 'Convert to Links' works in Page List block. ([45394](https://github.com/WordPress/gutenberg/pull/45394))
- Nav Block: Add label field to navigation link and navigation submenu. ([45964](https://github.com/WordPress/gutenberg/pull/45964))
- Nav Block: Add link URL to the navigation submenu inspector controls. ([45816](https://github.com/WordPress/gutenberg/pull/45816))
- Nav Block: Fix for navigation anchor links to close modal. ([45829](https://github.com/WordPress/gutenberg/pull/45829))
- Template Part Block: Colorize template parts and Reusable blocks. ([45473](https://github.com/WordPress/gutenberg/pull/45473))
- List: Allow pasting pre/code. ([45016](https://github.com/WordPress/gutenberg/pull/45016))
- Navigation: Add label field to navigation link and navigation submenu. ([45964](https://github.com/WordPress/gutenberg/pull/45964))
- Navigation: Add link URL to the navigation submenu inspector controls. ([45816](https://github.com/WordPress/gutenberg/pull/45816))
- Navigation: Hide the create new menu button if the experiment is enabled. ([46019](https://github.com/WordPress/gutenberg/pull/46019))
- Page List: Enable page list to expand in list view. ([45776](https://github.com/WordPress/gutenberg/pull/45776))
- Page List: Add a starting page for page list block's hierarchy. ([45861](https://github.com/WordPress/gutenberg/pull/45861))
- Page List Item: Hide edit button. ([46163](https://github.com/WordPress/gutenberg/pull/46163))
- Site Logo: Apply width to logo container in editor. ([45821](https://github.com/WordPress/gutenberg/pull/45821))
- Support `colspan` attribute in `table` HTML, including when pasting. ([45981](https://github.com/WordPress/gutenberg/pull/45981))
- Table Block: Support colspan attribute in table HTML, including when pasting. ([45981](https://github.com/WordPress/gutenberg/pull/45981))

#### Components
- Add themeable background color. ([45466](https://github.com/WordPress/gutenberg/pull/45466))
Expand All @@ -47,11 +65,9 @@

#### Design Tools
- Min Height: Add height control component with slider. ([45875](https://github.com/WordPress/gutenberg/pull/45875))
- Nav Block: Move color controls to support panel. ([46049](https://github.com/WordPress/gutenberg/pull/46049))
- Spacing: Make visualiser appear on focus. ([46096](https://github.com/WordPress/gutenberg/pull/46096))

#### Block Editor
- Enable easier drag and drop for navigation building. ([45906](https://github.com/WordPress/gutenberg/pull/45906))
- [Inserter]: Replace text in `Reusable` tab with an icon. ([45851](https://github.com/WordPress/gutenberg/pull/45851))
- [Inserter]: Update pattern explorer button css. ([45735](https://github.com/WordPress/gutenberg/pull/45735))
- [Inserter]: Add media tab. ([44918](https://github.com/WordPress/gutenberg/pull/44918))
Expand All @@ -69,26 +85,20 @@
#### Layout
- Add Layout controls to children of Flex layout blocks. ([45364](https://github.com/WordPress/gutenberg/pull/45364))

#### Global Styles
- [Heading block] Add a wp-block-heading CSS class. ([42122](https://github.com/WordPress/gutenberg/pull/42122))


### Bug Fixes

#### Preferences
- Disable distraction free prefference effects on small viewports. ([45591](https://github.com/WordPress/gutenberg/pull/45591))

#### Block Library
- Fixed a bug that List block attributes were reset in 6.1.1. ([46000](https://github.com/WordPress/gutenberg/pull/46000))
- List Block: Fixed a bug that List block attributes were reset in 6.1.1. ([46000](https://github.com/WordPress/gutenberg/pull/46000))
- Gallery: Use unbound query when fetching image details. ([46143](https://github.com/WordPress/gutenberg/pull/46143))
- Heading: Add block classname deprecation. ([46138](https://github.com/WordPress/gutenberg/pull/46138))
- Page List: If no parent page is set, still render all children. ([45967](https://github.com/WordPress/gutenberg/pull/45967))
- Page List: Render the children correctly in the editor. ([46165](https://github.com/WordPress/gutenberg/pull/46165))
- Post Author: Avoid errors when the user avatars are disabled. ([45989](https://github.com/WordPress/gutenberg/pull/45989))

#### Testing
- Fix Quote block's unwrap end-to-end test. ([46168](https://github.com/WordPress/gutenberg/pull/46168))
- Remove 'response.deleted' check. ([45992](https://github.com/WordPress/gutenberg/pull/45992))
- Nav Block: Navigation menu doesn't appear when hamburger clicked on. ([45773](https://github.com/WordPress/gutenberg/pull/45773))

#### Block Editor
- Fix broken Link Control hook. ([46113](https://github.com/WordPress/gutenberg/pull/46113))
Expand All @@ -110,9 +120,6 @@
#### CSS & Styling
- Fix the editor area height. ([45799](https://github.com/WordPress/gutenberg/pull/45799))

#### Plugin
- Navigation menu doesn't appear when hamburger clicked on. ([45773](https://github.com/WordPress/gutenberg/pull/45773))

#### Full Site Editing
- Ensure post-featured-image block is in_the_loop() for BC with core and plugins, and to fix lazy-loading. ([45534](https://github.com/WordPress/gutenberg/pull/45534))

Expand Down Expand Up @@ -147,12 +154,15 @@
### Experiments

#### Block Library
- Add basic edit button UI to Nav block offcanvas editor. ([45815](https://github.com/WordPress/gutenberg/pull/45815))
- Add submenu menu item to list view. ([45794](https://github.com/WordPress/gutenberg/pull/45794))
- Alternative: Add inserter to Nav block offcanvas experiment. ([45947](https://github.com/WordPress/gutenberg/pull/45947))
- Display inserter popover in offcanvas UI. ([46013](https://github.com/WordPress/gutenberg/pull/46013))
- List View - Stop child item selecting a parent which is already selected. ([45860](https://github.com/WordPress/gutenberg/pull/45860))
- Nav offcanvas editor: Add simple back button to inspector controls. ([45852](https://github.com/WordPress/gutenberg/pull/45852))
- Nav Block: Add basic edit button UI to Nav block offcanvas editor. ([45815](https://github.com/WordPress/gutenberg/pull/45815))
- Nav Block: Add submenu menu item to list view. ([45794](https://github.com/WordPress/gutenberg/pull/45794))
- Nav Block: Alternative: Add inserter to Nav block offcanvas experiment. ([45947](https://github.com/WordPress/gutenberg/pull/45947))
- Nav Block: Display inserter popover in offcanvas UI. ([46013](https://github.com/WordPress/gutenberg/pull/46013))
- Nav Block: List View - Stop child item selecting a parent which is already selected. ([45860](https://github.com/WordPress/gutenberg/pull/45860))
- Nav Block: Add simple back button to inspector controls. ([45852](https://github.com/WordPress/gutenberg/pull/45852))
- Nav Block: Move color controls to support panel. ([46049](https://github.com/WordPress/gutenberg/pull/46049))
- Nav Block: Enable easier drag and drop for navigation building. ([45906](https://github.com/WordPress/gutenberg/pull/45906))
- Nav Block: Hide the create new menu button if the experiment is enabled. ([46019](https://github.com/WordPress/gutenberg/pull/46019))
- Navigation List view: Fix incorect class. ([46129](https://github.com/WordPress/gutenberg/pull/46129))
- Navigation List view: Include offcanvas specific styles. ([45963](https://github.com/WordPress/gutenberg/pull/45963))
- Navigation List view: Scroll horizontally when table overflows. ([45966](https://github.com/WordPress/gutenberg/pull/45966))
Expand Down Expand Up @@ -226,7 +236,14 @@
#### Full Site Editing
- Block editor: Separate content styles for the iframe. ([44298](https://github.com/WordPress/gutenberg/pull/44298))

### Tools

#### Build Tooling
- Bump caniuse-lite version. ([46093](https://github.com/WordPress/gutenberg/pull/46093))

#### Testing
- Fix Quote block's unwrap end-to-end test. ([46168](https://github.com/WordPress/gutenberg/pull/46168))
- Remove 'response.deleted' check. ([45992](https://github.com/WordPress/gutenberg/pull/45992))
- Warning: Fix ESLint warnings in tests. ([46033](https://github.com/WordPress/gutenberg/pull/46033))
- ESLint: Enable `testing-library/no-container` rule. ([46160](https://github.com/WordPress/gutenberg/pull/46160))
- Element: Fix `no-node-access` in `createInterpolateElement`. ([45894](https://github.com/WordPress/gutenberg/pull/45894))
Expand All @@ -237,12 +254,6 @@
- Compose: Fix 'no-container' violations in 'useDisabled' tests. ([45797](https://github.com/WordPress/gutenberg/pull/45797))
- Compose: Fix ESLint violations in `withGlobalEvents` tests. ([46012](https://github.com/WordPress/gutenberg/pull/46012))

### Tools

#### Build Tooling
- Bump caniuse-lite version. ([46093](https://github.com/WordPress/gutenberg/pull/46093))


## First time contributors

The following PRs were merged by first time contributors:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/create-block/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Note: The text portion is equivalent to `innerText` attribute of a DOM element.

## Edit and Save

The **attributes** are passed to the `edit` and `save` functions, along with a **setAttributes** function to set the values. Additional parameters are also passed in to these functions, see [the edit/save documentation](/docs/reference-guides/block-api/block-edit-save.md) for more details.
The **attributes** are passed to both the `edit` and `save` functions. The **setAttributes** function is also passed, but only to the `edit` function. The **setAttributes** function is used to set the values. Additional parameters are also passed in to the `edit` and `save` functions, see [the edit/save documentation](/docs/reference-guides/block-api/block-edit-save.md) for more details.

The `attributes` is a JavaScript object containing the values of each attribute, or default values if defined. The `setAttributes` is a function to update an attribute.

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/create-block/block-anatomy.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ registerBlockType( metadata.name, {
} );
```

The first parameter in the **registerBlockType** function is the block name, this should match exactly to the name registered in the PHP file.
The first parameter in the **registerBlockType** function is the block name, this should match exactly to the `name` property in the `block.json` file. By importing the metadata from `block.json` and referencing the `name` property in the first parameter we ensure that they will match, and continue to match even if the name is subsequently changed in `block.json`.

The second parameter to the function is the block object. See the [block registration documentation](/docs/reference-guides/block-api/block-registration.md) for full details.

The last two block object properties are **edit** and **save**, these are the key parts of a block. Both properties are functions that are included via the import above.

The results of the edit function is what the editor will render to the editor page when the block is inserted.

The results of the save function is what the editor will insert into the **post_content** field when the post is saved. The post_content field is the field in the WordPress database used to store the content of the post.
The results of the save function is what the editor will insert into the **post_content** field when the post is saved. The post_content field is the field in the **wp_posts** table in the WordPress database that is used to store the content of the post.

Most of the properties are set in the `src/block.json` file.

Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/block-api/block-registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ attributes: {

- **Type:** `Object`

Example provides structured example data for the block. This data is used to construct a preview for the block to be shown in the Inspector Help Panel when the user mouses over the block.
Example provides structured example data for the block. This data is used to construct a preview for the block to be shown in the Inspector Help Panel when the user mouses over the block and in the Styles panel when the block is selected.

The data provided in the example object should match the attributes defined. For example:

Expand Down
31 changes: 10 additions & 21 deletions docs/reference-guides/block-api/block-supports.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,36 +351,25 @@ supports: {
Link color presets are sourced from the `editor-color-palette` [theme support](/docs/how-to-guides/themes/theme-support.md#block-color-palettes).


When the block declares support for `color.link`, the attributes definition is extended to include two new attributes: `linkColor` and `style`:

- `linkColor`: attribute of `string` type with no default assigned.

When a user chooses from the list of preset link colors, the preset slug is stored in the `linkColor` attribute.

The block can apply a default preset text color by specifying its own attribute with a default e.g.:

```js
attributes: {
linkColor: {
type: 'string',
default: 'some-preset-link-color-slug',
}
}
```
When the block declares support for `color.link`, the attributes definition is extended to include the `style` attribute:

- `style`: attribute of `object` type with no default assigned.

When a custom link color is selected (i.e. using the custom color picker), the custom color value is stored in the `style.color.link` attribute.
When a link color is selected, the color value is stored in the `style.elements.link.color.text` attribute.

The block can apply a default custom link color by specifying its own attribute with a default e.g.:
The block can apply a default link color by specifying its own attribute with a default e.g.:

```js
attributes: {
style: {
type: 'object',
default: {
color: {
link: '#ff0000',
elements: {
link: {
color: {
text: '#ff0000',
}
}
}
}
}
Expand Down Expand Up @@ -583,7 +572,7 @@ attributes: {
}
```

A spacing property may define an array of allowable sides – 'top', 'right', 'bottom', 'left' – that can be configured. When such arbitrary sides are defined, only UI controls for those sides are displayed.
A spacing property may define an array of allowable sides – 'top', 'right', 'bottom', 'left' – that can be configured. When such arbitrary sides are defined, only UI controls for those sides are displayed.

Axial sides are defined with the `vertical` and `horizontal` terms, and display a single UI control for each axial pair (for example, `vertical` controls both the top and bottom sides). A spacing property may support arbitrary individual sides **or** axial sides, but not a mix of both.

Expand Down
4 changes: 2 additions & 2 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ Contains the block elements used to render a post, like the title, date, feature

- **Name:** core/post-template
- **Category:** theme
- **Supports:** align, typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** align, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**

## Post Terms
Expand Down Expand Up @@ -617,7 +617,7 @@ An advanced block that allows displaying post types based on different query par

- **Name:** core/query
- **Category:** theme
- **Supports:** align (full, wide), color (background, gradients, link, text), ~~html~~
- **Supports:** align (full, wide), ~~html~~
- **Attributes:** displayLayout, namespace, query, queryId, tagName

## No results
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ _Parameters_

_Returns_

- `?string`: Block Template Lock
- `string|false`: Block Template Lock

### hasBlockMovingClientId

Expand Down
41 changes: 28 additions & 13 deletions docs/reference-guides/data/data-core-edit-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ _Returns_

- `Array`: Template parts and their blocks in an array.

### getEditedPostContext

> **Deprecated**
Returns the edited post's context object.

_Parameters_

- _state_ `Object`: Global application state.

_Returns_

- `Object`: Page.

### getEditedPostId

Returns the ID of the currently edited template or template part.
Expand Down Expand Up @@ -72,22 +86,16 @@ _Returns_

### getHomeTemplateId

Returns the current home template ID.

_Parameters_

- _state_ `Object`: Global application state.

_Returns_

- `number?`: Home template ID.
> **Deprecated**
### getNavigationPanelActiveMenu

> **Deprecated**
### getPage

> **Deprecated**
Returns the current page object.

_Parameters_
Expand Down Expand Up @@ -230,14 +238,21 @@ _Parameters_
- _options_ `[Object]`:
- _options.allowUndo_ `[boolean]`: Whether to allow the user to undo reverting the template. Default true.

### setHomeTemplateId
### setEditedPostContext

Action that sets the home template ID to the template ID of the page resolved
from a given path.
Set's the current block editor context.

_Parameters_

- _homeTemplateId_ `number`: The template ID for the homepage.
- _context_ `Object`: The context object.

_Returns_

- `number`: The resolved template ID for the page route.

### setHomeTemplateId

> **Deprecated**
### setIsInserterOpened

Expand Down
4 changes: 2 additions & 2 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Plugin Name: Gutenberg
* Plugin URI: https://github.com/WordPress/gutenberg
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
* Requires at least: 5.9
* Requires at least: 6.0
* Requires PHP: 5.6
* Version: 14.7.0-rc.1
* Version: 14.7.1
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
Loading

0 comments on commit b5c2eec

Please sign in to comment.