From 083cfa3b2c02245908e66d56168f624d53072c55 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Wed, 13 Sep 2023 12:12:16 +0200 Subject: [PATCH 01/14] Update modal texts --- .../block-library/src/query/edit/enhanced-pagination-modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/query/edit/enhanced-pagination-modal.js b/packages/block-library/src/query/edit/enhanced-pagination-modal.js index 42c66f5e94c904..c6e3a0d9895b17 100644 --- a/packages/block-library/src/query/edit/enhanced-pagination-modal.js +++ b/packages/block-library/src/query/edit/enhanced-pagination-modal.js @@ -15,7 +15,7 @@ import { useState, useEffect } from '@wordpress/element'; import { useContainsThirdPartyBlocks } from '../utils'; const disableEnhancedPaginationDescription = __( - 'Third-party blocks are not supported inside a Query Loop block with enhanced pagination enabled. To re-enable it, remove any third-party block and then update it in the Query Loop settings.' + 'Plugin blocks are not supported. For enhanced pagination to work, remove the plugin block, then re-enable it in settings.' ); const modalDescriptionId = @@ -56,7 +56,7 @@ export default function EnhancedPaginationModal( { setAttributes( { enhancedPagination: false } ); } } > - { __( 'OK, understood' ) } + { __( 'OK' ) } From 355866ed64c48132bdcec240b164f254c91be9ea Mon Sep 17 00:00:00 2001 From: David Arenas Date: Wed, 13 Sep 2023 12:53:25 +0200 Subject: [PATCH 02/14] Update enhanced pagination error notice text --- .../edit/inspector-controls/enhanced-pagination-control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js b/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js index 4711a36f584101..d10df751337f6d 100644 --- a/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js +++ b/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js @@ -15,7 +15,7 @@ export default function EnhancedPaginationControl( { clientId, } ) { const enhancedPaginationNotice = __( - 'Enhanced pagination requires all descendants to be Core blocks. If you want to enable it, you have to remove all third-party blocks contained inside the Query Loop block.' + 'Enhanced pagination only works with the blocks bundled with WordPress. If you want to enable it, you have to remove all plugin blocks from the Query Loop.' ); const containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId ); From 0affb05c1e7768be1cd8f60bc1ef1af4de120d48 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Wed, 13 Sep 2023 14:01:51 +0200 Subject: [PATCH 03/14] Remove notice margin --- .../enhanced-pagination-control.js | 12 +++++++----- packages/block-library/src/query/editor.scss | 4 ++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js b/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js index d10df751337f6d..52be85335bee16 100644 --- a/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js +++ b/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js @@ -36,11 +36,13 @@ export default function EnhancedPaginationControl( { } } /> { containsThirdPartyBlocks && ( -
- - { enhancedPaginationNotice } - -
+ + { enhancedPaginationNotice } + ) } ); diff --git a/packages/block-library/src/query/editor.scss b/packages/block-library/src/query/editor.scss index d95cbecc7da220..e0554d56de9c6e 100644 --- a/packages/block-library/src/query/editor.scss +++ b/packages/block-library/src/query/editor.scss @@ -58,3 +58,7 @@ max-width: $break-mobile; } } + +.wp-block-query__enhanced-pagination-notice { + margin: 0; +} From 72ff9bbe24b4bf59fd7e00ec111a02605f63efb9 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Wed, 13 Sep 2023 14:22:44 +0200 Subject: [PATCH 04/14] Update modal classname --- .../block-library/src/query/edit/enhanced-pagination-modal.js | 2 +- packages/block-library/src/query/editor.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/query/edit/enhanced-pagination-modal.js b/packages/block-library/src/query/edit/enhanced-pagination-modal.js index c6e3a0d9895b17..7fbc2f4235c4b8 100644 --- a/packages/block-library/src/query/edit/enhanced-pagination-modal.js +++ b/packages/block-library/src/query/edit/enhanced-pagination-modal.js @@ -38,7 +38,7 @@ export default function EnhancedPaginationModal( { isOpen && ( Date: Wed, 13 Sep 2023 14:25:45 +0200 Subject: [PATCH 05/14] Update modal spacing --- .../block-library/src/query/edit/enhanced-pagination-modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/edit/enhanced-pagination-modal.js b/packages/block-library/src/query/edit/enhanced-pagination-modal.js index 7fbc2f4235c4b8..05978dae147c50 100644 --- a/packages/block-library/src/query/edit/enhanced-pagination-modal.js +++ b/packages/block-library/src/query/edit/enhanced-pagination-modal.js @@ -46,7 +46,7 @@ export default function EnhancedPaginationModal( { shouldCloseOnEsc={ false } shouldCloseOnClickOutside={ false } > - + { disableEnhancedPaginationDescription } From 9a4d5587f2756299e8125cd6912d16c8f1800857 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Wed, 13 Sep 2023 18:20:45 +0200 Subject: [PATCH 06/14] Update animation time --- packages/block-library/src/query/style.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/query/style.scss b/packages/block-library/src/query/style.scss index c560018056d7f0..25003dcca5431b 100644 --- a/packages/block-library/src/query/style.scss +++ b/packages/block-library/src/query/style.scss @@ -14,8 +14,8 @@ animation: wp-block-query__enhanced-pagination-start-animation 30s - cubic-bezier(0, 1, 0, 1) - infinite; + cubic-bezier(0.03, 0.5, 0, 1) + forwards; } &.finish-animation { From 4d99539b534c8230e383e26db15b6dc978a3e1f7 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Wed, 13 Sep 2023 18:37:10 +0200 Subject: [PATCH 07/14] Change delay from 300 to 400 ms --- packages/block-library/src/query/view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/view.js b/packages/block-library/src/query/view.js index 78cc423c80661a..2f334692e32910 100644 --- a/packages/block-library/src/query/view.js +++ b/packages/block-library/src/query/view.js @@ -44,7 +44,7 @@ store( { context.core.query.message = context.core.query.loadingText; context.core.query.animation = 'start'; - }, 300 ); + }, 400 ); await navigate( ref.href ); From fe52845e6ded5eae0198cf419aa0f701a6bf887d Mon Sep 17 00:00:00 2001 From: David Arenas Date: Wed, 13 Sep 2023 18:38:05 +0200 Subject: [PATCH 08/14] Disable animation motion when preferred --- packages/block-library/src/query/style.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/block-library/src/query/style.scss b/packages/block-library/src/query/style.scss index 25003dcca5431b..f2f6da80f72074 100644 --- a/packages/block-library/src/query/style.scss +++ b/packages/block-library/src/query/style.scss @@ -24,6 +24,16 @@ 300ms ease-in; } + + &.start-animation, + &.finish-animation { + @media (prefers-reduced-motion: reduce) { + transition-duration: 0s; + transition-delay: 0s; + animation-duration: 1ms; + animation-delay: 0s; + } + } } @keyframes wp-block-query__enhanced-pagination-start-animation { From 2d8a1f0297f3ddb4320d47d211c965bd9d1c248d Mon Sep 17 00:00:00 2001 From: David Arenas Date: Thu, 14 Sep 2023 17:42:35 +0200 Subject: [PATCH 09/14] Clarify that plugin blocks could be supported in the future Co-authored-by: Luis Herranz --- .../block-library/src/query/edit/enhanced-pagination-modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/edit/enhanced-pagination-modal.js b/packages/block-library/src/query/edit/enhanced-pagination-modal.js index 05978dae147c50..8ef5c8a20d8cd4 100644 --- a/packages/block-library/src/query/edit/enhanced-pagination-modal.js +++ b/packages/block-library/src/query/edit/enhanced-pagination-modal.js @@ -15,7 +15,7 @@ import { useState, useEffect } from '@wordpress/element'; import { useContainsThirdPartyBlocks } from '../utils'; const disableEnhancedPaginationDescription = __( - 'Plugin blocks are not supported. For enhanced pagination to work, remove the plugin block, then re-enable it in settings.' + 'Plugin blocks are not supported yet. For enhanced pagination to work, remove the plugin block, then re-enable it in settings.' ); const modalDescriptionId = From bd90272765d080fcff37df16fc0b40e4a465399d Mon Sep 17 00:00:00 2001 From: David Arenas Date: Thu, 14 Sep 2023 17:43:35 +0200 Subject: [PATCH 10/14] Clarify that plugin blocks are not supported yet but will be Co-authored-by: Luis Herranz --- .../edit/inspector-controls/enhanced-pagination-control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js b/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js index 52be85335bee16..db4082ddce3638 100644 --- a/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js +++ b/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js @@ -15,7 +15,7 @@ export default function EnhancedPaginationControl( { clientId, } ) { const enhancedPaginationNotice = __( - 'Enhanced pagination only works with the blocks bundled with WordPress. If you want to enable it, you have to remove all plugin blocks from the Query Loop.' + 'Enhanced pagination doesn\'t support plugin blocks yet. If you want to enable it, you have to remove all plugin blocks from the Query Loop.' ); const containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId ); From e66a31b274c7e506748acbab0b902e15a22f049b Mon Sep 17 00:00:00 2001 From: David Arenas Date: Thu, 14 Sep 2023 17:52:18 +0200 Subject: [PATCH 11/14] Mention enhanced pagination again --- .../block-library/src/query/edit/enhanced-pagination-modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/edit/enhanced-pagination-modal.js b/packages/block-library/src/query/edit/enhanced-pagination-modal.js index 8ef5c8a20d8cd4..8497d4d2080a44 100644 --- a/packages/block-library/src/query/edit/enhanced-pagination-modal.js +++ b/packages/block-library/src/query/edit/enhanced-pagination-modal.js @@ -15,7 +15,7 @@ import { useState, useEffect } from '@wordpress/element'; import { useContainsThirdPartyBlocks } from '../utils'; const disableEnhancedPaginationDescription = __( - 'Plugin blocks are not supported yet. For enhanced pagination to work, remove the plugin block, then re-enable it in settings.' + 'Plugin blocks are not supported yet. For enhanced pagination to work, remove the plugin block, then re-enable enhanced pagination in settings.' ); const modalDescriptionId = From 227b9ce43f884a68da478320a7807dbb3927f7f5 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Thu, 14 Sep 2023 18:03:52 +0200 Subject: [PATCH 12/14] Fix eslint error --- .../edit/inspector-controls/enhanced-pagination-control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js b/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js index db4082ddce3638..042c9f1e75930c 100644 --- a/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js +++ b/packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js @@ -15,7 +15,7 @@ export default function EnhancedPaginationControl( { clientId, } ) { const enhancedPaginationNotice = __( - 'Enhanced pagination doesn\'t support plugin blocks yet. If you want to enable it, you have to remove all plugin blocks from the Query Loop.' + "Enhanced pagination doesn't support plugin blocks yet. If you want to enable it, you have to remove all plugin blocks from the Query Loop." ); const containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId ); From 4e5760dc47d83a32a3f272fba9c04052dcc1f158 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Thu, 14 Sep 2023 19:32:18 +0200 Subject: [PATCH 13/14] Update modal description to mention the Query block --- .../block-library/src/query/edit/enhanced-pagination-modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/query/edit/enhanced-pagination-modal.js b/packages/block-library/src/query/edit/enhanced-pagination-modal.js index 8497d4d2080a44..04423116ac92e3 100644 --- a/packages/block-library/src/query/edit/enhanced-pagination-modal.js +++ b/packages/block-library/src/query/edit/enhanced-pagination-modal.js @@ -15,7 +15,7 @@ import { useState, useEffect } from '@wordpress/element'; import { useContainsThirdPartyBlocks } from '../utils'; const disableEnhancedPaginationDescription = __( - 'Plugin blocks are not supported yet. For enhanced pagination to work, remove the plugin block, then re-enable enhanced pagination in settings.' + 'Plugin blocks are not supported yet. For the enhanced pagination to work, remove the plugin block, then re-enable "Enhanced pagination" in the Query Block settings.' ); const modalDescriptionId = From 0f163c4dfbccfd83cee9993d7ecfee90863861ef Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 15 Sep 2023 13:48:00 +0200 Subject: [PATCH 14/14] Revert "Disable animation motion when preferred" This reverts commit fe52845e6ded5eae0198cf419aa0f701a6bf887d. --- packages/block-library/src/query/style.scss | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/block-library/src/query/style.scss b/packages/block-library/src/query/style.scss index f2f6da80f72074..25003dcca5431b 100644 --- a/packages/block-library/src/query/style.scss +++ b/packages/block-library/src/query/style.scss @@ -24,16 +24,6 @@ 300ms ease-in; } - - &.start-animation, - &.finish-animation { - @media (prefers-reduced-motion: reduce) { - transition-duration: 0s; - transition-delay: 0s; - animation-duration: 1ms; - animation-delay: 0s; - } - } } @keyframes wp-block-query__enhanced-pagination-start-animation {