From 7395f7418f20f25b1e499f28fc4174785437f601 Mon Sep 17 00:00:00 2001 From: Miina Sikk Date: Tue, 30 Jul 2019 16:50:51 +0300 Subject: [PATCH 1/4] Remove deprecated formattingControls. --- assets/src/stories-editor/blocks/amp-story-cta/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/src/stories-editor/blocks/amp-story-cta/edit.js b/assets/src/stories-editor/blocks/amp-story-cta/edit.js index b4428537d57..f6fb0246947 100644 --- a/assets/src/stories-editor/blocks/amp-story-cta/edit.js +++ b/assets/src/stories-editor/blocks/amp-story-cta/edit.js @@ -73,7 +73,7 @@ class CallToActionEdit extends Component { placeholder={ __( 'Add text…', 'amp' ) } value={ text } onChange={ ( value ) => setAttributes( { text: value } ) } - formattingControls={ [ 'bold', 'italic', 'strikethrough' ] } + allowedFormats={ [ 'bold', 'italic', 'strikethrough' ] } className={ classnames( 'amp-block-story-cta__link', { 'has-background': backgroundColor.color, From 2130633cbf6e825660c494867ceed4e24d3b430e Mon Sep 17 00:00:00 2001 From: Miina Sikk Date: Tue, 30 Jul 2019 16:55:55 +0300 Subject: [PATCH 2/4] Update CTA block formats. --- assets/src/stories-editor/blocks/amp-story-cta/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/src/stories-editor/blocks/amp-story-cta/edit.js b/assets/src/stories-editor/blocks/amp-story-cta/edit.js index f6fb0246947..bfa485e4548 100644 --- a/assets/src/stories-editor/blocks/amp-story-cta/edit.js +++ b/assets/src/stories-editor/blocks/amp-story-cta/edit.js @@ -73,7 +73,7 @@ class CallToActionEdit extends Component { placeholder={ __( 'Add text…', 'amp' ) } value={ text } onChange={ ( value ) => setAttributes( { text: value } ) } - allowedFormats={ [ 'bold', 'italic', 'strikethrough' ] } + allowedFormats={ [ 'core/bold', 'core/italic', 'core/strikethrough' ] } className={ classnames( 'amp-block-story-cta__link', { 'has-background': backgroundColor.color, From 753c56b41f2d7564dd660995d24606f17b0ffbbd Mon Sep 17 00:00:00 2001 From: Miina Sikk Date: Tue, 30 Jul 2019 17:04:06 +0300 Subject: [PATCH 3/4] Remove tests that are not relevant anymore. --- .../stories-editor/helpers/test/addAMPExtraProps.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/assets/src/stories-editor/helpers/test/addAMPExtraProps.js b/assets/src/stories-editor/helpers/test/addAMPExtraProps.js index 62123ab4d6c..0ca5916fc4d 100644 --- a/assets/src/stories-editor/helpers/test/addAMPExtraProps.js +++ b/assets/src/stories-editor/helpers/test/addAMPExtraProps.js @@ -10,18 +10,6 @@ describe( 'addAMPExtraProps', () => { expect( props ).toStrictEqual( {} ); } ); - it( 'generates a unique ID', () => { - const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, {} ); - - expect( props ).toHaveProperty( 'id' ); - } ); - - it( 'uses the existing anchor attribute as the ID', () => { - const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, { anchor: 'foo' } ); - - expect( props ).toStrictEqual( { id: 'foo' } ); - } ); - it( 'adds a font family attribute', () => { const props = addAMPExtraProps( {}, { name: 'amp/amp-story-text' }, { ampFontFamily: 'Roboto' } ); From c6be107f98af580af5d5c66ef395239239278438 Mon Sep 17 00:00:00 2001 From: Miina Sikk Date: Wed, 31 Jul 2019 21:19:18 +0300 Subject: [PATCH 4/4] Remove allowedFormats and improve styling of inline code for CTA block. --- assets/src/stories-editor/blocks/amp-story-cta/edit.css | 5 +++++ assets/src/stories-editor/blocks/amp-story-cta/edit.js | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/src/stories-editor/blocks/amp-story-cta/edit.css b/assets/src/stories-editor/blocks/amp-story-cta/edit.css index 9c8f2d57ea7..6d46e0c3477 100644 --- a/assets/src/stories-editor/blocks/amp-story-cta/edit.css +++ b/assets/src/stories-editor/blocks/amp-story-cta/edit.css @@ -65,6 +65,11 @@ max-width: 100%; } +.wp-block-amp-amp-story-cta .block-editor-rich-text__editable code { + background: inherit; + color: inherit; +} + .wp-block-amp-amp-story-cta .block-editor-rich-text__editable[data-is-placeholder-visible="true"] { height: auto; } diff --git a/assets/src/stories-editor/blocks/amp-story-cta/edit.js b/assets/src/stories-editor/blocks/amp-story-cta/edit.js index bfa485e4548..ab9db2bd327 100644 --- a/assets/src/stories-editor/blocks/amp-story-cta/edit.js +++ b/assets/src/stories-editor/blocks/amp-story-cta/edit.js @@ -73,7 +73,6 @@ class CallToActionEdit extends Component { placeholder={ __( 'Add text…', 'amp' ) } value={ text } onChange={ ( value ) => setAttributes( { text: value } ) } - allowedFormats={ [ 'core/bold', 'core/italic', 'core/strikethrough' ] } className={ classnames( 'amp-block-story-cta__link', { 'has-background': backgroundColor.color,