From 56d09659fff260a930c7d032b98ab097674868f8 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 9 Dec 2025 13:39:13 +0800 Subject: [PATCH 1/4] Blocks: Fix unique `key` prop warning --- resources/backend/js/gutenberg.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/resources/backend/js/gutenberg.js b/resources/backend/js/gutenberg.js index 5fd597d28..d14b81bf4 100644 --- a/resources/backend/js/gutenberg.js +++ b/resources/backend/js/gutenberg.js @@ -229,10 +229,18 @@ function convertKitGutenbergRegisterBlock(block) { [ el( FlexItem, - {}, + { + key: attribute + '-select', + }, el(SelectControl, fieldProperties) ), - el(FlexItem, {}, inlineRefreshButton(props)), + el( + FlexItem, + { + key: attribute + '-refresh', + }, + inlineRefreshButton(props) + ), ] ); @@ -509,9 +517,15 @@ function convertKitGutenbergRegisterBlock(block) { } else { // Refresh button enabled; display the notice, link and button. elements = [ - !block.has_access_token - ? block.no_access_token.notice - : block.no_resources.notice, + el( + 'div', + { + key: props.clientId + '-notice', + }, + !block.has_access_token + ? block.no_access_token.notice + : block.no_resources.notice + ), noticeLink(props, setButtonDisabled), refreshButton(props, buttonDisabled, setButtonDisabled), ]; From 0b1e96116e699a3c5da56d8fdf3a6843c76c3019 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 9 Dec 2025 14:58:00 +0800 Subject: [PATCH 2/4] Blocks: SelectControl: Use 40px default size 36px default size for wp.components.SelectControl is deprecated since version 6.8 and will be removed in version 7.1. Note: Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version. Bottom margin styles for wp.components.SelectControl is deprecated since version 6.7 and will be removed in version 7.0. Note: Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version. --- resources/backend/css/gutenberg.css | 2 +- resources/backend/js/gutenberg.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/resources/backend/css/gutenberg.css b/resources/backend/css/gutenberg.css index aab86edfa..fb2df6d06 100644 --- a/resources/backend/css/gutenberg.css +++ b/resources/backend/css/gutenberg.css @@ -2,7 +2,7 @@ .components-flex-item button.wp-convertkit-refresh-resources { margin: 24px 0 0 0; padding: 0; - height: 32px; + height: 40px; } .components-flex-item button.wp-convertkit-refresh-resources span.dashicons { diff --git a/resources/backend/js/gutenberg.js b/resources/backend/js/gutenberg.js index d14b81bf4..9cf25e8a9 100644 --- a/resources/backend/js/gutenberg.js +++ b/resources/backend/js/gutenberg.js @@ -195,6 +195,12 @@ function convertKitGutenbergRegisterBlock(block) { // Assign options to field. fieldProperties.options = fieldOptions; + // Add __next40pxDefaultSize and __nextHasNoMarginBottom to SelectControl properties, + // preventing deprecation notices in the block editor and opt in to the new styles + // from 7.0. + fieldProperties.__next40pxDefaultSize = true; + fieldProperties.__nextHasNoMarginBottom = true; + // Return field element. return el(SelectControl, fieldProperties); @@ -221,6 +227,12 @@ function convertKitGutenbergRegisterBlock(block) { // Assign options to field. fieldProperties.options = fieldOptions; + // Add __next40pxDefaultSize and __nextHasNoMarginBottom to SelectControl properties, + // preventing deprecation notices in the block editor and opt in to the new styles + // from 7.0. + fieldProperties.__next40pxDefaultSize = true; + fieldProperties.__nextHasNoMarginBottom = true; + return el( Flex, { From 8f62b74a0feb5512f7ff21ea1df30bae2bd052cf Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 9 Dec 2025 15:31:23 +0800 Subject: [PATCH 3/4] Blocks: Fix Static Flag Warning Fixes the browser console `Warning: Internal React error: Expected static flag was missing. Please notify the React team.` by using `createElement` for the SandBox component. --- resources/backend/js/gutenberg-block-form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/backend/js/gutenberg-block-form.js b/resources/backend/js/gutenberg-block-form.js index 4b89b3e66..2601439c6 100644 --- a/resources/backend/js/gutenberg-block-form.js +++ b/resources/backend/js/gutenberg-block-form.js @@ -77,7 +77,7 @@ function convertKitGutenbergFormBlockRenderPreview(block, props) { { className: className.join(' '), }, - wp.components.SandBox({ + wp.element.createElement(wp.components.SandBox, { html, title: block.name, styles: [ From 383534e234f74d8fe43d23b7809bfb42798bc2ba Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 9 Dec 2025 15:57:30 +0800 Subject: [PATCH 4/4] Apply properties to all controls --- resources/backend/js/gutenberg.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/resources/backend/js/gutenberg.js b/resources/backend/js/gutenberg.js index 9cf25e8a9..5790051b4 100644 --- a/resources/backend/js/gutenberg.js +++ b/resources/backend/js/gutenberg.js @@ -144,6 +144,13 @@ function convertKitGutenbergRegisterBlock(block) { label: field.label, help: field.description, value: props.attributes[attribute], + + // Add __next40pxDefaultSize and __nextHasNoMarginBottom properties, + // preventing deprecation notices in the block editor and opt in to the new styles + // from 7.0. + __next40pxDefaultSize: true, + __nextHasNoMarginBottom: true, + onChange(value) { if (field.type === 'number') { // If value is a blank string i.e. no attribute value was provided, @@ -195,12 +202,6 @@ function convertKitGutenbergRegisterBlock(block) { // Assign options to field. fieldProperties.options = fieldOptions; - // Add __next40pxDefaultSize and __nextHasNoMarginBottom to SelectControl properties, - // preventing deprecation notices in the block editor and opt in to the new styles - // from 7.0. - fieldProperties.__next40pxDefaultSize = true; - fieldProperties.__nextHasNoMarginBottom = true; - // Return field element. return el(SelectControl, fieldProperties); @@ -227,12 +228,6 @@ function convertKitGutenbergRegisterBlock(block) { // Assign options to field. fieldProperties.options = fieldOptions; - // Add __next40pxDefaultSize and __nextHasNoMarginBottom to SelectControl properties, - // preventing deprecation notices in the block editor and opt in to the new styles - // from 7.0. - fieldProperties.__next40pxDefaultSize = true; - fieldProperties.__nextHasNoMarginBottom = true; - return el( Flex, {