Skip to content

Commit

Permalink
Merge branch 'trunk' into try/minified-and-unminified-entries-webpack…
Browse files Browse the repository at this point in the history
…-take-2

* trunk: (57 commits)
  Image block: fix cover transform and excessive re-rendering (#32102)
  compose: Add types to useMergeRefs (#31939)
  Navigation: Fix collapsing regression. (#32081)
  components: Promote Elevation (#31614)
  compose: Add types to useReducedMotion and useMediaQuery (#31941)
  Update the graphic that appears in the Template Editor welcome guide (#32055)
  Block Navigation: use CSS for indentation with known max indent instead of spacer divs (#32063)
  Fix broken template part converter modal styles. (#32097)
  compose: Add types to `usePrevious` (#31944)
  components: Add ZStack (#31613)
  components: Fix Shortcut polymorphism (#31555)
  compose: Add types to `useFocusReturn` (#31949)
  compose: Add types to `useDebounce` (#32015)
  List View: Simplify the BlockNavigation component (#31290)
  Remove query context leftovers (#32093)
  Remove filter_var from blocks (#32046)
  Templates: Remove now-obsolete gutenberg_get_template_paths() (#32066)
  [RNMobile] Enable reusable block only in WP.com sites (#31744)
  Rename ViewOwnProps to PolymorphicComponentProps (#32053)
  Rich text: remove inline display warning (#32013)
  ...
  • Loading branch information
fullofcaffeine committed May 22, 2021
2 parents 11e6ee7 + 5215429 commit 2f71f41
Show file tree
Hide file tree
Showing 352 changed files with 3,204 additions and 2,220 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ on:
description: 'rc or stable?'
required: true

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
bump-version:
name: Bump version
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: Compressed Size

on: [pull_request]

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
build:
name: Check
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/cancel.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/create-block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
push:
branches: [trunk, wp/trunk]

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
checks:
name: Checks
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
- 'release/**'
- 'wp/**'

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
admin:
name: Admin - ${{ matrix.part }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
release:
types: [published]

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
performance:
name: Run performance tests
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
push:
branches: [trunk]

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
test:
runs-on: macos-latest
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
push:
branches: [trunk]

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
test:
runs-on: macos-latest
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
- 'release/**'
- 'wp/**'

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
check:
name: All
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ on:
- 'release/**'
- 'wp/**'

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
unit-js:
name: JavaScript
Expand Down
1 change: 1 addition & 0 deletions bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ build_files=$(
build/block-library/blocks/*.php \
build/block-library/blocks/*/block.json \
build/block-library/blocks/*/*.css \
build/block-library/blocks/*/*.js \
build/edit-widgets/blocks/*/block.json \
)

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 @@ -262,7 +262,7 @@ async function runPerformanceTests( branches, options ) {
log( '>> Starting the WordPress environment' );
await runShellScript( 'npm run wp-env start', environmentDirectory );

const testSuites = [ 'post-editor', 'i18n-filters', 'site-editor' ];
const testSuites = [ 'post-editor', 'site-editor' ];

/** @type {Record<string,Record<string, WPFormattedPerformanceResults>>} */
let results = {};
Expand Down
16 changes: 16 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
== Changelog ==

= 10.6.2 =



### Bug Fixes

- Workflows: Fix "Stable tag:" readme.txt field in SVN upload. ([31897](https://github.com/WordPress/gutenberg/pull/31897))
- Gallery: Fix Image Size regression. ([31884](https://github.com/WordPress/gutenberg/pull/31884))

### Various

- Plugin: Guard `construct_wp_query_args` with check if implemented in WordPress Core. ([32008](https://github.com/WordPress/gutenberg/pull/32008))




= 10.6.1 =

### Bug Fixes
Expand Down
4 changes: 4 additions & 0 deletions docs/how-to-guides/backward-compatibility/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

For features included in the Gutenberg plugin, the deprecation policy is intended to support backward compatibility for two minor plugin releases, when possible. Features and code included in a stable release of WordPress are not included in this deprecation timeline, and are instead subject to the [versioning policies of the WordPress project](https://make.wordpress.org/core/handbook/about/release-cycle/version-numbering/). The current deprecations are listed below and are grouped by _the version at which they will be removed completely_. If your plugin depends on these behaviors, you must update to the recommended alternative before the noted version.

## 11.0.0

- `wp.blocks.registerBlockTypeFromMetadata` method has been removed. Use `wp.blocks.registerBlockType` method instead.

## 10.3.0

- Passing a tuple of components with `as` prop to `ActionItem.Slot` component is no longer supported. Please pass a component with `as` prop instead. Example:
Expand Down
73 changes: 49 additions & 24 deletions docs/how-to-guides/themes/theme-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ This field describes the format of the `theme.json` file and it's used to detect

### Settings

The settings section has the following structure and default values:
The settings section has the following structure:

```json
{
Expand All @@ -166,36 +166,36 @@ The settings section has the following structure and default values:
"customColor": false,
"customRadius": false,
"customStyle": false,
"customWidth": false,
"customWidth": false
},
"color": {
"custom": true, /* Supersedes add_theme_support('disable-custom-colors') */
"customGradient": true, /* Supersedes add_theme_support('disable-custom-gradients') */
"duotone": [], /* Duotone presets } */
"gradients": [], /* Gradient presets, supersedes add_theme_support('editor-gradient-presets', ... ) */
"link": false, /* Supersedes add_theme_support('experimental-link-color') */
"palette": [], /* Color presets, supersedes add_theme_support('editor-color-palette', ... ) */
"custom": true,
"customGradient": true,
"duotone": [],
"gradients": [],
"link": false,
"palette": []
},
"custom": {},
"layout": { /* Default layout to be used in the post editor */
"layout": {
"contentSize": "800px",
"wideSize": "1000px",
"wideSize": "1000px"
},
"spacing": {
"customMargin": false,
"customPadding": false, /* Supersedes add_theme_support('custom-spacing') */
"units": [ "px", "em", "rem", "vh", "vw" ], /* filter values, as in add_theme_support('custom-units', ... ) */
"customPadding": false,
"units": [ "px", "em", "rem", "vh", "vw" ]
},
"typography": {
"customFontSize": true, /* Supersedes add_theme_support( 'disable-custom-font-sizes' ) */
"customFontSize": true,
"customFontStyle": true,
"customFontWeight": true,
"customLineHeight": false, /* Supersedes add_theme_support( 'custom-line-height' ) */
"customLineHeight": false,
"customTextDecorations": true,
"customTextTransforms": true,
"dropCap": true,
"fontFamilies": [],
"fontSizes": [], /* Font size presets, supersedes add_theme_support('editor-font-sizes', ... ) */
"fontSizes": []
},
"blocks": {
"core/paragraph": {
Expand All @@ -213,9 +213,24 @@ The settings section has the following structure and default values:
}
```



Each block can configure any of these settings separately, providing a more fine-grained control over what exists via `add_theme_support`. The settings declared at the top-level affect to all blocks, unless a particular block overwrites it. It's a way to provide inheritance and configure all blocks at once.

To retain backward compatibility, the existing `add_theme_support` declarations that configure the block editor are retrofit in the proper categories for the top-level section. For example, if a theme uses `add_theme_support('disable-custom-colors')`, it'll be the same as setting `settings.color.custom` to `false`. If the `theme.json` contains any settings, these will take precedence over the values declared via `add_theme_support`.
To retain backward compatibility, the existing `add_theme_support` declarations that configure the block editor are retrofit in the proper categories for the top-level section. For example, if a theme uses `add_theme_support('disable-custom-colors')`, it'll be the same as setting `settings.color.custom` to `false`. If the `theme.json` contains any settings, these will take precedence over the values declared via `add_theme_support`. This is the complete list of equivalences:

| add_theme_support | theme.json setting |
| --------------------------- | --------------------------------------------------------- |
| `custom-line-height` | Set `typography.customLineHeight`to `false`. |
| `custom-spacing` | Set `spacing.customPadding` to `true`. |
| `custom-units` | Provide the list of units via `spacing.units`. |
| `disable-custom-colors` | Set `color.custom` to `false`. |
| `disable-custom-font-sizes` | Set `typography.customFontSize` to `false`. |
| `disable-custom-gradients` | Set `color.customGradient` to `false`. |
| `editor-color-palette` | Provide the list of colors via `color.palette`. |
| `editor-font-sizes` | Provide the list of font size via `typography.fontSizes`. |
| `editor-gradient-presets` | Provide the list of gradients via `color.gradients`. |
| `experimental-link-color` | Set `color.link` to `true`. |

Let's say a theme author wants to enable custom colors only for the paragraph block. This is how it can be done:

Expand All @@ -224,12 +239,12 @@ Let's say a theme author wants to enable custom colors only for the paragraph bl
"version": 1,
"settings": {
"color": {
"custom": false // Disable it for all blocks.
"custom": false
},
"blocks": {
"core/paragraph": {
"color": {
"custom": true // Paragraph overrides the setting.
"custom": true
}
}
}
Expand Down Expand Up @@ -516,7 +531,8 @@ Each block declares which style properties it exposes via the [block supports me
"h5": {},
"h6": {}
}
}
},
"etc": {}
}
}
}
Expand Down Expand Up @@ -688,17 +704,22 @@ h3 {

Within this field themes can list the custom templates present in the `block-templates` folder. For example, for a custom template named `my-custom-template.html`, the `theme.json` can declare what post types can use it and what's the title to show the user:

- name: mandatory.
- title: mandatory, translatable.
- postTypes: optional, only applies to the `page` by default.

```json
{
"version": 1,
"customTemplates": [
{
"name": "my-custom-template" /* Mandatory */,
"title": "The template title" /* Mandatory, translatable */,
"name": "my-custom-template",
"title": "The template title",
"postTypes": [
"page",
"post",
"my-cpt"
] /* Optional, will only apply to "page" by default. */
]
}
]
}
Expand All @@ -710,12 +731,16 @@ Within this field themes can list the template parts present in the `block-templ

Currently block variations exist for "header" and "footer" values of the area term, any other values and template parts not defined in the json will default to the general template part block. Variations will be denoted by specific icons within the editor's interface, will default to the corresponding semantic HTML element for the wrapper (this can also be overridden by the `tagName` attribute set on the template part block), and will contextualize the template part allowing more custom flows in future editor improvements.

- name: mandatory.
- area: optional, will be set to `uncategorized` by default and trigger no block variation.

```json
{
"version": 1,
"templateParts": [
{
"name": "my-template-part" /* Mandatory */,
"area": "header" /* Optional, will be set to 'uncategorized' by default and trigger no block variation */
"name": "my-template-part",
"area": "header"
}
]
}
Expand Down
12 changes: 12 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@
"markdown_source": "../packages/components/src/duotone-picker/README.md",
"parent": "components"
},
{
"title": "Elevation",
"slug": "elevation",
"markdown_source": "../packages/components/src/elevation/README.md",
"parent": "components"
},
{
"title": "ExternalLink",
"slug": "external-link",
Expand Down Expand Up @@ -1229,6 +1235,12 @@
"markdown_source": "../packages/components/src/visually-hidden/README.md",
"parent": "components"
},
{
"title": "ZStack",
"slug": "z-stack",
"markdown_source": "../packages/components/src/z-stack/README.md",
"parent": "components"
},
{
"title": "Package Reference",
"slug": "packages",
Expand Down
6 changes: 3 additions & 3 deletions docs/reference-guides/block-api/block-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,16 +470,16 @@ Implementation follows the existing [get_plugin_data](https://codex.wordpress.or

### JavaScript

In JavaScript, you need to use `registerBlockTypeFromMetadata` method from `@wordpress/blocks` package to process loaded block metadata. All localized properties get automatically wrapped in `_x` (from `@wordpress/i18n` package) function calls similar to how it works in PHP.
In JavaScript, you can use `registerBlockType` method from `@wordpress/blocks` package and pass the metadata object loaded from `block.json` as the first param. All localized properties get automatically wrapped in `_x` (from `@wordpress/i18n` package) function calls similar to how it works in PHP.

**Example:**

```js
import { registerBlockTypeFromMetadata } from '@wordpress/blocks';
import { registerBlockType } from '@wordpress/blocks';
import Edit from './edit';
import metadata from './block.json';

registerBlockTypeFromMetadata( metadata, {
registerBlockType( metadata, {
edit: Edit,
// ...other client-side settings
} );
Expand Down
Loading

0 comments on commit 2f71f41

Please sign in to comment.