From 63f81c1e9cbb3b0513abca2b8cb579fef374ed7b Mon Sep 17 00:00:00 2001 From: karthick-murugan Date: Tue, 3 Dec 2024 19:25:14 +0530 Subject: [PATCH 1/3] Image size fix in lightbox --- lib/block-supports/layout.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index ddbd1917c30547..ca75f479dd67b5 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -1106,15 +1106,14 @@ function gutenberg_restore_image_outer_container( $block_content, $block ) { $wrapper_classnames = array( 'wp-block-image' ); - // If the block has a classNames attribute these classnames need to be removed from the content and added back + // If the block has a classNames attribute these classnames need to be added back // to the new wrapper div also. if ( ! empty( $block['attrs']['className'] ) ) { $wrapper_classnames = array_merge( $wrapper_classnames, explode( ' ', $block['attrs']['className'] ) ); } - $content_classnames = explode( ' ', $matches[2] ); - $filtered_content_classnames = array_diff( $content_classnames, $wrapper_classnames ); - return '
' . $matches[1] . implode( ' ', $filtered_content_classnames ) . $matches[3] . '
'; + // Wrap the existing content with the new wrapper div. + return '
' . $block_content . '
'; } if ( function_exists( 'wp_restore_image_outer_container' ) ) { From 0e19583c619fda88a7db00352e2813357281f3ef Mon Sep 17 00:00:00 2001 From: karthick-murugan Date: Tue, 3 Dec 2024 19:56:00 +0530 Subject: [PATCH 2/3] Revert "Image size fix in lightbox" This reverts commit 63f81c1e9cbb3b0513abca2b8cb579fef374ed7b. --- lib/block-supports/layout.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index ca75f479dd67b5..ddbd1917c30547 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -1106,14 +1106,15 @@ function gutenberg_restore_image_outer_container( $block_content, $block ) { $wrapper_classnames = array( 'wp-block-image' ); - // If the block has a classNames attribute these classnames need to be added back + // If the block has a classNames attribute these classnames need to be removed from the content and added back // to the new wrapper div also. if ( ! empty( $block['attrs']['className'] ) ) { $wrapper_classnames = array_merge( $wrapper_classnames, explode( ' ', $block['attrs']['className'] ) ); } + $content_classnames = explode( ' ', $matches[2] ); + $filtered_content_classnames = array_diff( $content_classnames, $wrapper_classnames ); - // Wrap the existing content with the new wrapper div. - return '
' . $block_content . '
'; + return '
' . $matches[1] . implode( ' ', $filtered_content_classnames ) . $matches[3] . '
'; } if ( function_exists( 'wp_restore_image_outer_container' ) ) { From 55d992b507729245e39339d40ad90b596781be00 Mon Sep 17 00:00:00 2001 From: karthick-murugan Date: Fri, 6 Dec 2024 14:35:33 +0530 Subject: [PATCH 3/3] Fix the search box fullwidth issue in modal --- .../src/input-control/styles/input-control-styles.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/components/src/input-control/styles/input-control-styles.tsx b/packages/components/src/input-control/styles/input-control-styles.tsx index 39eea8fdb029a1..85924e4d40d985 100644 --- a/packages/components/src/input-control/styles/input-control-styles.tsx +++ b/packages/components/src/input-control/styles/input-control-styles.tsx @@ -131,6 +131,11 @@ export const Container = styled.div< ContainerProps >` ${ containerDisabledStyles } ${ containerWidthStyles } + + .block-library-template-part__selection-search &, + .block-library-query-pattern__selection-search & { + width: 20%; + } `; type InputProps = {