From 76b9d699a8559ba2d3cd531ed921d7a754e81360 Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Sun, 25 Sep 2022 13:05:26 +0900 Subject: [PATCH 1/5] Tag Cloud Block: Prevent block support styles and additional CSS classes from being printed twice --- packages/block-library/src/editor.scss | 1 + packages/block-library/src/tag-cloud/edit.js | 11 ++++++++++- packages/block-library/src/tag-cloud/editor.scss | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 packages/block-library/src/tag-cloud/editor.scss diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss index edb66416af88c5..97e268ea125af0 100644 --- a/packages/block-library/src/editor.scss +++ b/packages/block-library/src/editor.scss @@ -42,6 +42,7 @@ @import "./social-links/editor.scss"; @import "./spacer/editor.scss"; @import "./table/editor.scss"; +@import "./tag-cloud/editor.scss"; @import "./template-part/editor.scss"; @import "./text-columns/editor.scss"; @import "./video/editor.scss"; diff --git a/packages/block-library/src/tag-cloud/edit.js b/packages/block-library/src/tag-cloud/edit.js index f35160dfe1bf6e..525a1c846b153d 100644 --- a/packages/block-library/src/tag-cloud/edit.js +++ b/packages/block-library/src/tag-cloud/edit.js @@ -105,6 +105,15 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) { setAttributes( updateObj ); }; + const serverSideRenderAttirbutes = { + ...attributes, + className: undefined, + style: { + ...attributes.style, + spacing: undefined, + }, + }; + const inspectorControls = ( @@ -170,7 +179,7 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) { diff --git a/packages/block-library/src/tag-cloud/editor.scss b/packages/block-library/src/tag-cloud/editor.scss new file mode 100644 index 00000000000000..a0f37945ec3977 --- /dev/null +++ b/packages/block-library/src/tag-cloud/editor.scss @@ -0,0 +1,4 @@ +.wp-block-tag-cloud { + // This block has customizable padding, border-box makes that more predictable. + box-sizing: border-box; +} From aba1b1afa786a07197c9c8bee2c57fb2ff5be111 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:55:41 +0900 Subject: [PATCH 2/5] Fix Typo Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> --- packages/block-library/src/tag-cloud/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/tag-cloud/edit.js b/packages/block-library/src/tag-cloud/edit.js index 525a1c846b153d..360a711e97ceac 100644 --- a/packages/block-library/src/tag-cloud/edit.js +++ b/packages/block-library/src/tag-cloud/edit.js @@ -105,7 +105,7 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) { setAttributes( updateObj ); }; - const serverSideRenderAttirbutes = { + const serverSideRenderAttributes = { ...attributes, className: undefined, style: { From 43e600bbda239c2820f530b1cadf757fb42f0b9e Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:55:54 +0900 Subject: [PATCH 3/5] Fix Typo Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> --- packages/block-library/src/tag-cloud/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/tag-cloud/edit.js b/packages/block-library/src/tag-cloud/edit.js index 360a711e97ceac..c37daf34701c73 100644 --- a/packages/block-library/src/tag-cloud/edit.js +++ b/packages/block-library/src/tag-cloud/edit.js @@ -179,7 +179,7 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) { From 75691629e905902e76bad680381ec637119b748e Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Fri, 7 Oct 2022 18:37:15 +0900 Subject: [PATCH 4/5] Use new option --- packages/block-library/src/tag-cloud/edit.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/block-library/src/tag-cloud/edit.js b/packages/block-library/src/tag-cloud/edit.js index c37daf34701c73..8cb286630d8eb7 100644 --- a/packages/block-library/src/tag-cloud/edit.js +++ b/packages/block-library/src/tag-cloud/edit.js @@ -105,15 +105,6 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) { setAttributes( updateObj ); }; - const serverSideRenderAttributes = { - ...attributes, - className: undefined, - style: { - ...attributes.style, - spacing: undefined, - }, - }; - const inspectorControls = ( @@ -177,9 +168,9 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) { { inspectorControls }
From 67a88a37a46a016789f1974d4cb1ecd8fd4cfd45 Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Mon, 10 Oct 2022 12:05:31 +0900 Subject: [PATCH 5/5] move the box-sizing: border-box to the style.scss file --- packages/block-library/src/editor.scss | 1 - packages/block-library/src/tag-cloud/editor.scss | 4 ---- packages/block-library/src/tag-cloud/style.scss | 3 +++ 3 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 packages/block-library/src/tag-cloud/editor.scss diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss index 97e268ea125af0..edb66416af88c5 100644 --- a/packages/block-library/src/editor.scss +++ b/packages/block-library/src/editor.scss @@ -42,7 +42,6 @@ @import "./social-links/editor.scss"; @import "./spacer/editor.scss"; @import "./table/editor.scss"; -@import "./tag-cloud/editor.scss"; @import "./template-part/editor.scss"; @import "./text-columns/editor.scss"; @import "./video/editor.scss"; diff --git a/packages/block-library/src/tag-cloud/editor.scss b/packages/block-library/src/tag-cloud/editor.scss deleted file mode 100644 index a0f37945ec3977..00000000000000 --- a/packages/block-library/src/tag-cloud/editor.scss +++ /dev/null @@ -1,4 +0,0 @@ -.wp-block-tag-cloud { - // This block has customizable padding, border-box makes that more predictable. - box-sizing: border-box; -} diff --git a/packages/block-library/src/tag-cloud/style.scss b/packages/block-library/src/tag-cloud/style.scss index 6936b7af66485d..5fb04840de1517 100644 --- a/packages/block-library/src/tag-cloud/style.scss +++ b/packages/block-library/src/tag-cloud/style.scss @@ -1,4 +1,7 @@ .wp-block-tag-cloud { + // This block has customizable padding, border-box makes that more predictable. + box-sizing: border-box; + &.aligncenter { text-align: center; justify-content: center;