setAttributes( { text: value } ) }
- withoutInteractiveFormatting
- className={ classnames( className, 'wp-block-button__link', {
- 'no-border-radius': borderRadius === 0,
- } ) }
- style={ {
- borderRadius: borderRadius
- ? borderRadius + 'px'
- : undefined,
- } }
- />
+
+
+ setAttributes( { text: value } ) }
+ withoutInteractiveFormatting
+ className={ classnames(
+ className,
+ 'wp-block-button__link',
+ colorProps.className,
+ {
+ 'no-border-radius': borderRadius === 0,
+ }
+ ) }
+ style={ {
+ borderRadius: borderRadius
+ ? borderRadius + 'px'
+ : undefined,
+ ...colorProps.style,
+ } }
+ />
+
+
+
+
);
}
diff --git a/packages/e2e-tests/fixtures/blocks/core__button__center__deprecated.serialized.html b/packages/e2e-tests/fixtures/blocks/core__button__center__deprecated.serialized.html
index 5fee004c30ddd..3d88c7ec1a551 100644
--- a/packages/e2e-tests/fixtures/blocks/core__button__center__deprecated.serialized.html
+++ b/packages/e2e-tests/fixtures/blocks/core__button__center__deprecated.serialized.html
@@ -1,3 +1,3 @@
-Help build Gutenberg
+
diff --git a/packages/e2e-tests/fixtures/blocks/core__button__squared.html b/packages/e2e-tests/fixtures/blocks/core__button__squared.html
index d7a2b6f5f9590..7df5372a100b6 100644
--- a/packages/e2e-tests/fixtures/blocks/core__button__squared.html
+++ b/packages/e2e-tests/fixtures/blocks/core__button__squared.html
@@ -1,3 +1,3 @@
-My button
+
diff --git a/packages/e2e-tests/fixtures/blocks/core__button__squared.json b/packages/e2e-tests/fixtures/blocks/core__button__squared.json
index f3aa8241d516f..1e97cd0ba5209 100644
--- a/packages/e2e-tests/fixtures/blocks/core__button__squared.json
+++ b/packages/e2e-tests/fixtures/blocks/core__button__squared.json
@@ -5,16 +5,16 @@
"isValid": true,
"attributes": {
"text": "My button",
- "align": "none",
- "style": {
- "color": {
- "background": "#aa5a20",
- "text": "#1b9b6c"
- }
- },
- "borderRadius": 0
+ "borderRadius": 0,
+ "style": {
+ "color": {
+ "text": "#1b9b6c",
+ "background": "#aa5a20"
+ }
+ },
+ "align": "none"
},
"innerBlocks": [],
- "originalContent": "My button"
+ "originalContent": ""
}
]
diff --git a/packages/e2e-tests/fixtures/blocks/core__button__squared.parsed.json b/packages/e2e-tests/fixtures/blocks/core__button__squared.parsed.json
index dc1ea8f2ca347..4ddc882a14ae7 100644
--- a/packages/e2e-tests/fixtures/blocks/core__button__squared.parsed.json
+++ b/packages/e2e-tests/fixtures/blocks/core__button__squared.parsed.json
@@ -2,19 +2,19 @@
{
"blockName": "core/button",
"attrs": {
- "align": "none",
"borderRadius": 0,
+ "align": "none",
"style": {
- "color": {
- "background": "#aa5a20",
- "text": "#1b9b6c"
- }
- }
+ "color": {
+ "text": "#1b9b6c",
+ "background": "#aa5a20"
+ }
+ }
},
"innerBlocks": [],
- "innerHTML": "\nMy button\n",
+ "innerHTML": "\n\n",
"innerContent": [
- "\nMy button\n"
+ "\n\n"
]
},
{
diff --git a/packages/e2e-tests/fixtures/blocks/core__button__squared.serialized.html b/packages/e2e-tests/fixtures/blocks/core__button__squared.serialized.html
index d7a2b6f5f9590..0ed8558bc1582 100644
--- a/packages/e2e-tests/fixtures/blocks/core__button__squared.serialized.html
+++ b/packages/e2e-tests/fixtures/blocks/core__button__squared.serialized.html
@@ -1,3 +1,3 @@
-
-My button
+
+
diff --git a/packages/e2e-tests/fixtures/blocks/core__buttons.html b/packages/e2e-tests/fixtures/blocks/core__buttons.html
index 02f5487560cee..e70af7acc72ad 100644
--- a/packages/e2e-tests/fixtures/blocks/core__buttons.html
+++ b/packages/e2e-tests/fixtures/blocks/core__buttons.html
@@ -1,11 +1,11 @@
diff --git a/packages/e2e-tests/fixtures/blocks/core__buttons.json b/packages/e2e-tests/fixtures/blocks/core__buttons.json
index d77d9752de37b..044daeb82101a 100644
--- a/packages/e2e-tests/fixtures/blocks/core__buttons.json
+++ b/packages/e2e-tests/fixtures/blocks/core__buttons.json
@@ -13,7 +13,7 @@
"text": "My button 1"
},
"innerBlocks": [],
- "originalContent": "My button 1"
+ "originalContent": ""
},
{
"clientId": "_clientId_1",
@@ -23,7 +23,7 @@
"text": "My button 2"
},
"innerBlocks": [],
- "originalContent": "My button 2"
+ "originalContent": ""
}
],
"originalContent": "\n\t\n\n\t\n
"
diff --git a/packages/e2e-tests/fixtures/blocks/core__buttons.parsed.json b/packages/e2e-tests/fixtures/blocks/core__buttons.parsed.json
index ee9dd97313a48..b96b1f50db1fc 100644
--- a/packages/e2e-tests/fixtures/blocks/core__buttons.parsed.json
+++ b/packages/e2e-tests/fixtures/blocks/core__buttons.parsed.json
@@ -7,18 +7,18 @@
"blockName": "core/button",
"attrs": {},
"innerBlocks": [],
- "innerHTML": "\n\tMy button 1\n\t",
+ "innerHTML": "\n\t\n\t",
"innerContent": [
- "\n\tMy button 1\n\t"
+ "\n\t\n\t"
]
},
{
"blockName": "core/button",
"attrs": {},
"innerBlocks": [],
- "innerHTML": "\n\tMy button 2\n\t",
+ "innerHTML": "\n\t\n\t",
"innerContent": [
- "\n\tMy button 2\n\t"
+ "\n\t\n\t"
]
}
],
diff --git a/packages/e2e-tests/fixtures/blocks/core__buttons.serialized.html b/packages/e2e-tests/fixtures/blocks/core__buttons.serialized.html
index 18eb4b31eda59..baf0a0226c066 100644
--- a/packages/e2e-tests/fixtures/blocks/core__buttons.serialized.html
+++ b/packages/e2e-tests/fixtures/blocks/core__buttons.serialized.html
@@ -1,9 +1,9 @@
diff --git a/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.html b/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.html
new file mode 100644
index 0000000000000..02f5487560cee
--- /dev/null
+++ b/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.html
@@ -0,0 +1,11 @@
+
+
+
diff --git a/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.json b/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.json
new file mode 100644
index 0000000000000..d77d9752de37b
--- /dev/null
+++ b/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.json
@@ -0,0 +1,31 @@
+[
+ {
+ "clientId": "_clientId_0",
+ "name": "core/buttons",
+ "isValid": true,
+ "attributes": {},
+ "innerBlocks": [
+ {
+ "clientId": "_clientId_0",
+ "name": "core/button",
+ "isValid": true,
+ "attributes": {
+ "text": "My button 1"
+ },
+ "innerBlocks": [],
+ "originalContent": "My button 1"
+ },
+ {
+ "clientId": "_clientId_1",
+ "name": "core/button",
+ "isValid": true,
+ "attributes": {
+ "text": "My button 2"
+ },
+ "innerBlocks": [],
+ "originalContent": "My button 2"
+ }
+ ],
+ "originalContent": "\n\t\n\n\t\n
"
+ }
+]
diff --git a/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.parsed.json b/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.parsed.json
new file mode 100644
index 0000000000000..ee9dd97313a48
--- /dev/null
+++ b/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.parsed.json
@@ -0,0 +1,43 @@
+[
+ {
+ "blockName": "core/buttons",
+ "attrs": {},
+ "innerBlocks": [
+ {
+ "blockName": "core/button",
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\tMy button 1\n\t",
+ "innerContent": [
+ "\n\tMy button 1\n\t"
+ ]
+ },
+ {
+ "blockName": "core/button",
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\tMy button 2\n\t",
+ "innerContent": [
+ "\n\tMy button 2\n\t"
+ ]
+ }
+ ],
+ "innerHTML": "\n\n\t\n\n\t\n
\n",
+ "innerContent": [
+ "\n\n\t",
+ null,
+ "\n\n\t",
+ null,
+ "\n
\n"
+ ]
+ },
+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n",
+ "innerContent": [
+ "\n"
+ ]
+ }
+]
diff --git a/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.serialized.html b/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.serialized.html
new file mode 100644
index 0000000000000..baf0a0226c066
--- /dev/null
+++ b/packages/e2e-tests/fixtures/blocks/core_buttons__simple__deprecated.serialized.html
@@ -0,0 +1,9 @@
+
+
+
diff --git a/packages/e2e-tests/specs/editor/blocks/__snapshots__/buttons.test.js.snap b/packages/e2e-tests/specs/editor/blocks/__snapshots__/buttons.test.js.snap
index 08a92e1fd8820..66f803ddcf139 100644
--- a/packages/e2e-tests/specs/editor/blocks/__snapshots__/buttons.test.js.snap
+++ b/packages/e2e-tests/specs/editor/blocks/__snapshots__/buttons.test.js.snap
@@ -3,7 +3,7 @@
exports[`Buttons can jump to the link editor using the keyboard shortcut 1`] = `
"
"
`;
@@ -11,7 +11,7 @@ exports[`Buttons can jump to the link editor using the keyboard shortcut 1`] = `
exports[`Buttons dismisses link editor when escape is pressed 1`] = `
"
"
`;
@@ -19,7 +19,7 @@ exports[`Buttons dismisses link editor when escape is pressed 1`] = `
exports[`Buttons has focus on button content 1`] = `
"
"
`;