From 887c31f3cc302b12fb62f8ab04995f274b8ae2cb Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Wed, 1 Nov 2023 10:16:42 +0200 Subject: [PATCH 01/17] Properly apply styles and classes to the form block --- packages/block-library/src/form/index.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/form/index.php b/packages/block-library/src/form/index.php index b9e3a9c25c6286..6ec2049330218b 100644 --- a/packages/block-library/src/form/index.php +++ b/packages/block-library/src/form/index.php @@ -35,9 +35,19 @@ function render_block_core_form( $attributes, $content ) { $extra_fields = apply_filters( 'render_block_core_form_extra_fields', '', $attributes ); + // Remove styles and classes, so they can be properly added to the wrapper using `get_block_wrapper_attributes()`. + $processed_content->remove_attribute( 'style' ); + $processed_content->remove_attribute( 'class' ); + return str_replace( - '', - $extra_fields . '', + array( + '' + ), + array( + '
', + ), $processed_content->get_updated_html() ); } From cd9b0a7e909b6de903e33ef552a56d2933958181 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Wed, 1 Nov 2023 10:44:07 +0200 Subject: [PATCH 02/17] CS fix --- packages/block-library/src/form/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/form/index.php b/packages/block-library/src/form/index.php index 6ec2049330218b..e16e8d8f59f43c 100644 --- a/packages/block-library/src/form/index.php +++ b/packages/block-library/src/form/index.php @@ -42,7 +42,7 @@ function render_block_core_form( $attributes, $content ) { return str_replace( array( '' + '', ), array( '
Date: Thu, 2 Nov 2023 10:16:15 +0200 Subject: [PATCH 03/17] apply changes in the editor - fixes typography issue --- packages/block-library/src/form/edit.js | 31 +++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/form/edit.js b/packages/block-library/src/form/edit.js index 7fded64837de9d..41980080b9ea6b 100644 --- a/packages/block-library/src/form/edit.js +++ b/packages/block-library/src/form/edit.js @@ -7,6 +7,10 @@ import { useBlockProps, useInnerBlocksProps, InspectorControls, + __experimentalUseBorderProps as useBorderProps, + __experimentalUseColorProps as useColorProps, + __experimentalGetSpacingClassesAndStyles as useSpacingProps, + getTypographyClassesAndStyles as useTypographyProps, store as blockEditorStore, } from '@wordpress/block-editor'; import { TextControl, SelectControl, PanelBody } from '@wordpress/components'; @@ -20,6 +24,11 @@ import { formSubmissionNotificationError, } from './utils.js'; +/** + * External dependencies + */ +import classNames from 'classnames'; + const ALLOWED_BLOCKS = [ 'core/paragraph', 'core/heading', @@ -60,7 +69,7 @@ const TEMPLATE = [ [ 'core/form-submit-button', {} ], ]; -const Edit = ( { attributes, setAttributes, clientId } ) => { +const Edit = ( { attributes, setAttributes, className, clientId } ) => { const { action, method, email, submissionMethod } = attributes; const blockProps = useBlockProps(); @@ -83,6 +92,11 @@ const Edit = ( { attributes, setAttributes, clientId } ) => { : InnerBlocks.ButtonBlockAppender, } ); + const borderProps = useBorderProps( attributes ); + const colorProps = useColorProps( attributes ); + const spacingProps = useSpacingProps( attributes ); + const typographyProps = useTypographyProps( attributes ); + return ( <> @@ -172,7 +186,20 @@ const Edit = ( { attributes, setAttributes, clientId } ) => { ) } From 5121b86311ee063b54182779c9dbd78bee44af0d Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Thu, 2 Nov 2023 10:32:29 +0200 Subject: [PATCH 04/17] A better method to save styles & classes --- packages/block-library/src/form/index.php | 16 +--------- packages/block-library/src/form/save.js | 36 +++++++++++++++++++++-- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/packages/block-library/src/form/index.php b/packages/block-library/src/form/index.php index e16e8d8f59f43c..9fbb04c438984c 100644 --- a/packages/block-library/src/form/index.php +++ b/packages/block-library/src/form/index.php @@ -35,21 +35,7 @@ function render_block_core_form( $attributes, $content ) { $extra_fields = apply_filters( 'render_block_core_form_extra_fields', '', $attributes ); - // Remove styles and classes, so they can be properly added to the wrapper using `get_block_wrapper_attributes()`. - $processed_content->remove_attribute( 'style' ); - $processed_content->remove_attribute( 'class' ); - - return str_replace( - array( - '', - ), - array( - '', - ), - $processed_content->get_updated_html() - ); + return str_replace( '', $extra_fields . '', $processed_content->get_updated_html() ); } /** diff --git a/packages/block-library/src/form/save.js b/packages/block-library/src/form/save.js index a824fc076d2ac3..b4d3970ed9cb0e 100644 --- a/packages/block-library/src/form/save.js +++ b/packages/block-library/src/form/save.js @@ -1,16 +1,46 @@ /** * WordPress dependencies */ -import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; +import { + InnerBlocks, + useBlockProps, + __experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles, + __experimentalGetColorClassesAndStyles as getColorClassesAndStyles, + __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles, + getTypographyClassesAndStyles as useTypographyProps, +} from '@wordpress/block-editor'; -const Save = ( { attributes } ) => { +/** + * External dependencies + */ +import classNames from 'classnames'; + +const Save = ( { attributes, className } ) => { const blockProps = useBlockProps.save(); const { submissionMethod } = attributes; + const borderProps = getBorderClassesAndStyles( attributes ); + const colorProps = getColorClassesAndStyles( attributes ); + const spacingProps = getSpacingClassesAndStyles( attributes ); + const typographyProps = useTypographyProps( attributes ); + return (
From 8283769d35d8c114f1ac04232179bc06a930be01 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Thu, 2 Nov 2023 10:34:08 +0200 Subject: [PATCH 05/17] revert index.php changes --- packages/block-library/src/form/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/form/index.php b/packages/block-library/src/form/index.php index 9fbb04c438984c..b9e3a9c25c6286 100644 --- a/packages/block-library/src/form/index.php +++ b/packages/block-library/src/form/index.php @@ -35,7 +35,11 @@ function render_block_core_form( $attributes, $content ) { $extra_fields = apply_filters( 'render_block_core_form_extra_fields', '', $attributes ); - return str_replace( '', $extra_fields . '', $processed_content->get_updated_html() ); + return str_replace( + '', + $extra_fields . '', + $processed_content->get_updated_html() + ); } /** From 926570e8f49099fad66d1ee5fed5014458c052aa Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Mon, 4 Dec 2023 11:06:52 +0200 Subject: [PATCH 06/17] remove className: false --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/form/block.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 9f25ad0a594b89..97138ad215b219 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -284,7 +284,7 @@ A form. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/blo - **Name:** core/form - **Experimental:** true - **Category:** common -- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** action, email, method, submissionMethod ## Input Field diff --git a/packages/block-library/src/form/block.json b/packages/block-library/src/form/block.json index 0c6451f4959a48..b79c9f9249a9f7 100644 --- a/packages/block-library/src/form/block.json +++ b/packages/block-library/src/form/block.json @@ -27,7 +27,6 @@ }, "supports": { "anchor": true, - "className": false, "color": { "gradients": true, "link": true, From a1037d095b3310feaa8fc62349756c12fe9f763c Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Mon, 4 Dec 2023 21:16:47 +0900 Subject: [PATCH 07/17] Remove unnecessary styles and classes --- packages/block-library/src/form/edit.js | 30 +-------------------- packages/block-library/src/form/save.js | 35 ++----------------------- 2 files changed, 3 insertions(+), 62 deletions(-) diff --git a/packages/block-library/src/form/edit.js b/packages/block-library/src/form/edit.js index 41980080b9ea6b..7f479a9b2ce47a 100644 --- a/packages/block-library/src/form/edit.js +++ b/packages/block-library/src/form/edit.js @@ -7,10 +7,6 @@ import { useBlockProps, useInnerBlocksProps, InspectorControls, - __experimentalUseBorderProps as useBorderProps, - __experimentalUseColorProps as useColorProps, - __experimentalGetSpacingClassesAndStyles as useSpacingProps, - getTypographyClassesAndStyles as useTypographyProps, store as blockEditorStore, } from '@wordpress/block-editor'; import { TextControl, SelectControl, PanelBody } from '@wordpress/components'; @@ -24,11 +20,6 @@ import { formSubmissionNotificationError, } from './utils.js'; -/** - * External dependencies - */ -import classNames from 'classnames'; - const ALLOWED_BLOCKS = [ 'core/paragraph', 'core/heading', @@ -69,7 +60,7 @@ const TEMPLATE = [ [ 'core/form-submit-button', {} ], ]; -const Edit = ( { attributes, setAttributes, className, clientId } ) => { +const Edit = ( { attributes, setAttributes, clientId } ) => { const { action, method, email, submissionMethod } = attributes; const blockProps = useBlockProps(); @@ -92,11 +83,6 @@ const Edit = ( { attributes, setAttributes, className, clientId } ) => { : InnerBlocks.ButtonBlockAppender, } ); - const borderProps = useBorderProps( attributes ); - const colorProps = useColorProps( attributes ); - const spacingProps = useSpacingProps( attributes ); - const typographyProps = useTypographyProps( attributes ); - return ( <> @@ -186,20 +172,6 @@ const Edit = ( { attributes, setAttributes, className, clientId } ) => { ) }
diff --git a/packages/block-library/src/form/save.js b/packages/block-library/src/form/save.js index b4d3970ed9cb0e..9d944f13effa91 100644 --- a/packages/block-library/src/form/save.js +++ b/packages/block-library/src/form/save.js @@ -1,46 +1,15 @@ /** * WordPress dependencies */ -import { - InnerBlocks, - useBlockProps, - __experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles, - __experimentalGetColorClassesAndStyles as getColorClassesAndStyles, - __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles, - getTypographyClassesAndStyles as useTypographyProps, -} from '@wordpress/block-editor'; +import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; -/** - * External dependencies - */ -import classNames from 'classnames'; - -const Save = ( { attributes, className } ) => { +const Save = ( { attributes } ) => { const blockProps = useBlockProps.save(); const { submissionMethod } = attributes; - const borderProps = getBorderClassesAndStyles( attributes ); - const colorProps = getColorClassesAndStyles( attributes ); - const spacingProps = getSpacingClassesAndStyles( attributes ); - const typographyProps = useTypographyProps( attributes ); - return ( From b8474c83aa37c7ab299b4f251a0f96ad598c5f95 Mon Sep 17 00:00:00 2001 From: Aristeides Stathopoulos Date: Wed, 31 Jan 2024 13:18:09 +0200 Subject: [PATCH 08/17] Add deprecation --- packages/block-library/src/form/deprecated.js | 74 +++++++++++++++++++ packages/block-library/src/form/index.js | 2 + 2 files changed, 76 insertions(+) create mode 100644 packages/block-library/src/form/deprecated.js diff --git a/packages/block-library/src/form/deprecated.js b/packages/block-library/src/form/deprecated.js new file mode 100644 index 00000000000000..4109ddf44212f2 --- /dev/null +++ b/packages/block-library/src/form/deprecated.js @@ -0,0 +1,74 @@ +/** + * WordPress dependencies + */ +import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; + +const deprecated = [ + { + supports: { + anchor: true, + className: false, + color: { + gradients: true, + link: true, + __experimentalDefaultControls: { + background: true, + text: true, + link: true, + }, + }, + spacing: { + margin: true, + padding: true, + }, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalTextDecoration: true, + __experimentalFontStyle: true, + __experimentalFontWeight: true, + __experimentalLetterSpacing: true, + __experimentalTextTransform: true, + __experimentalDefaultControls: { + fontSize: true, + }, + }, + __experimentalSelector: 'form', + }, + attributes: { + submissionMethod: { + type: 'string', + default: 'email', + }, + method: { + type: 'string', + default: 'post', + }, + action: { + type: 'string', + }, + email: { + type: 'string', + }, + }, + save( { attributes } ) { + const blockProps = useBlockProps.save(); + const { submissionMethod } = attributes; + + return ( + + + + ); + }, + }, +]; + +export default deprecated; diff --git a/packages/block-library/src/form/index.js b/packages/block-library/src/form/index.js index 1e45c642b6d48e..3f4bf4652c6435 100644 --- a/packages/block-library/src/form/index.js +++ b/packages/block-library/src/form/index.js @@ -6,6 +6,7 @@ import edit from './edit'; import metadata from './block.json'; import save from './save'; import variations from './variations'; +import deprecated from './deprecated'; /** * WordPress dependencies @@ -19,6 +20,7 @@ export { metadata, name }; export const settings = { edit, save, + deprecated, variations, }; From c6cdda0176e02add7626b605765c1905b7c95462 Mon Sep 17 00:00:00 2001 From: aristath Date: Fri, 16 Feb 2024 13:29:38 +0200 Subject: [PATCH 09/17] WIP - fix deprecation --- packages/block-library/src/form/deprecated.js | 63 ++++++++++--------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/packages/block-library/src/form/deprecated.js b/packages/block-library/src/form/deprecated.js index 4109ddf44212f2..49939a7c7f55d4 100644 --- a/packages/block-library/src/form/deprecated.js +++ b/packages/block-library/src/form/deprecated.js @@ -5,37 +5,18 @@ import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; const deprecated = [ { - supports: { - anchor: true, - className: false, - color: { - gradients: true, - link: true, - __experimentalDefaultControls: { - background: true, - text: true, - link: true, - }, - }, - spacing: { - margin: true, - padding: true, - }, - typography: { - fontSize: true, - lineHeight: true, - __experimentalFontFamily: true, - __experimentalTextDecoration: true, - __experimentalFontStyle: true, - __experimentalFontWeight: true, - __experimentalLetterSpacing: true, - __experimentalTextTransform: true, - __experimentalDefaultControls: { - fontSize: true, - }, - }, - __experimentalSelector: 'form', - }, + // The block supports here are deliberately empty despite this + // deprecated version of the block having adopted block supports. + // The attributes added by these supports have been manually + // added to this deprecated version's attributes definition so + // that the data isn't lost on migration. All this is so that the + // automatic application of block support classes doesn't occur + // as this version of the block had a bug that overrode those + // classes. If those block support classes are applied during the + // deprecation process, this deprecation doesn't match and won't + // run. + // @see https://github.com/WordPress/gutenberg/pull/55755 + supports: {}, attributes: { submissionMethod: { type: 'string', @@ -51,6 +32,26 @@ const deprecated = [ email: { type: 'string', }, + // The following attributes have been added to match the block + // supports at the time of the deprecation. See above for details. + backgroundColor: { + type: 'string', + }, + textColor: { + type: 'string', + }, + gradient: { + type: 'string', + }, + style: { + type: 'object', + }, + fontFamily: { + type: 'string', + }, + fontSize: { + type: 'string', + }, }, save( { attributes } ) { const blockProps = useBlockProps.save(); From abb69b94140628956ec5285392de6f08abb1a18c Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Mon, 19 Feb 2024 09:55:19 +0200 Subject: [PATCH 10/17] Add anchor attribute to deprecated.js --- packages/block-library/src/form/deprecated.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/block-library/src/form/deprecated.js b/packages/block-library/src/form/deprecated.js index 49939a7c7f55d4..5718748b1053ac 100644 --- a/packages/block-library/src/form/deprecated.js +++ b/packages/block-library/src/form/deprecated.js @@ -34,6 +34,9 @@ const deprecated = [ }, // The following attributes have been added to match the block // supports at the time of the deprecation. See above for details. + anchor: { + type: 'string', + }, backgroundColor: { type: 'string', }, From 3f4f6cc3d480090ecab54d4a2fb73ae53cf376aa Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Fri, 19 Apr 2024 10:40:37 +0300 Subject: [PATCH 11/17] Update core-blocks.md --- docs/reference-guides/core-blocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 3c8ee800d31aa4..2edb5cc684dc69 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -291,7 +291,7 @@ A form. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/blo - **Experimental:** true - **Category:** common - **Allowed Blocks:** core/paragraph, core/heading, core/form-input, core/form-submit-button, core/form-submission-notification, core/group, core/columns -- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** action, email, method, submissionMethod ## Input Field From b0645e064581f717c24040ad627b74f911b6e419 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Fri, 19 Apr 2024 11:57:48 +0300 Subject: [PATCH 12/17] add fixture for deprecated version of block --- .../blocks/core__form__deprecated-v1.html | 21 ++++ .../blocks/core__form__deprecated-v1.json | 84 ++++++++++++++++ .../core__form__deprecated-v1.parsed.json | 97 +++++++++++++++++++ .../core__form__deprecated-v1.serialized.html | 24 +++++ 4 files changed, 226 insertions(+) create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.html create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.json create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.html b/test/integration/fixtures/blocks/core__form__deprecated-v1.html new file mode 100644 index 00000000000000..3530dc78f72d18 --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1.html @@ -0,0 +1,21 @@ + +
+
+ + + +
+ + + +
+ + + +
+
+
+
+
+
+ diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.json b/test/integration/fixtures/blocks/core__form__deprecated-v1.json new file mode 100644 index 00000000000000..e11c82a08403df --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1.json @@ -0,0 +1,84 @@ +[ + { + "name": "core/form", + "isValid": false, + "attributes": { + "submissionMethod": "email", + "method": "post", + "style": { + "color": { + "text": "#913636", + "background": "#d1c6c6" + }, + "typography": { + "fontSize": "18px" + } + } + }, + "innerBlocks": [ + { + "name": "core/form-input", + "isValid": true, + "attributes": { + "type": "text", + "label": "Name", + "inlineLabel": false, + "required": true, + "value": "", + "visibilityPermissions": "all" + }, + "innerBlocks": [] + }, + { + "name": "core/form-input", + "isValid": true, + "attributes": { + "type": "email", + "label": "Email", + "inlineLabel": false, + "required": true, + "value": "", + "visibilityPermissions": "all" + }, + "innerBlocks": [] + }, + { + "name": "core/form-input", + "isValid": true, + "attributes": { + "type": "textarea", + "label": "Comment", + "inlineLabel": false, + "required": true, + "value": "", + "visibilityPermissions": "all" + }, + "innerBlocks": [] + }, + { + "name": "core/form-submit-button", + "isValid": true, + "attributes": {}, + "innerBlocks": [ + { + "name": "core/buttons", + "isValid": true, + "attributes": {}, + "innerBlocks": [ + { + "name": "core/button", + "isValid": true, + "attributes": { + "tagName": "button", + "type": "submit", + "text": "Submit" + }, + "innerBlocks": [] + } + ] + } + ] + } + ] + } +] diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json b/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json new file mode 100644 index 00000000000000..2ebfe9dfedfdfc --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json @@ -0,0 +1,97 @@ +[ + { + "blockName": "core/form", + "attrs": { + "style": { + "color": { + "text": "#913636", + "background": "#d1c6c6" + }, + "typography": { + "fontSize": "18px" + } + } + }, + "innerBlocks": [ + { + "blockName": "core/form-input", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + }, + { + "blockName": "core/form-input", + "attrs": { + "type": "email" + }, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + }, + { + "blockName": "core/form-input", + "attrs": { + "type": "textarea" + }, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + }, + { + "blockName": "core/form-submit-button", + "attrs": {}, + "innerBlocks": [ + { + "blockName": "core/buttons", + "attrs": {}, + "innerBlocks": [ + { + "blockName": "core/button", + "attrs": { + "tagName": "button", + "type": "submit" + }, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + } + ], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
", + null, + "
\n" + ] + } + ], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
", + null, + "
\n" + ] + } + ], + "innerHTML": "\n
\n\n\n\n\n\n
\n", + "innerContent": [ + "\n
", + null, + "\n\n", + null, + "\n\n", + null, + "\n\n", + null, + "
\n" + ] + } +] diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html new file mode 100644 index 00000000000000..3143816f84d558 --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html @@ -0,0 +1,24 @@ + +
+ +
+ + +
+ + +
+ + +
+ +
+ +
+ +
+ +
+ +
+ From eb62475b47e846261bd7a8fc4d86c622b04b5151 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Fri, 19 Apr 2024 13:29:22 +0300 Subject: [PATCH 13/17] Revert "add fixture for deprecated version of block" This reverts commit b0645e064581f717c24040ad627b74f911b6e419. --- .../blocks/core__form__deprecated-v1.html | 21 ---- .../blocks/core__form__deprecated-v1.json | 84 ---------------- .../core__form__deprecated-v1.parsed.json | 97 ------------------- .../core__form__deprecated-v1.serialized.html | 24 ----- 4 files changed, 226 deletions(-) delete mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.html delete mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.json delete mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json delete mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.html b/test/integration/fixtures/blocks/core__form__deprecated-v1.html deleted file mode 100644 index 3530dc78f72d18..00000000000000 --- a/test/integration/fixtures/blocks/core__form__deprecated-v1.html +++ /dev/null @@ -1,21 +0,0 @@ - -
-
- - - -
- - - -
- - - -
-
-
-
-
-
- diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.json b/test/integration/fixtures/blocks/core__form__deprecated-v1.json deleted file mode 100644 index e11c82a08403df..00000000000000 --- a/test/integration/fixtures/blocks/core__form__deprecated-v1.json +++ /dev/null @@ -1,84 +0,0 @@ -[ - { - "name": "core/form", - "isValid": false, - "attributes": { - "submissionMethod": "email", - "method": "post", - "style": { - "color": { - "text": "#913636", - "background": "#d1c6c6" - }, - "typography": { - "fontSize": "18px" - } - } - }, - "innerBlocks": [ - { - "name": "core/form-input", - "isValid": true, - "attributes": { - "type": "text", - "label": "Name", - "inlineLabel": false, - "required": true, - "value": "", - "visibilityPermissions": "all" - }, - "innerBlocks": [] - }, - { - "name": "core/form-input", - "isValid": true, - "attributes": { - "type": "email", - "label": "Email", - "inlineLabel": false, - "required": true, - "value": "", - "visibilityPermissions": "all" - }, - "innerBlocks": [] - }, - { - "name": "core/form-input", - "isValid": true, - "attributes": { - "type": "textarea", - "label": "Comment", - "inlineLabel": false, - "required": true, - "value": "", - "visibilityPermissions": "all" - }, - "innerBlocks": [] - }, - { - "name": "core/form-submit-button", - "isValid": true, - "attributes": {}, - "innerBlocks": [ - { - "name": "core/buttons", - "isValid": true, - "attributes": {}, - "innerBlocks": [ - { - "name": "core/button", - "isValid": true, - "attributes": { - "tagName": "button", - "type": "submit", - "text": "Submit" - }, - "innerBlocks": [] - } - ] - } - ] - } - ] - } -] diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json b/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json deleted file mode 100644 index 2ebfe9dfedfdfc..00000000000000 --- a/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json +++ /dev/null @@ -1,97 +0,0 @@ -[ - { - "blockName": "core/form", - "attrs": { - "style": { - "color": { - "text": "#913636", - "background": "#d1c6c6" - }, - "typography": { - "fontSize": "18px" - } - } - }, - "innerBlocks": [ - { - "blockName": "core/form-input", - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n
\n", - "innerContent": [ - "\n
\n" - ] - }, - { - "blockName": "core/form-input", - "attrs": { - "type": "email" - }, - "innerBlocks": [], - "innerHTML": "\n
\n", - "innerContent": [ - "\n
\n" - ] - }, - { - "blockName": "core/form-input", - "attrs": { - "type": "textarea" - }, - "innerBlocks": [], - "innerHTML": "\n
\n", - "innerContent": [ - "\n
\n" - ] - }, - { - "blockName": "core/form-submit-button", - "attrs": {}, - "innerBlocks": [ - { - "blockName": "core/buttons", - "attrs": {}, - "innerBlocks": [ - { - "blockName": "core/button", - "attrs": { - "tagName": "button", - "type": "submit" - }, - "innerBlocks": [], - "innerHTML": "\n
\n", - "innerContent": [ - "\n
\n" - ] - } - ], - "innerHTML": "\n
\n", - "innerContent": [ - "\n
", - null, - "
\n" - ] - } - ], - "innerHTML": "\n
\n", - "innerContent": [ - "\n
", - null, - "
\n" - ] - } - ], - "innerHTML": "\n
\n\n\n\n\n\n
\n", - "innerContent": [ - "\n
", - null, - "\n\n", - null, - "\n\n", - null, - "\n\n", - null, - "
\n" - ] - } -] diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html deleted file mode 100644 index 3143816f84d558..00000000000000 --- a/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html +++ /dev/null @@ -1,24 +0,0 @@ - -
- -
- - -
- - -
- - -
- -
- -
- -
- -
- -
- From 77efc02755845ddd963c0f47585b58a3e9e26968 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Mon, 20 May 2024 13:11:56 +0300 Subject: [PATCH 14/17] remove deprecation --- packages/block-library/src/form/deprecated.js | 78 ------------------- packages/block-library/src/form/index.js | 2 - 2 files changed, 80 deletions(-) delete mode 100644 packages/block-library/src/form/deprecated.js diff --git a/packages/block-library/src/form/deprecated.js b/packages/block-library/src/form/deprecated.js deleted file mode 100644 index 5718748b1053ac..00000000000000 --- a/packages/block-library/src/form/deprecated.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * WordPress dependencies - */ -import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; - -const deprecated = [ - { - // The block supports here are deliberately empty despite this - // deprecated version of the block having adopted block supports. - // The attributes added by these supports have been manually - // added to this deprecated version's attributes definition so - // that the data isn't lost on migration. All this is so that the - // automatic application of block support classes doesn't occur - // as this version of the block had a bug that overrode those - // classes. If those block support classes are applied during the - // deprecation process, this deprecation doesn't match and won't - // run. - // @see https://github.com/WordPress/gutenberg/pull/55755 - supports: {}, - attributes: { - submissionMethod: { - type: 'string', - default: 'email', - }, - method: { - type: 'string', - default: 'post', - }, - action: { - type: 'string', - }, - email: { - type: 'string', - }, - // The following attributes have been added to match the block - // supports at the time of the deprecation. See above for details. - anchor: { - type: 'string', - }, - backgroundColor: { - type: 'string', - }, - textColor: { - type: 'string', - }, - gradient: { - type: 'string', - }, - style: { - type: 'object', - }, - fontFamily: { - type: 'string', - }, - fontSize: { - type: 'string', - }, - }, - save( { attributes } ) { - const blockProps = useBlockProps.save(); - const { submissionMethod } = attributes; - - return ( -
- - - ); - }, - }, -]; - -export default deprecated; diff --git a/packages/block-library/src/form/index.js b/packages/block-library/src/form/index.js index 3f4bf4652c6435..1e45c642b6d48e 100644 --- a/packages/block-library/src/form/index.js +++ b/packages/block-library/src/form/index.js @@ -6,7 +6,6 @@ import edit from './edit'; import metadata from './block.json'; import save from './save'; import variations from './variations'; -import deprecated from './deprecated'; /** * WordPress dependencies @@ -20,7 +19,6 @@ export { metadata, name }; export const settings = { edit, save, - deprecated, variations, }; From b2734fa955f6901b415f197df384157221533364 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Tue, 21 May 2024 21:53:47 +0900 Subject: [PATCH 15/17] Add deprecation --- packages/block-library/src/form/deprecated.js | 74 +++++++++++++++++++ packages/block-library/src/form/index.js | 2 + 2 files changed, 76 insertions(+) create mode 100644 packages/block-library/src/form/deprecated.js diff --git a/packages/block-library/src/form/deprecated.js b/packages/block-library/src/form/deprecated.js new file mode 100644 index 00000000000000..d626ad8cdef3c4 --- /dev/null +++ b/packages/block-library/src/form/deprecated.js @@ -0,0 +1,74 @@ +/** + * WordPress dependencies + */ +import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; + +const v1 = { + // The block supports here are deliberately empty despite this + // deprecated version of the block having adopted block supports. + // The attributes added by these supports have been manually + // added to this deprecated version's attributes definition so + // that the data isn't lost on migration. All this is so that the + // automatic application of block support classes doesn't occur + // as this version of the block had a bug that overrode those + // classes. If those block support classes are applied during the + // deprecation process, this deprecation doesn't match and won't + // run. + // @see https://github.com/WordPress/gutenberg/pull/55755 + supports: {}, + attributes: { + submissionMethod: { + type: 'string', + default: 'email', + }, + method: { + type: 'string', + default: 'post', + }, + action: { + type: 'string', + }, + email: { + type: 'string', + }, + // The following attributes have been added to match the block + // supports at the time of the deprecation. See above for details. + anchor: { + type: 'string', + }, + backgroundColor: { + type: 'string', + }, + textColor: { + type: 'string', + }, + gradient: { + type: 'string', + }, + style: { + type: 'object', + }, + fontFamily: { + type: 'string', + }, + fontSize: { + type: 'string', + }, + }, + save( { attributes } ) { + const blockProps = useBlockProps.save(); + const { submissionMethod } = attributes; + + return ( +
+ + + ); + }, +}; + +export default [ v1 ]; diff --git a/packages/block-library/src/form/index.js b/packages/block-library/src/form/index.js index 1e45c642b6d48e..3f4bf4652c6435 100644 --- a/packages/block-library/src/form/index.js +++ b/packages/block-library/src/form/index.js @@ -6,6 +6,7 @@ import edit from './edit'; import metadata from './block.json'; import save from './save'; import variations from './variations'; +import deprecated from './deprecated'; /** * WordPress dependencies @@ -19,6 +20,7 @@ export { metadata, name }; export const settings = { edit, save, + deprecated, variations, }; From 3e9c06acd8391dc92fc2c24f1680b3687541f1b9 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sun, 10 Aug 2025 17:34:45 +0900 Subject: [PATCH 16/17] Explicitly add props and add fixtures --- packages/block-library/src/form/deprecated.js | 26 +++++- phpunit/class-block-fixture-test.php | 2 + .../blocks/core__form__deprecated-v1.html | 7 ++ .../blocks/core__form__deprecated-v1.json | 78 +++++++++++++++++ .../core__form__deprecated-v1.parsed.json | 87 +++++++++++++++++++ .../core__form__deprecated-v1.serialized.html | 7 ++ 6 files changed, 205 insertions(+), 2 deletions(-) create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.html create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.json create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html diff --git a/packages/block-library/src/form/deprecated.js b/packages/block-library/src/form/deprecated.js index d626ad8cdef3c4..9a1e74621c5960 100644 --- a/packages/block-library/src/form/deprecated.js +++ b/packages/block-library/src/form/deprecated.js @@ -1,7 +1,13 @@ /** * WordPress dependencies */ -import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; +import { + InnerBlocks, + useBlockProps, + getTypographyClassesAndStyles, + __experimentalGetColorClassesAndStyles as getColorClassesAndStyles, + __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles, +} from '@wordpress/block-editor'; const v1 = { // The block supports here are deliberately empty despite this @@ -35,6 +41,9 @@ const v1 = { // supports at the time of the deprecation. See above for details. anchor: { type: 'string', + source: 'attribute', + attribute: 'id', + selector: '*', }, backgroundColor: { type: 'string', @@ -56,8 +65,21 @@ const v1 = { }, }, save( { attributes } ) { - const blockProps = useBlockProps.save(); const { submissionMethod } = attributes; + const colorProps = getColorClassesAndStyles( attributes ); + const typographyProps = getTypographyClassesAndStyles( attributes ); + const spacingProps = getSpacingClassesAndStyles( attributes ); + const blockProps = useBlockProps.save( { + // In this deprecated version, the block support is deliberately empty. + // As a result, the useBlockProps.save() does not output style or id attributes, + // so we apply them explicitly here. + style: { + ...colorProps.style, + ...typographyProps.style, + ...spacingProps.style, + }, + id: attributes.anchor, + } ); return (
+
+ + + +
+ diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.json b/test/integration/fixtures/blocks/core__form__deprecated-v1.json new file mode 100644 index 00000000000000..ca5f0ddaaeb2dc --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1.json @@ -0,0 +1,78 @@ +[ + { + "name": "core/form", + "isValid": true, + "attributes": { + "submissionMethod": "email", + "method": "post", + "anchor": "anchor", + "style": { + "elements": { + "link": { + "color": { + "text": "#ff0000" + } + } + }, + "color": { + "text": "#ff0000", + "background": "#00ffff" + }, + "typography": { + "fontSize": "30px" + }, + "spacing": { + "padding": { + "top": "1px", + "bottom": "1px", + "left": "2px", + "right": "2px" + }, + "margin": { + "top": "3px", + "bottom": "3px", + "left": "4px", + "right": "4px" + } + } + } + }, + "innerBlocks": [] + }, + { + "name": "core/form", + "isValid": true, + "attributes": { + "submissionMethod": "email", + "method": "post", + "anchor": "anchor", + "backgroundColor": "accent-1", + "textColor": "contrast", + "style": { + "elements": { + "link": { + "color": { + "text": "var:preset|color|contrast" + } + } + }, + "spacing": { + "padding": { + "top": "var:preset|spacing|40", + "bottom": "var:preset|spacing|40", + "left": "var:preset|spacing|40", + "right": "var:preset|spacing|40" + }, + "margin": { + "top": "var:preset|spacing|40", + "bottom": "var:preset|spacing|40", + "left": "var:preset|spacing|40", + "right": "var:preset|spacing|40" + } + } + }, + "fontSize": "x-large" + }, + "innerBlocks": [] + } +] diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json b/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json new file mode 100644 index 00000000000000..63a8e6ca5c5e0b --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json @@ -0,0 +1,87 @@ +[ + { + "blockName": "core/form", + "attrs": { + "className": "custom-class", + "style": { + "elements": { + "link": { + "color": { + "text": "#ff0000" + } + } + }, + "color": { + "text": "#ff0000", + "background": "#00ffff" + }, + "typography": { + "fontSize": "30px" + }, + "spacing": { + "padding": { + "top": "1px", + "bottom": "1px", + "left": "2px", + "right": "2px" + }, + "margin": { + "top": "3px", + "bottom": "3px", + "left": "4px", + "right": "4px" + } + } + } + }, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] + }, + { + "blockName": "core/form", + "attrs": { + "className": "custom-class", + "style": { + "elements": { + "link": { + "color": { + "text": "var:preset|color|contrast" + } + } + }, + "spacing": { + "padding": { + "top": "var:preset|spacing|40", + "bottom": "var:preset|spacing|40", + "left": "var:preset|spacing|40", + "right": "var:preset|spacing|40" + }, + "margin": { + "top": "var:preset|spacing|40", + "bottom": "var:preset|spacing|40", + "left": "var:preset|spacing|40", + "right": "var:preset|spacing|40" + } + } + }, + "backgroundColor": "accent-1", + "textColor": "contrast", + "fontSize": "x-large" + }, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + } +] diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html new file mode 100644 index 00000000000000..6b26fcbc0327c1 --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html @@ -0,0 +1,7 @@ + + + + + + + From 8be747e5839d8e61d51ec7318c4020de901ffe95 Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Thu, 21 Aug 2025 16:35:48 +0900 Subject: [PATCH 17/17] Split fixture file --- ...ore__form__deprecated-v1-custom-value.html | 3 ++ ...ore__form__deprecated-v1-custom-value.json | 42 ++++++++++++++++ ...rm__deprecated-v1-custom-value.parsed.json | 43 +++++++++++++++++ ...deprecated-v1-custom-value.serialized.html | 3 ++ ...re__form__deprecated-v1-preset-value.html} | 4 -- ...re__form__deprecated-v1-preset-value.json} | 40 ---------------- ...m__deprecated-v1-preset-value.parsed.json} | 48 ------------------- ...eprecated-v1-preset-value.serialized.html} | 4 -- 8 files changed, 91 insertions(+), 96 deletions(-) create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.html create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.json create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.parsed.json create mode 100644 test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.serialized.html rename test/integration/fixtures/blocks/{core__form__deprecated-v1.html => core__form__deprecated-v1-preset-value.html} (60%) rename test/integration/fixtures/blocks/{core__form__deprecated-v1.json => core__form__deprecated-v1-preset-value.json} (54%) rename test/integration/fixtures/blocks/{core__form__deprecated-v1.parsed.json => core__form__deprecated-v1-preset-value.parsed.json} (55%) rename test/integration/fixtures/blocks/{core__form__deprecated-v1.serialized.html => core__form__deprecated-v1-preset-value.serialized.html} (61%) diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.html b/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.html new file mode 100644 index 00000000000000..8058cd35b1222f --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.html @@ -0,0 +1,3 @@ + +
+ diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.json b/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.json new file mode 100644 index 00000000000000..5b6d5151811bbe --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.json @@ -0,0 +1,42 @@ +[ + { + "name": "core/form", + "isValid": true, + "attributes": { + "submissionMethod": "email", + "method": "post", + "anchor": "anchor", + "style": { + "elements": { + "link": { + "color": { + "text": "#ff0000" + } + } + }, + "color": { + "text": "#ff0000", + "background": "#00ffff" + }, + "typography": { + "fontSize": "30px" + }, + "spacing": { + "padding": { + "top": "1px", + "bottom": "1px", + "left": "2px", + "right": "2px" + }, + "margin": { + "top": "3px", + "bottom": "3px", + "left": "4px", + "right": "4px" + } + } + } + }, + "innerBlocks": [] + } +] diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.parsed.json b/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.parsed.json new file mode 100644 index 00000000000000..127d3492a5697a --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.parsed.json @@ -0,0 +1,43 @@ +[ + { + "blockName": "core/form", + "attrs": { + "className": "custom-class", + "style": { + "elements": { + "link": { + "color": { + "text": "#ff0000" + } + } + }, + "color": { + "text": "#ff0000", + "background": "#00ffff" + }, + "typography": { + "fontSize": "30px" + }, + "spacing": { + "padding": { + "top": "1px", + "bottom": "1px", + "left": "2px", + "right": "2px" + }, + "margin": { + "top": "3px", + "bottom": "3px", + "left": "4px", + "right": "4px" + } + } + } + }, + "innerBlocks": [], + "innerHTML": "\n
\n", + "innerContent": [ + "\n
\n" + ] + } +] diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.serialized.html b/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.serialized.html new file mode 100644 index 00000000000000..bd0f5b9e384f8b --- /dev/null +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1-custom-value.serialized.html @@ -0,0 +1,3 @@ + + + diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.html b/test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.html similarity index 60% rename from test/integration/fixtures/blocks/core__form__deprecated-v1.html rename to test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.html index 7f04018a5220e3..c76318cb2ad8c8 100644 --- a/test/integration/fixtures/blocks/core__form__deprecated-v1.html +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.html @@ -1,7 +1,3 @@ - -
- -
diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.json b/test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.json similarity index 54% rename from test/integration/fixtures/blocks/core__form__deprecated-v1.json rename to test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.json index ca5f0ddaaeb2dc..d3dacfc3809516 100644 --- a/test/integration/fixtures/blocks/core__form__deprecated-v1.json +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.json @@ -1,44 +1,4 @@ [ - { - "name": "core/form", - "isValid": true, - "attributes": { - "submissionMethod": "email", - "method": "post", - "anchor": "anchor", - "style": { - "elements": { - "link": { - "color": { - "text": "#ff0000" - } - } - }, - "color": { - "text": "#ff0000", - "background": "#00ffff" - }, - "typography": { - "fontSize": "30px" - }, - "spacing": { - "padding": { - "top": "1px", - "bottom": "1px", - "left": "2px", - "right": "2px" - }, - "margin": { - "top": "3px", - "bottom": "3px", - "left": "4px", - "right": "4px" - } - } - } - }, - "innerBlocks": [] - }, { "name": "core/form", "isValid": true, diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json b/test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.parsed.json similarity index 55% rename from test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json rename to test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.parsed.json index 63a8e6ca5c5e0b..cd4c7dba01998b 100644 --- a/test/integration/fixtures/blocks/core__form__deprecated-v1.parsed.json +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.parsed.json @@ -1,52 +1,4 @@ [ - { - "blockName": "core/form", - "attrs": { - "className": "custom-class", - "style": { - "elements": { - "link": { - "color": { - "text": "#ff0000" - } - } - }, - "color": { - "text": "#ff0000", - "background": "#00ffff" - }, - "typography": { - "fontSize": "30px" - }, - "spacing": { - "padding": { - "top": "1px", - "bottom": "1px", - "left": "2px", - "right": "2px" - }, - "margin": { - "top": "3px", - "bottom": "3px", - "left": "4px", - "right": "4px" - } - } - } - }, - "innerBlocks": [], - "innerHTML": "\n
\n", - "innerContent": [ - "\n
\n" - ] - }, - { - "blockName": null, - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n\n", - "innerContent": [ "\n\n" ] - }, { "blockName": "core/form", "attrs": { diff --git a/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.serialized.html similarity index 61% rename from test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html rename to test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.serialized.html index 6b26fcbc0327c1..1966cdcb647808 100644 --- a/test/integration/fixtures/blocks/core__form__deprecated-v1.serialized.html +++ b/test/integration/fixtures/blocks/core__form__deprecated-v1-preset-value.serialized.html @@ -1,7 +1,3 @@ - - - -