Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:amitraj2203/gutenberg into fix/iss…
Browse files Browse the repository at this point in the history
…ue-61834
  • Loading branch information
amitraj2203 committed May 22, 2024
2 parents 999779d + c70633d commit de721f5
Show file tree
Hide file tree
Showing 104 changed files with 864 additions and 2,123 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check-backport-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Verify Core Backport Changlog

on:
pull_request:
types: [opened, synchronize]
types: [opened, synchronize, labeled, unlabeled]
paths:
- 'lib/**'
- '!lib/load.php'
Expand Down Expand Up @@ -31,6 +31,7 @@ jobs:
- name: 'Fetch relevant history from origin'
run: git fetch origin ${{ github.event.pull_request.base.ref }}
- name: Check CHANGELOG status
if: ${{ !contains(github.event.pull_request.labels.*.name, 'No Core Sync Required') && !contains(github.event.pull_request.labels.*.name, 'Backport from WordPress Core') }}
env:
PR_NUMBER: ${{ github.event.number }}
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ As of Gutenberg version 14.2, the following controls are available:
- `sticky` - Shows a dropdown to select how to handle sticky posts.
- `taxQuery` - Shows available taxonomies filters for the currently selected post type.
- `author` - Shows an input field to filter the query by author.
- `search` - Shows an input filed to filter the query by keywords.
- `search` - Shows an input field to filter the query by keywords.

In our case, the property would look like this:

Expand Down
2 changes: 1 addition & 1 deletion lib/class-wp-rest-global-styles-controller-gutenberg.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* REST API: Try: bundle WP_Theme_JSON class instead of inheriting per WordPress version class
* REST API: Bundle WP_Theme_JSON class instead of inheriting per WordPress version class
*
* Changes to this class should be synced to the corresponding class
* in WordPress core: src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php.
Expand Down
31 changes: 24 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"jest-message-util": "29.6.2",
"jest-watch-typeahead": "2.2.2",
"lerna": "7.1.4",
"lint-staged": "10.0.1",
"lint-staged": "10.0.2",
"make-dir": "3.0.0",
"mkdirp": "3.0.1",
"mock-match-media": "0.4.2",
Expand Down
6 changes: 2 additions & 4 deletions packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
// displays based on the relationship between the selected block
// and its parent, and only enable it if the parent is controlling
// its children blocks.
const blockInspectorAnimationSettings = useBlockInspectorAnimationSettings(
blockType,
selectedBlockClientId
);
const blockInspectorAnimationSettings =
useBlockInspectorAnimationSettings( blockType );

