From 09eec85c97eb679c1502eb8cb73e4aab2bea41c6 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 27 Nov 2020 16:41:18 +0000 Subject: [PATCH 1/6] Verse Block: Adds support for custom padding --- .../developers/themes/theme-json.md | 1 + packages/block-library/src/verse/block.json | 14 +++++++++++++- packages/block-library/src/verse/editor.scss | 1 - 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/designers-developers/developers/themes/theme-json.md b/docs/designers-developers/developers/themes/theme-json.md index 3f89813a103207..40519c2481b410 100644 --- a/docs/designers-developers/developers/themes/theme-json.md +++ b/docs/designers-developers/developers/themes/theme-json.md @@ -342,6 +342,7 @@ These are the current color properties supported by blocks: | --- | --- | | Cover | Yes | | Group | Yes | +| Verse | Yes | #### Typography Properties diff --git a/packages/block-library/src/verse/block.json b/packages/block-library/src/verse/block.json index 77111fac4849c1..0588d23da3268a 100644 --- a/packages/block-library/src/verse/block.json +++ b/packages/block-library/src/verse/block.json @@ -10,12 +10,24 @@ "default": "", "__unstablePreserveWhiteSpace": true }, + "style": { + "default": { + "spacing": { + "padding": { + "default": 20 + } + } + } + }, "textAlign": { "type": "string" } }, "supports": { "anchor": true, - "__experimentalFontFamily": true + "__experimentalFontFamily": true, + "spacing": { + "padding": true + } } } diff --git a/packages/block-library/src/verse/editor.scss b/packages/block-library/src/verse/editor.scss index 737bfc159ffc9a..038e84f500d031 100644 --- a/packages/block-library/src/verse/editor.scss +++ b/packages/block-library/src/verse/editor.scss @@ -2,6 +2,5 @@ pre.wp-block-verse { color: $gray-900; white-space: nowrap; font-size: inherit; - padding: 1em; overflow: auto; } From c062d0a521d43a8bf1215f2b12ece714079fafb9 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Mon, 30 Nov 2020 13:04:17 +0000 Subject: [PATCH 2/6] regenerate fixtures --- packages/e2e-tests/fixtures/blocks/core__verse.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/e2e-tests/fixtures/blocks/core__verse.json b/packages/e2e-tests/fixtures/blocks/core__verse.json index 5c6e3d83e65162..a1de145d0b3a1a 100644 --- a/packages/e2e-tests/fixtures/blocks/core__verse.json +++ b/packages/e2e-tests/fixtures/blocks/core__verse.json @@ -4,7 +4,14 @@ "name": "core/verse", "isValid": true, "attributes": { - "content": "A verse
And more!" + "content": "A verse
And more!", + "style": { + "spacing": { + "padding": { + "default": 20 + } + } + } }, "innerBlocks": [], "originalContent": "
A verse
And more!
" From cc3d3891e05e46e80984819f631b3205e0859e44 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 3 Dec 2020 17:40:39 +0000 Subject: [PATCH 3/6] Update packages/block-library/src/verse/block.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: O André --- packages/block-library/src/verse/block.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/verse/block.json b/packages/block-library/src/verse/block.json index 0588d23da3268a..53304fcc26d2bf 100644 --- a/packages/block-library/src/verse/block.json +++ b/packages/block-library/src/verse/block.json @@ -14,7 +14,10 @@ "default": { "spacing": { "padding": { - "default": 20 + "top": 20, + "right": 20, + "bottom": 20, + "left": 20 } } } From ab44b596c45fa8ffac7d310b7d2229ad15e8dbc4 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 3 Dec 2020 17:40:47 +0000 Subject: [PATCH 4/6] Update packages/e2e-tests/fixtures/blocks/core__verse.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: O André --- packages/e2e-tests/fixtures/blocks/core__verse.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/e2e-tests/fixtures/blocks/core__verse.json b/packages/e2e-tests/fixtures/blocks/core__verse.json index a1de145d0b3a1a..64719d54a04d85 100644 --- a/packages/e2e-tests/fixtures/blocks/core__verse.json +++ b/packages/e2e-tests/fixtures/blocks/core__verse.json @@ -8,7 +8,10 @@ "style": { "spacing": { "padding": { - "default": 20 + "top": 20, + "right": 20, + "bottom": 20, + "left": 20 } } } From 2a7aa91b9503be7eb038b11958085fe835251d96 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 4 Dec 2020 13:41:35 +0000 Subject: [PATCH 5/6] change formatting on the verse block fixture --- packages/e2e-tests/fixtures/blocks/core__verse.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/e2e-tests/fixtures/blocks/core__verse.json b/packages/e2e-tests/fixtures/blocks/core__verse.json index 64719d54a04d85..6415609238acb6 100644 --- a/packages/e2e-tests/fixtures/blocks/core__verse.json +++ b/packages/e2e-tests/fixtures/blocks/core__verse.json @@ -8,10 +8,10 @@ "style": { "spacing": { "padding": { - "top": 20, - "right": 20, - "bottom": 20, - "left": 20 + "top": 20, + "right": 20, + "bottom": 20, + "left": 20 } } } From 616853ed7b5feaa9dfd817645bd78274142a2c6c Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 4 Dec 2020 18:29:17 +0000 Subject: [PATCH 6/6] regenerate fixtures --- packages/e2e-tests/fixtures/blocks/core__verse.html | 6 +++--- packages/e2e-tests/fixtures/blocks/core__verse.json | 2 +- packages/e2e-tests/fixtures/blocks/core__verse.parsed.json | 4 ++-- .../e2e-tests/fixtures/blocks/core__verse.serialized.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/e2e-tests/fixtures/blocks/core__verse.html b/packages/e2e-tests/fixtures/blocks/core__verse.html index 0e6904a898eadb..356fdcc7acf826 100644 --- a/packages/e2e-tests/fixtures/blocks/core__verse.html +++ b/packages/e2e-tests/fixtures/blocks/core__verse.html @@ -1,3 +1,3 @@ - -
A verse
And more!
- + +
A verse
And more!
+ diff --git a/packages/e2e-tests/fixtures/blocks/core__verse.json b/packages/e2e-tests/fixtures/blocks/core__verse.json index 6415609238acb6..a3a1b520bef856 100644 --- a/packages/e2e-tests/fixtures/blocks/core__verse.json +++ b/packages/e2e-tests/fixtures/blocks/core__verse.json @@ -17,6 +17,6 @@ } }, "innerBlocks": [], - "originalContent": "
A verse
And more!
" + "originalContent": "
A verse
And more!
" } ] diff --git a/packages/e2e-tests/fixtures/blocks/core__verse.parsed.json b/packages/e2e-tests/fixtures/blocks/core__verse.parsed.json index 2fbff3b1b326ed..d48a00c57513a7 100644 --- a/packages/e2e-tests/fixtures/blocks/core__verse.parsed.json +++ b/packages/e2e-tests/fixtures/blocks/core__verse.parsed.json @@ -3,9 +3,9 @@ "blockName": "core/verse", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
A verse
And more!
\n", + "innerHTML": "\n
A verse
And more!
\n", "innerContent": [ - "\n
A verse
And more!
\n" + "\n
A verse
And more!
\n" ] }, { diff --git a/packages/e2e-tests/fixtures/blocks/core__verse.serialized.html b/packages/e2e-tests/fixtures/blocks/core__verse.serialized.html index a601b259912a8e..356fdcc7acf826 100644 --- a/packages/e2e-tests/fixtures/blocks/core__verse.serialized.html +++ b/packages/e2e-tests/fixtures/blocks/core__verse.serialized.html @@ -1,3 +1,3 @@ -
A verse
And more!
+
A verse
And more!