Skip to content

Commit

Permalink
synched with the lastest as of 27-Jan-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
atachibana committed Jan 27, 2024
2 parents c519836 + dfa9efd commit 25f0035
Show file tree
Hide file tree
Showing 1,308 changed files with 43,823 additions and 37,653 deletions.
24 changes: 20 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ const restrictedImports = [
importNames: [ 'combineReducers' ],
message: 'Please use `combineReducers` from `@wordpress/data` instead.',
},
{
name: 'puppeteer-testing-library',
message: '`puppeteer-testing-library` is still experimental.',
},
{
name: '@emotion/css',
message:
Expand Down Expand Up @@ -361,6 +357,26 @@ module.exports = {
'jsdoc/require-param': 'off',
},
},
{
files: [ 'packages/components/src/**' ],
excludedFiles: [ 'packages/components/src/utils/colors-values.js' ],
rules: {
'no-restricted-syntax': [
'error',
{
selector: 'Literal[value=/--wp-admin-theme-/]',
message:
'--wp-admin-theme-* variables do not support component theming. Use variables from the COLORS object in packages/components/src/utils/colors-values.js instead.',
},
{
selector:
'TemplateElement[value.cooked=/--wp-admin-theme-/]',
message:
'--wp-admin-theme-* variables do not support component theming. Use variables from the COLORS object in packages/components/src/utils/colors-values.js instead.',
},
],
},
},
{
files: [ 'packages/components/src/**' ],
excludedFiles: [ 'packages/components/src/**/@(test|stories)/**' ],
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
/packages/report-flaky-tests @kevin940726

# wp-env
/packages/env @noahtallen @ObliviousHarmony @t-hamano
/packages/env @ObliviousHarmony @t-hamano

# PHP
/lib @spacedmonkey
Expand Down
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ updates:
labels:
- 'GitHub Actions'
- '[Type] Build Tooling'
groups:
github-actions:
patterns:
- '*'
exclude-patterns:
- 'actions/setup-java'
- 'gradle/*'
- 'reactivecircus/*'
react-native:
patterns:
- 'actions/setup-java'
- 'gradle/*'
- 'reactivecircus/*'
8 changes: 4 additions & 4 deletions .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: '.nvmrc'
check-latest: true
Expand Down Expand Up @@ -270,12 +270,12 @@ jobs:
run: echo "version=$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )" >> $GITHUB_OUTPUT

- name: Download Plugin Zip Artifact
uses: actions/download-artifact@7a1cd3216ca9260cd8022db641d960b1db4d1be4 # v4.0.0
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: gutenberg-plugin

- name: Download Release Notes Artifact
uses: actions/download-artifact@7a1cd3216ca9260cd8022db641d960b1db4d1be4 # v4.0.0
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: release-notes

Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
git config user.email [email protected]
- name: Setup Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: 'main/.nvmrc'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: '.nvmrc'
check-latest: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
ref: trunk
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v4.1.0
id: download_artifact
# Don't fail the job if there isn't any flaky tests report.
continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enforce-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
with:
mode: exactly
count: 1
labels: '[Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core'
labels: '[Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core'
add_comment: true
message: "**Warning: Type of PR label mismatch**\n\n To merge this PR, it requires {{ errorString }} {{ count }} label indicating the type of PR. Other labels are optional and not being checked here. \n- **Type-related labels to choose from**: {{ provided }}.\n- **Labels found**: {{ applied }}.\n\nRead more about [Type labels in Gutenberg](https://github.com/WordPress/gutenberg/labels?q=type). Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task."
exit_type: failure
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@94549999469dbfa032becf298d95c87a14c34394 # v40.2.2
uses: tj-actions/changed-files@716b1e13042866565e00e85fd4ec490e186c4a2f # v41.0.1
with:
files: |
*.{php}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ jobs:
- name: Setup Node.js
if: ${{ github.event.inputs.release_type != 'wp' }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: 'cli/.nvmrc'
registry-url: 'https://registry.npmjs.org'
check-latest: true

- name: Setup Node.js (for WP major version)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: 'publish/.nvmrc'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: '.nvmrc'
check-latest: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Java
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: 'corretto'
java-version: '17'
Expand All @@ -85,7 +85,7 @@ jobs:
run: npm run native test:e2e:setup

- name: Gradle cache
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a # v2.9.0
uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # v2.11.1

- name: AVD cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
Expand All @@ -98,7 +98,7 @@ jobs:

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # v2.28.0
uses: reactivecircus/android-emulator-runner@99a4aac18b4df9b3af66c4a1f04c1f23fa10c270 # v2.29.0
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
Expand All @@ -109,7 +109,7 @@ jobs:
script: echo "Generated AVD snapshot for caching."

- name: Run tests
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # v2.28.0
uses: reactivecircus/android-emulator-runner@99a4aac18b4df9b3af66c4a1f04c1f23fa10c270 # v2.29.0
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
>>>>>>> upstream/trunk

- name: Use desired version of Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: '.nvmrc'
check-latest: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jobs:
sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" ./trunk/readme.txt
- name: Download Changelog Artifact
uses: actions/download-artifact@7a1cd3216ca9260cd8022db641d960b1db4d1be4 # v4.0.0
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: changelog trunk
path: trunk
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" "$VERSION/readme.txt"
- name: Download Changelog Artifact
uses: actions/download-artifact@7a1cd3216ca9260cd8022db641d960b1db4d1be4 # v4.0.0
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: changelog trunk
path: ${{ github.event.release.name }}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Gutenberg

Copyright 2016-2023 by the contributors
Copyright 2016-2024 by the contributors

**License for Contributions (on and after April 15, 2021)**

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Get hands on: check out the [block editor live demo](https://wordpress.org/guten
Extending and customizing is at the heart of the WordPress platform, this is no different for the Gutenberg project. The editor and future products can be extended by third-party developers using plugins.
Review the [Create a Block tutorial](/docs/getting-started/create-block/README.md) for the fastest way to get started extending the block editor. See the [Developer Documentation](https://developer.wordpress.org/block-editor/#develop-for-the-block-editor) for extensive tutorials, documentation, and API references.
Review the [Create a Block tutorial](/docs/getting-started/devenv/get-started-with-create-block.md) for the fastest way to get started extending the block editor. See the [Developer Documentation](https://developer.wordpress.org/block-editor/#develop-for-the-block-editor) for extensive tutorials, documentation, and API references.
### Contribute to Gutenberg
Expand Down
40 changes: 39 additions & 1 deletion bin/api-docs/gen-theme-reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,42 @@ const keys = ( maybeObject ) => {
return Object.keys( maybeObject );
};

/**
* Get definition from ref.
*
* @param {string} ref
* @return {Object} definition
* @throws {Error} If the referenced definition is not found in 'themejson.definitions'.
*
* @example
* getDefinition( '#/definitions/typographyProperties/properties/fontFamily' )
* // returns themejson.definitions.typographyProperties.properties.fontFamily
*/
const resolveDefinitionRef = ( ref ) => {
const refParts = ref.split( '/' );
const definition = refParts[ refParts.length - 1 ];
if ( ! themejson.definitions[ definition ] ) {
throw new Error( `Can't resolve '${ ref }'. Definition not found` );
}
return themejson.definitions[ definition ];
};

/**
* Get properties from an array.
*
* @param {Object} items
* @return {Object} properties
*/
const getPropertiesFromArray = ( items ) => {
// if its a $ref resolve it
if ( items.$ref ) {
return resolveDefinitionRef( items.$ref ).properties;
}

// otherwise just return the properties
return items.properties;
};

/**
* Convert settings properties to markup.
*
Expand All @@ -96,7 +132,9 @@ const getSettingsPropertiesMarkup = ( struct ) => {
const def = 'default' in props[ key ] ? props[ key ].default : '';
const ps =
props[ key ].type === 'array'
? keys( props[ key ].items.properties ).sort().join( ', ' )
? keys( getPropertiesFromArray( props[ key ].items ) )
.sort()
.join( ', ' )
: '';
markup += `| ${ key } | ${ props[ key ].type } | ${ def } | ${ ps } |\n`;
} );
Expand Down
Loading

0 comments on commit 25f0035

Please sign in to comment.