Skip to content

Commit

Permalink
Merge branch 'trunk' into feature/better-create-new-post-link-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
carstingaxion committed Jun 6, 2024
2 parents 0c1cf66 + 6831711 commit 59a7a28
Show file tree
Hide file tree
Showing 143 changed files with 1,722 additions and 1,516 deletions.
133 changes: 70 additions & 63 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,72 @@ const restrictedImports = [
},
];

const restrictedSyntax = [
// NOTE: We can't include the forward slash in our regex or
// we'll get a `SyntaxError` (Invalid regular expression: \ at end of pattern)
// here. That's why we use \\u002F in the regexes below.
{
selector:
'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]',
message: 'Path access on WordPress dependencies is not allowed.',
},
{
selector:
'CallExpression[callee.name="deprecated"] Property[key.name="version"][value.value=/' +
majorMinorRegExp +
'/]',
message:
'Deprecated functions must be removed before releasing this version.',
},
{
selector:
'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]',
message:
'This method is deprecated. You should use the more explicit API methods available.',
},
{
selector:
'CallExpression[callee.object.name="page"][callee.property.name="waitForTimeout"]',
message: 'Prefer page.waitForSelector instead.',
},
{
selector: 'JSXAttribute[name.name="id"][value.type="Literal"]',
message:
'Do not use string literals for IDs; use withInstanceId instead.',
},
{
// Discourage the usage of `Math.random()` as it's a code smell
// for UUID generation, for which we already have a higher-order
// component: `withInstanceId`.
selector:
'CallExpression[callee.object.name="Math"][callee.property.name="random"]',
message:
'Do not use Math.random() to generate unique IDs; use withInstanceId instead. (If you’re not generating unique IDs: ignore this message.)',
},
{
selector:
'CallExpression[callee.name="withDispatch"] > :function > BlockStatement > :not(VariableDeclaration,ReturnStatement)',
message:
'withDispatch must return an object with consistent keys. Avoid performing logic in `mapDispatchToProps`.',
},
{
selector:
'LogicalExpression[operator="&&"][left.property.name="length"][right.type="JSXElement"]',
message:
'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
},
];

/** `no-restricted-syntax` rules for components. */
const restrictedSyntaxComponents = [
{
selector:
'JSXOpeningElement[name.name="Button"]:not(:has(JSXAttribute[name.name="__experimentalIsFocusable"])) JSXAttribute[name.name="disabled"]',
message:
'`disabled` used without the `__experimentalIsFocusable` prop. Disabling a control without maintaining focusability can cause accessibility issues, by hiding their presence from screen reader users, or preventing focus from returning to a trigger element. (Ignore this error if you truly mean to disable.)',
},
];

