From d948182b298adb46cd56d67ce60e195b1d66a006 Mon Sep 17 00:00:00 2001 From: George Olaru Date: Thu, 6 Apr 2023 12:30:38 +0300 Subject: [PATCH 1/4] Replace the useEffect() with useLayoutEffect() #438 To ensure that the DOM element of the active DrawerPanel is fully rendered, it is recommended to use the useLayoutEffect() hook instead of useEffect(). The useLayoutEffect() hook runs after the DOM has been rendered, but before the browser has painted the screen, which makes it suitable for accessing DOM measurements such as element heights. --- packages/block-editor/src/components/drawer/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/src/components/drawer/index.js b/packages/block-editor/src/components/drawer/index.js index e3952bb1..a27d4dd6 100644 --- a/packages/block-editor/src/components/drawer/index.js +++ b/packages/block-editor/src/components/drawer/index.js @@ -4,7 +4,7 @@ import { orderBy } from 'lodash'; import { Children, cloneElement, - useEffect, + useLayoutEffect, useMemo, useRef, useState, @@ -29,7 +29,7 @@ const Drawers = ( ownProps ) => { return drawers.some( drawer => drawer?.props?.id === lastActiveDrawerId ); } ), [ drawerLists ] ); - useEffect( () => { + useLayoutEffect( () => { if ( ! existingDrawer ) { setOpen( false ); @@ -61,7 +61,7 @@ const Drawers = ( ownProps ) => { setWrapperHeight( !! open ? drawerPanelHeight : drawerListHeight ); }; - useEffect( updateHeight, [ open ] ); + useLayoutEffect( updateHeight, [ open ] ); const transform = open ? 'translate3d(-100%,0,0)' : 'translate3d(0%,0,0)'; From 3518b104c7bccc1fcc101e8093db29767c8e0f05 Mon Sep 17 00:00:00 2001 From: George Olaru Date: Thu, 6 Apr 2023 12:42:33 +0300 Subject: [PATCH 2/4] Added some code comments #438 --- packages/block-editor/src/components/drawer/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/drawer/index.js b/packages/block-editor/src/components/drawer/index.js index a27d4dd6..4214e751 100644 --- a/packages/block-editor/src/components/drawer/index.js +++ b/packages/block-editor/src/components/drawer/index.js @@ -8,7 +8,7 @@ import { useMemo, useRef, useState, - } from '@wordpress/element'; +} from '@wordpress/element'; import { useMemoryState } from '../../index'; @@ -58,11 +58,14 @@ const Drawers = ( ownProps ) => { const drawerListHeight = getDrawerListHeight(); const drawerPanelHeight = getActiveDrawerTitleHeight(); + // If the drawer is open, the height of the wrapper should be the height of the drawer panel. setWrapperHeight( !! open ? drawerPanelHeight : drawerListHeight ); }; + // This hook updates the height of the collapsible to match the height of the content useLayoutEffect( updateHeight, [ open ] ); + // Translate the drawer to the left when the menu button is clicked. const transform = open ? 'translate3d(-100%,0,0)' : 'translate3d(0%,0,0)'; // keep track of number of drawers in previous drawerLists From 86616213664d99f025845f639a681b79ade58c67 Mon Sep 17 00:00:00 2001 From: George Olaru Date: Thu, 6 Apr 2023 13:22:18 +0300 Subject: [PATCH 3/4] Fixed SVG icons missing fill Close #439 --- packages/icons/src/svgs/align-bottom.svg | 2 +- packages/icons/src/svgs/align-center.svg | 2 +- packages/icons/src/svgs/align-top.svg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/icons/src/svgs/align-bottom.svg b/packages/icons/src/svgs/align-bottom.svg index 3ece283d..a857b786 100644 --- a/packages/icons/src/svgs/align-bottom.svg +++ b/packages/icons/src/svgs/align-bottom.svg @@ -1,3 +1,3 @@ - + diff --git a/packages/icons/src/svgs/align-center.svg b/packages/icons/src/svgs/align-center.svg index 1ddeefbc..4f5b31f9 100644 --- a/packages/icons/src/svgs/align-center.svg +++ b/packages/icons/src/svgs/align-center.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/icons/src/svgs/align-top.svg b/packages/icons/src/svgs/align-top.svg index 5ddbb1e7..0f7b6d51 100644 --- a/packages/icons/src/svgs/align-top.svg +++ b/packages/icons/src/svgs/align-top.svg @@ -1,4 +1,4 @@ - + From 03eb4a666cf4de5ebf78aaa241cadc7cca78565f Mon Sep 17 00:00:00 2001 From: George Olaru Date: Thu, 6 Apr 2023 16:48:08 +0300 Subject: [PATCH 4/4] Released version 2.1.6 --- nova-blocks.php | 2 +- readme.txt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nova-blocks.php b/nova-blocks.php index 2b6a0a97..98f94532 100644 --- a/nova-blocks.php +++ b/nova-blocks.php @@ -3,7 +3,7 @@ * Plugin Name: Nova Blocks * Plugin URI: https://github.com/pixelgrade/nova-blocks/ * Description: Nova Blocks is a collection of distinctive Gutenberg blocks, committed to making your site shine like a newborn star. It is taking a design-driven approach to help you made the right decisions and showcase your content in the best shape. - * Version: 2.1.5 + * Version: 2.1.6 * Author: Pixelgrade * Author URI: https://www.pixelgrade.com * License: GPLv2 or later diff --git a/readme.txt b/readme.txt index 97429a18..ec9cd05d 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,8 @@ Contributors: pixelgrade, vlad.olaru, babbardel, razvanonofrei, gorby31 Tags: blocks, editor, gutenberg, gutenberg blocks, page builder, block enabled, page building, full site editing, site editor, posts collection Requires at least: 5.9 -Tested up to: 6.0.1 -Stable tag: 2.1.5 +Tested up to: 6.2.0 +Stable tag: 2.1.6 Requires PHP: 7.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -94,6 +94,10 @@ Yes! Nova Block's core features are free to use. == Changelog == += 2.1.6 = +* Fixed issue with blocks options being hidden when opening a sliding panel +* Restored missing Content Alignment icons in Space and Sizing component + = 2.1.5 = * Fix Supernova query in certain situations. * Fix PHP warnings.