Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:WordPress/gutenberg into enhanceme…
Browse files Browse the repository at this point in the history
…nt/inline-commenting-comments-order
  • Loading branch information
akasunil committed Nov 19, 2024
2 parents 67441de + c772226 commit 5574c5e
Show file tree
Hide file tree
Showing 422 changed files with 3,721 additions and 2,478 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ module.exports = {
'plugin:eslint-comments/recommended',
'plugin:storybook/recommended',
],
plugins: [ 'react-compiler' ],
globals: {
wp: 'off',
globalThis: 'readonly',
Expand Down Expand Up @@ -222,6 +223,15 @@ module.exports = {
definedTags: [ 'jest-environment' ],
},
],
'react-compiler/react-compiler': [
'error',
{
environment: {
enableTreatRefLikeIdentifiersAsRefs: true,
validateRefAccessDuringRender: false,
},
},
],
},
overrides: [
{
Expand All @@ -236,6 +246,7 @@ module.exports = {
'import/no-unresolved': 'off',
'import/named': 'off',
'@wordpress/data-no-store-string-literals': 'off',
'react-compiler/react-compiler': 'off',
},
},
{
Expand Down Expand Up @@ -551,6 +562,7 @@ module.exports = {
{
files: [ 'packages/interactivity*/src/**' ],
rules: {
'react-compiler/react-compiler': 'off',
'react/react-in-jsx-scope': 'error',
},
},
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Java
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'corretto'
java-version: '17'
Expand All @@ -47,7 +47,7 @@ jobs:
run: npm run native test:e2e:setup

- name: Gradle cache
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0

# AVD cache disabled as it caused emulator termination to hang indefinitely.
# https://github.com/ReactiveCircus/android-emulator-runner/issues/385
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@7bae1d00b5db9166f4f0fc47985a3a5702cb58f0 # v1.197.0
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
with:
# `.ruby-version` file location
working-directory: packages/react-native-editor/ios
Expand Down
4 changes: 4 additions & 0 deletions backport-changelog/6.8/7265.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
https://github.com/WordPress/wordpress-develop/pull/7265

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

* https://github.com/WordPress/gutenberg/pull/66948
310 changes: 310 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/getting-started/fundamentals/block-in-the-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export default function Edit( { attributes, setAttributes } ) {
</div>
</InspectorControls>
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
value={ attributes.message }
onChange={ ( val ) => setAttributes( { message: val } ) }
style={ {
Expand Down
4 changes: 4 additions & 0 deletions docs/getting-started/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ export default function Edit( { attributes, setAttributes } ) {
<InspectorControls>
<PanelBody title={ __( 'Settings', 'copyright-date-block' ) }>
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __(
'Starting year',
'copyright-date-block'
Expand Down Expand Up @@ -540,6 +542,8 @@ export default function Edit( { attributes, setAttributes } ) {
/>
{ showStartingYear && (
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __(
'Starting year',
'copyright-date-block'
Expand Down
10 changes: 10 additions & 0 deletions docs/how-to-guides/data-basics/3-building-an-edit-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ function EditPageForm( { pageId, onCancel, onSaveFinished } ) {
return (
<div className="my-gutenberg-form">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
value=''
label='Page title:'
/>
Expand Down Expand Up @@ -139,6 +141,8 @@ function EditPageForm( { pageId, onCancel, onSaveFinished } ) {
return (
<div className="my-gutenberg-form">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label='Page title:'
value={ page.title.rendered }
/>
Expand All @@ -164,6 +168,8 @@ function VanillaReactForm({ initialTitle }) {
const [title, setTitle] = useState( initialTitle );
return (
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
value={ title }
onChange={ setTitle }
/>
Expand Down Expand Up @@ -233,6 +239,8 @@ function EditPageForm( { pageId, onCancel, onSaveFinished } ) {
return (
<div className="my-gutenberg-form">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label="Page title:"
value={ page.title }
onChange={ handleChange }
Expand Down Expand Up @@ -501,6 +509,8 @@ function EditPageForm( { pageId, onCancel, onSaveFinished } ) {
return (
<div className="my-gutenberg-form">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label="Page title:"
value={ page.title }
onChange={ handleChange }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ function PageForm( { title, onChangeTitle, hasEdits, lastError, isSaving, onCanc
return (
<div className="my-gutenberg-form">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label="Page title:"
value={ title }
onChange={ onChangeTitle }
Expand Down Expand Up @@ -346,6 +348,8 @@ function PageForm( { title, onChangeTitle, hasEdits, lastError, isSaving, onCanc
return (
<div className="my-gutenberg-form">
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label="Page title:"
value={ title }
onChange={ onChangeTitle }
Expand Down
2 changes: 2 additions & 0 deletions docs/how-to-guides/metabox.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ registerBlockType( 'myguten/meta-block', {
return (
<div { ...blockProps }>
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label="Meta Block Field"
value={ metaFieldValue }
onChange={ updateMetaValue }
Expand Down
2 changes: 2 additions & 0 deletions docs/reference-guides/block-api/block-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ export default function Edit( props ) {
return (
<div>
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Record ID' ) }
value={ recordId }
onChange={ ( val ) =>
Expand Down
4 changes: 4 additions & 0 deletions docs/reference-guides/block-api/block-edit-save.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ edit: ( { attributes, setAttributes } ) => {
return (
<div { ...blockProps }>
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label='My Text Field'
value={ attributes.content }
onChange={ updateFieldValue }
Expand Down Expand Up @@ -246,6 +248,8 @@ edit: ( { attributes, setAttributes } ) => {
return (
<div { ...blockProps }>
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label='Number Posts to Show'
value={ attributes.postsToShow }
onChange={ ( val ) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr
- **Name:** core/page-list
- **Category:** widgets
- **Allowed Blocks:** core/page-list-item
- **Supports:** interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Supports:** interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** isNested, parentPageID

## Page List Item
Expand Down
14 changes: 14 additions & 0 deletions docs/reference-guides/data/data-core-edit-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ _Returns_

### getEditedPostId

> **Deprecated**
Returns the ID of the currently edited template or template part.

_Parameters_
Expand All @@ -64,6 +66,8 @@ _Returns_

### getEditedPostType

> **Deprecated**
Returns the current edited post type (wp_template or wp_template_part).

_Parameters_
Expand Down Expand Up @@ -189,6 +193,8 @@ _Returns_
### isPage

> **Deprecated**
Whether or not the editor has a page loaded into it.

_Related_
Expand Down Expand Up @@ -273,6 +279,8 @@ _Parameters_

### setEditedEntity

> **Deprecated**
Action that sets an edited entity.

_Parameters_
Expand All @@ -287,6 +295,8 @@ _Returns_

### setEditedPostContext

> **Deprecated**
Set's the current block editor context.

_Parameters_
Expand Down Expand Up @@ -345,6 +355,8 @@ _Parameters_

### setNavigationMenu

> **Deprecated**
Action that sets a navigation menu.

_Parameters_
Expand Down Expand Up @@ -385,6 +397,8 @@ _Returns_

### setTemplatePart

> **Deprecated**
Action that sets a template part.

_Parameters_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const PluginSidebarMoreMenuItemTest = () => {
) }
</p>
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Text Control' ) }
value={ text }
onChange={ ( newText ) => setText( newText ) }
Expand Down
2 changes: 2 additions & 0 deletions docs/reference-guides/slotfills/plugin-sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const PluginSidebarExample = () => {
) }
</p>
<TextControl
__nextHasNoMarginBottom
__next40pxDefaultSize
label={ __( 'Text Control' ) }
value={ text }
onChange={ ( newText ) => setText( newText ) }
Expand Down
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.5
* Requires PHP: 7.2
* Version: 19.6.1
* Version: 19.7.0-rc.2
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
14 changes: 13 additions & 1 deletion lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -2749,9 +2749,21 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt
foreach ( $theme_json['styles']['blocks'] as $name => $node ) {
$node_path = array( 'styles', 'blocks', $name );
if ( $include_node_paths_only ) {
$nodes[] = array(
$variation_paths = array();
if ( $include_variations && isset( $node['variations'] ) ) {
foreach ( $node['variations'] as $variation => $variation_node ) {
$variation_paths[] = array(
'path' => array( 'styles', 'blocks', $name, 'variations', $variation ),
);
}
}
$node = array(
'path' => $node_path,
);
if ( ! empty( $variation_paths ) ) {
$node['variations'] = $variation_paths;
}
$nodes[] = $node;
} else {
$selector = null;
if ( isset( $selectors[ $name ]['selector'] ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
class Gutenberg_REST_Comment_Controller_6_8 extends WP_REST_Comments_Controller {

public function create_item_permissions_check( $request ) {
if ( empty( $request['comment_type'] ) || 'comment' === $request['comment_type'] ) {
return parent::create_item_permissions_check( $request );
}

if ( ! is_user_logged_in() ) {
if ( get_option( 'comment_registration' ) ) {
return new WP_Error(
Expand Down Expand Up @@ -90,14 +94,6 @@ public function create_item_permissions_check( $request ) {
);
}

if ( 'draft' === $post->post_status && 'comment' === $request['comment_type'] ) {
return new WP_Error(
'rest_comment_draft_post',
__( 'Sorry, you are not allowed to create a comment on this post.' ),
array( 'status' => 403 )
);
}

if ( 'trash' === $post->post_status ) {
return new WP_Error(
'rest_comment_trash_post',
Expand All @@ -114,14 +110,6 @@ public function create_item_permissions_check( $request ) {
);
}

if ( ! comments_open( $post->ID ) && 'comment' === $request['comment_type'] ) {
return new WP_Error(
'rest_comment_closed',
__( 'Sorry, comments are closed for this item.' ),
array( 'status' => 403 )
);
}

return true;
}
}
Expand Down
Loading

0 comments on commit 5574c5e

Please sign in to comment.