module.exports = {
root: true,
extends: [
Expand Down Expand Up @@ -147,63 +213,7 @@ module.exports = {
disallowTypeAnnotations: false,
},
],
'no-restricted-syntax': [
'error',
// NOTE: We can't include the forward slash in our regex or
// we'll get a `SyntaxError` (Invalid regular expression: \ at end of pattern)
// here. That's why we use \\u002F in the regexes below.
{
selector:
'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]',
message:
'Path access on WordPress dependencies is not allowed.',
},
{
selector:
'CallExpression[callee.name="deprecated"] Property[key.name="version"][value.value=/' +
majorMinorRegExp +
'/]',
message:
'Deprecated functions must be removed before releasing this version.',
},
{
selector:
'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]',
message:
'This method is deprecated. You should use the more explicit API methods available.',
},
{
selector:
'CallExpression[callee.object.name="page"][callee.property.name="waitForTimeout"]',
message: 'Prefer page.waitForSelector instead.',
},
{
selector: 'JSXAttribute[name.name="id"][value.type="Literal"]',
message:
'Do not use string literals for IDs; use withInstanceId instead.',
},
{
// Discourage the usage of `Math.random()` as it's a code smell
// for UUID generation, for which we already have a higher-order
// component: `withInstanceId`.
selector:
'CallExpression[callee.object.name="Math"][callee.property.name="random"]',
message:
'Do not use Math.random() to generate unique IDs; use withInstanceId instead. (If you’re not generating unique IDs: ignore this message.)',
},
{
selector:
'CallExpression[callee.name="withDispatch"] > :function > BlockStatement > :not(VariableDeclaration,ReturnStatement)',
message:
'withDispatch must return an object with consistent keys. Avoid performing logic in `mapDispatchToProps`.',
},
{
selector:
'LogicalExpression[operator="&&"][left.property.name="length"][right.type="JSXElement"]',
message:
'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
},
],
'no-restricted-syntax': [ 'error', ...restrictedSyntax ],
},
overrides: [
{
Expand Down Expand Up @@ -262,12 +272,8 @@ module.exports = {
rules: {
'no-restricted-syntax': [
'error',
{
selector:
'JSXOpeningElement[name.name="Button"]:not(:has(JSXAttribute[name.name="__experimentalIsFocusable"])) JSXAttribute[name.name="disabled"]',
message:
'`disabled` used without the `__experimentalIsFocusable` prop. Disabling a control without maintaining focusability can cause accessibility issues, by hiding their presence from screen reader users, or preventing focus from returning to a trigger element. (Ignore this error if you truly mean to disable.)',
},
...restrictedSyntax,
...restrictedSyntaxComponents,
],
},
},
Expand Down Expand Up @@ -390,6 +396,7 @@ module.exports = {
rules: {
'no-restricted-syntax': [
'error',
...restrictedSyntax,
{
selector:
':matches(Literal[value=/--wp-admin-theme-/],TemplateElement[value.cooked=/--wp-admin-theme-/])',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['20', '21']
node: ['20', '22']
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php-changes-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Get changed PHP files
id: changed-files-php
uses: tj-actions/changed-files@03334d095e2739fa9ac4034ec16f66d5d01e9eba # v44.5.1
uses: tj-actions/changed-files@d6babd6899969df1a11d14c368283ea4436bca78 # v44.5.2
with:
files: |
lib/**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rnmobile-ios-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
- uses: ruby/setup-ruby@d5fb7a202fc07872cb44f00ba8e6197b70cb0c55 # v1.179.0
with:
# `.ruby-version` file location
working-directory: packages/react-native-editor/ios
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['20', '21']
node: ['20', '22']
shard: ['1/4', '2/4', '3/4', '4/4']

steps:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['20', '21']
node: ['20', '22']

steps:
- name: Checkout repository
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
# dependency versions are installed and cached.
##
- name: Set up PHP
uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2.30.4
uses: shivammathur/setup-php@fc14643b0a99ee9db10a3c025a33d76544fa3761 # v2.30.5
with:
php-version: '${{ matrix.php }}'
ini-file: development
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Set up PHP
uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2.30.4
uses: shivammathur/setup-php@fc14643b0a99ee9db10a3c025a33d76544fa3761 # v2.30.5
with:
php-version: '7.4'
coverage: none
Expand Down
4 changes: 3 additions & 1 deletion backport-changelog/6.6/6616.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ https://github.com/WordPress/wordpress-develop/pull/6616

* https://github.com/WordPress/gutenberg/pull/58409
* https://github.com/WordPress/gutenberg/pull/61328
* https://github.com/WordPress/gutenberg/pull/61842
* https://github.com/WordPress/gutenberg/pull/61842
* https://github.com/WordPress/gutenberg/pull/62199
* https://github.com/WordPress/gutenberg/pull/62252
3 changes: 3 additions & 0 deletions backport-changelog/6.6/6731.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/6731

* https://github.com/WordPress/gutenberg/pull/62299
3 changes: 3 additions & 0 deletions backport-changelog/6.6/6737.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/6737

* https://github.com/WordPress/gutenberg/pull/62305
3 changes: 3 additions & 0 deletions backport-changelog/6.6/6744.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/6744

* https://github.com/WordPress/gutenberg/pull/62355
9 changes: 7 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
== Changelog ==

= 18.5.0-rc.1 =

= 18.5.0 =

## Changelog

Expand Down Expand Up @@ -111,6 +110,7 @@
- Lock binding editing with functions. ([61734](https://github.com/WordPress/gutenberg/pull/61734))

#### Block Variations
- Detect active variation correctly based on RichText attribute. ([62325](https://github.com/WordPress/gutenberg/pull/62325))
- Have `getActiveBlockVariation` return variation with highest specificity. ([62031](https://github.com/WordPress/gutenberg/pull/62031))
- Support dot notation in `isActive` string array. ([62088](https://github.com/WordPress/gutenberg/pull/62088))

Expand All @@ -137,6 +137,8 @@

### Bug Fixes

- Editor: Only render the site logo once if there's a fill. ([62320](https://github.com/WordPress/gutenberg/pull/62320))
- Interactivity API: Increase directive `wp-each-child` priority. ([62293](https://github.com/WordPress/gutenberg/pull/62293))w
- Compose: Fix 'useFocusOnMount' cleanup callback. ([62053](https://github.com/WordPress/gutenberg/pull/62053))
- Do not auto save post status changes. ([62171](https://github.com/WordPress/gutenberg/pull/62171))
- Editor: Fix canvas padding in post editor. ([61893](https://github.com/WordPress/gutenberg/pull/61893))
Expand Down Expand Up @@ -167,6 +169,7 @@
- Post Actions: Hide the trash action for auto-drafts. ([61865](https://github.com/WordPress/gutenberg/pull/61865))

#### Block Editor
- Inserter: Update Openverse API URLs. ([62241](https://github.com/WordPress/gutenberg/pull/62241))
- Fix being unable to switch modes while inserter is open. ([61563](https://github.com/WordPress/gutenberg/pull/61563))
- Fix editor inserter tabs indicator. ([61973](https://github.com/WordPress/gutenberg/pull/61973))
- Fix positioning of close icons in panels to be consistent. ([61832](https://github.com/WordPress/gutenberg/pull/61832))
Expand Down Expand Up @@ -467,6 +470,8 @@ The following contributors merged PRs in this release:
@aaronrobertshaw @abhi3315 @afercia @ajlende @akashdhawade2005 @akasunil @Aljullu @amitraj2203 @andrewserong @anton-vlasenko @anver @artemiomorales @carolinan @cbravobernal @colorful-tones @creativecoder @DaniGuardiola @DAreRodz @dbrian @draganescu @ellatrix @fabiankaegy @fullofcaffeine @gemkev @geriux @glendaviesnz @gziolo @jameskoster @jasmussen @jeryj @jorgefilipecosta @jsnajdr @kellenmace @kevin940726 @kt-12 @madhusudhand @Mamaduka @mattsherman @mcsf @michalczaplinski @mirka @narenin @nateinaction @ndiego @ntsekouras @oandregal @ockham @paolopiaggio @ramonjd @retrofox @richtabor @sanjucta @SantosGuillamot @scruffian @senadir @shail-mehta @sirreal @stokesman @t-hamano @talldan @taylorgorman @tellthemachines @tjcafferkey @twstokes @tyxla @vcanales @vipul0425 @westonruter @WunderBart @youknowriad




= 18.4.1 =

## Changelog
Expand Down
29 changes: 15 additions & 14 deletions docs/how-to-guides/themes/global-settings-and-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,20 +310,21 @@ There's one special setting property, `appearanceTools`, which is a boolean and

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.lineHeight` to `true`. |
| `custom-spacing` | Set `spacing.padding` 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`. |
| `appearance-tools` | Set `appearanceTools` to `true`. |
| `border` | Set `border: color, radius, style, width` to `true`. |
| `link-color ` | Set `color.link` to `true`. |
| add_theme_support | theme.json setting |
| --------------------------- | ------------------------------------------------------------- |
| `custom-line-height` | Set `typography.lineHeight` to `true`. |
| `custom-spacing` | Set `spacing.padding` 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`. |
| `editor-spacing-sizes` | Provide the list of spacing sizes via `spacing.spacingSizes`. |
| `appearance-tools` | Set `appearanceTools` to `true`. |
| `border` | Set `border: color, radius, style, width` to `true`. |
| `link-color ` | Set `color.link` to `true`. |

#### Presets

Expand Down
Loading

0 comments on commit 59a7a28

Please sign in to comment.