const borderPanelLabel = useBorderPanelLabel( {
blockName: selectedBlockName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { useSelect } from '@wordpress/data';
*/
import { store as blockEditorStore } from '../../store';

export default function useBlockInspectorAnimationSettings(
blockType,
selectedBlockClientId
) {
export default function useBlockInspectorAnimationSettings( blockType ) {
return useSelect(
( select ) => {
if ( blockType ) {
Expand Down Expand Up @@ -48,6 +45,6 @@ export default function useBlockInspectorAnimationSettings(
}
return null;
},
[ selectedBlockClientId, blockType ]
[ blockType ]
);
}
34 changes: 8 additions & 26 deletions packages/core-commands/src/site-editor-navigation-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
navigation,
} from '@wordpress/icons';
import { privateApis as routerPrivateApis } from '@wordpress/router';
import { getQueryArg, addQueryArgs, getPath } from '@wordpress/url';
import { addQueryArgs, getPath } from '@wordpress/url';
import { useDebounce } from '@wordpress/compose';

/**
Expand Down Expand Up @@ -119,22 +119,14 @@ const getNavigationCommandLoaderPerPostType = ( postType ) =>
const isSiteEditor = getPath( window.location.href )?.includes(
'site-editor.php'
);
const extraArgs = isSiteEditor
? {
canvas: getQueryArg(
window.location.href,
'canvas'
),
}
: {};

return {
...command,
callback: ( { close } ) => {
const args = {
postType,
postId: record.id,
...extraArgs,
canvas: 'edit',
};
const targetUrl = addQueryArgs(
'site-editor.php',
Expand Down Expand Up @@ -195,15 +187,6 @@ const getNavigationCommandLoaderPerTemplate = ( templateType ) =>
const result = [];
result.push(
...orderedRecords.map( ( record ) => {
const extraArgs = isSiteEditor
? {
canvas: getQueryArg(
window.location.href,
'canvas'
),
}
: {};

return {
name: templateType + '-' + record.id,
searchLabel: record.title?.rendered + ' ' + record.id,
Expand All @@ -215,7 +198,7 @@ const getNavigationCommandLoaderPerTemplate = ( templateType ) =>
const args = {
postType: templateType,
postId: record.id,
...extraArgs,
canvas: 'edit',
};
const targetUrl = addQueryArgs(
'site-editor.php',
Expand All @@ -242,8 +225,7 @@ const getNavigationCommandLoaderPerTemplate = ( templateType ) =>
icon: symbolFilled,
callback: ( { close } ) => {
const args = {
path: '/patterns',
categoryType: 'wp_template_part',
postType: 'wp_template_part',
categoryId: 'all-parts',
};
const targetUrl = addQueryArgs(
Expand Down Expand Up @@ -296,7 +278,7 @@ function useSiteEditorBasicNavigationCommands() {
icon: navigation,
callback: ( { close } ) => {
const args = {
path: '/navigation',
postType: 'wp_navigation',
};
const targetUrl = addQueryArgs( 'site-editor.php', args );
if ( isSiteEditor ) {
Expand Down Expand Up @@ -332,7 +314,7 @@ function useSiteEditorBasicNavigationCommands() {
icon: page,
callback: ( { close } ) => {
const args = {
path: '/page',
post_type: 'page',
};
const targetUrl = addQueryArgs( 'site-editor.php', args );
if ( isSiteEditor ) {
Expand All @@ -350,7 +332,7 @@ function useSiteEditorBasicNavigationCommands() {
icon: layout,
callback: ( { close } ) => {
const args = {
path: '/wp_template',
postType: 'wp_template',
};
const targetUrl = addQueryArgs( 'site-editor.php', args );
if ( isSiteEditor ) {
Expand All @@ -370,7 +352,7 @@ function useSiteEditorBasicNavigationCommands() {
callback: ( { close } ) => {
if ( canCreateTemplate ) {
const args = {
path: '/patterns',
postType: 'wp_block',
};
const targetUrl = addQueryArgs( 'site-editor.php', args );
if ( isSiteEditor ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* External dependencies
*/
import type { Ref } from 'react';

/**
* WordPress dependencies
*/
Expand All @@ -12,14 +17,25 @@ import { forwardRef } from '@wordpress/element';
* Internal dependencies
*/
import { unlock } from './lock-unlock';
import type { NormalizedFilter, View } from './types';

const {
DropdownMenuV2: DropdownMenu,
DropdownMenuItemV2: DropdownMenuItem,
DropdownMenuItemLabelV2: DropdownMenuItemLabel,
} = unlock( componentsPrivateApis );

function AddFilter( { filters, view, onChangeView, setOpenedFilter }, ref ) {
interface AddFilterProps {
filters: NormalizedFilter[];
view: View;
onChangeView: ( view: View ) => void;
setOpenedFilter: ( filter: string | null ) => void;
}

function AddFilter(
{ filters, view, onChangeView, setOpenedFilter }: AddFilterProps,
ref: Ref< HTMLButtonElement >
) {
if ( ! filters.length || filters.every( ( { isPrimary } ) => isPrimary ) ) {
return null;
}
Expand Down
7 changes: 6 additions & 1 deletion packages/dataviews/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import type { Operator } from './types';

// Filter operators.
export const OPERATOR_IS = 'is';
export const OPERATOR_IS_NOT = 'isNot';
Expand All @@ -19,7 +24,7 @@ export const ALL_OPERATORS = [
OPERATOR_IS_ALL,
OPERATOR_IS_NOT_ALL,
];
export const OPERATORS = {
export const OPERATORS: Record< Operator, { key: string; label: string } > = {
[ OPERATOR_IS ]: {
key: 'is-filter',
label: __( 'Is' ),
Expand Down
Loading

0 comments on commit de721f5

Please sign in to comment.