diff --git a/block-library/index.js b/block-library/index.js index b76b3ce0bee70d..0afac557a4ac0e 100644 --- a/block-library/index.js +++ b/block-library/index.js @@ -34,7 +34,6 @@ import * as list from '../packages/block-library/src/list'; import * as more from '../packages/block-library/src/more'; import * as nextpage from '../packages/block-library/src/nextpage'; import * as preformatted from '../packages/block-library/src/preformatted'; -import * as pullquote from '../packages/block-library/src/pullquote'; import * as reusableBlock from '../packages/block-library/src/block'; import * as separator from '../packages/block-library/src/separator'; import * as shortcode from '../packages/block-library/src/shortcode'; @@ -83,7 +82,6 @@ export const registerCoreBlocks = () => { more, nextpage, preformatted, - pullquote, separator, reusableBlock, spacer, diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss index 60aacb91e833fd..6c26aa8055ee47 100644 --- a/packages/block-library/src/editor.scss +++ b/packages/block-library/src/editor.scss @@ -15,7 +15,6 @@ @import "./more/editor.scss"; @import "./nextpage/editor.scss"; @import "./preformatted/editor.scss"; -@import "./pullquote/editor.scss"; @import "./quote/editor.scss"; @import "./shortcode/editor.scss"; @import "./spacer/editor.scss"; diff --git a/packages/block-library/src/index.js b/packages/block-library/src/index.js index abb8536486aff1..7b2d85ead7bf2f 100644 --- a/packages/block-library/src/index.js +++ b/packages/block-library/src/index.js @@ -30,7 +30,6 @@ import * as list from './list'; import * as more from './more'; import * as nextpage from './nextpage'; import * as preformatted from './preformatted'; -import * as pullquote from './pullquote'; import * as reusableBlock from './block'; import * as separator from './separator'; import * as shortcode from './shortcode'; @@ -71,7 +70,6 @@ export const registerCoreBlocks = () => { more, nextpage, preformatted, - pullquote, separator, reusableBlock, spacer, diff --git a/packages/block-library/src/pullquote/editor.scss b/packages/block-library/src/pullquote/editor.scss deleted file mode 100644 index d0f9c518b5e143..00000000000000 --- a/packages/block-library/src/pullquote/editor.scss +++ /dev/null @@ -1,32 +0,0 @@ -.editor-block-list__block[data-type="core/pullquote"] { - &[data-align="left"], - &[data-align="right"] { - & .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, - & .editor-rich-text p { - font-size: 20px; - } - } -} - -.wp-block-pullquote { - cite { - display: block; - } - - cite .editor-rich-text__tinymce[data-is-empty="true"]::before { - font-size: 14px; - font-family: $default-font; - } - - .editor-rich-text__tinymce[data-is-empty="true"]::before { - width: 100%; - left: 50%; - transform: translateX(-50%); - } - - & > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before, - & > .editor-rich-text p { - font-size: 24px; - line-height: 1.6; - } -} diff --git a/packages/block-library/src/pullquote/index.js b/packages/block-library/src/pullquote/index.js deleted file mode 100644 index 800828091282a8..00000000000000 --- a/packages/block-library/src/pullquote/index.js +++ /dev/null @@ -1,124 +0,0 @@ -/** - * External dependencies - */ -import { map } from 'lodash'; - -/** - * WordPress dependencies - */ -import { __ } from '@wordpress/i18n'; -import { - RichText, -} from '@wordpress/editor'; - -const toRichTextValue = ( value ) => map( value, ( ( subValue ) => subValue.children ) ); -const fromRichTextValue = ( value ) => map( value, ( subValue ) => ( { - children: subValue, -} ) ); -const blockAttributes = { - value: { - type: 'array', - source: 'query', - selector: 'blockquote > p', - query: { - children: { - source: 'node', - }, - }, - }, - citation: { - type: 'array', - source: 'children', - selector: 'cite', - }, -}; - -export const name = 'core/pullquote'; - -export const settings = { - - title: __( 'Pullquote' ), - - description: __( 'Highlight a quote from your post or page by displaying it as a graphic element.' ), - - icon: , - - category: 'formatting', - - attributes: blockAttributes, - - supports: { - align: true, - }, - - edit( { attributes, setAttributes, isSelected, className } ) { - const { value, citation } = attributes; - - return ( -
- setAttributes( { - value: fromRichTextValue( nextValue ), - } ) - } - /* translators: the text of the quotation */ - placeholder={ __( 'Write quote…' ) } - wrapperClassName="block-library-pullquote__content" - /> - { ( citation || isSelected ) && ( - setAttributes( { - citation: nextCitation, - } ) - } - /> - ) } -
- ); - }, - - save( { attributes } ) { - const { value, citation } = attributes; - - return ( -
- - { citation && citation.length > 0 && } -
- ); - }, - - deprecated: [ { - attributes: { - ...blockAttributes, - citation: { - type: 'array', - source: 'children', - selector: 'footer', - }, - align: { - type: 'string', - default: 'none', - }, - }, - - save( { attributes } ) { - const { value, citation, align } = attributes; - - return ( -
- - { citation && citation.length > 0 && } -
- ); - }, - } ], -}; diff --git a/packages/block-library/src/pullquote/style.scss b/packages/block-library/src/pullquote/style.scss deleted file mode 100644 index 2467adff4e5437..00000000000000 --- a/packages/block-library/src/pullquote/style.scss +++ /dev/null @@ -1,23 +0,0 @@ -.wp-block-pullquote { - padding: 3em 0; - text-align: center; - - &.alignleft, - &.alignright { - max-width: 400px; - - > p { - font-size: 20px; - } - } - - > p { - font-size: 24px; - line-height: 1.6; - } - - cite, - footer { - position: relative; - } -} diff --git a/packages/block-library/src/pullquote/test/__snapshots__/index.js.snap b/packages/block-library/src/pullquote/test/__snapshots__/index.js.snap deleted file mode 100644 index 0fb96fbe630617..00000000000000 --- a/packages/block-library/src/pullquote/test/__snapshots__/index.js.snap +++ /dev/null @@ -1,37 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`core/pullquote block edit matches snapshot 1`] = ` -
-
-
-
-
- -
-
-
-
-`; diff --git a/packages/block-library/src/pullquote/test/index.js b/packages/block-library/src/pullquote/test/index.js deleted file mode 100644 index 24e135dd4c02cd..00000000000000 --- a/packages/block-library/src/pullquote/test/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Internal dependencies - */ -import { name, settings } from '../'; -import { blockEditRender } from '../../test/helpers'; - -describe( 'core/pullquote', () => { - test( 'block edit matches snapshot', () => { - const wrapper = blockEditRender( name, settings ); - - expect( wrapper ).toMatchSnapshot(); - } ); -} ); diff --git a/packages/block-library/src/pullquote/theme.scss b/packages/block-library/src/pullquote/theme.scss deleted file mode 100644 index 3d1d40647f496f..00000000000000 --- a/packages/block-library/src/pullquote/theme.scss +++ /dev/null @@ -1,12 +0,0 @@ -.wp-block-pullquote { - border-top: 4px solid $dark-gray-500; - border-bottom: 4px solid $dark-gray-500; - color: $dark-gray-600; - - cite, - footer { - color: $dark-gray-600; - text-transform: uppercase; - font-size: $default-font-size; - } -} diff --git a/packages/block-library/src/quote/index.js b/packages/block-library/src/quote/index.js index c63ff379114e5b..475d3eb7460456 100644 --- a/packages/block-library/src/quote/index.js +++ b/packages/block-library/src/quote/index.js @@ -55,6 +55,7 @@ export const settings = { styles: [ { name: 'default', label: __( 'Regular' ), isDefault: true }, { name: 'large', label: __( 'Large' ) }, + { name: 'fancy', label: __( 'Fancy' ) }, ], transforms: { diff --git a/packages/block-library/src/quote/style.scss b/packages/block-library/src/quote/style.scss index c1206d68958f7b..a8a1400f76e5e6 100644 --- a/packages/block-library/src/quote/style.scss +++ b/packages/block-library/src/quote/style.scss @@ -16,4 +16,25 @@ text-align: right; } } + + &.is-style-fancy { + padding: 3em 0; + text-align: center; + border-top: 4px solid $dark-gray-500; + border-bottom: 4px solid $dark-gray-500; + color: $dark-gray-600; + + p { + font-size: 24px; + line-height: 1.6; + } + + cite, + footer { + position: relative; + color: $dark-gray-600; + text-transform: uppercase; + font-size: $default-font-size; + } + } } diff --git a/packages/block-library/src/quote/theme.scss b/packages/block-library/src/quote/theme.scss index df07d206febe59..fab98c19c15162 100644 --- a/packages/block-library/src/quote/theme.scss +++ b/packages/block-library/src/quote/theme.scss @@ -11,7 +11,7 @@ } } -.wp-block-quote:not(.is-large):not(.is-style-large) { +.wp-block-quote:not(.is-large):not(.is-style-large):not(.is-style-fancy) { border-left: 4px solid $black; padding-left: 1em; } diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss index 9d6115f8d76d79..d34b95129e7a57 100644 --- a/packages/block-library/src/style.scss +++ b/packages/block-library/src/style.scss @@ -12,7 +12,6 @@ @import "./latest-comments/style.scss"; @import "./latest-posts/style.scss"; @import "./paragraph/style.scss"; -@import "./pullquote/style.scss"; @import "./quote/style.scss"; @import "./separator/style.scss"; @import "./subhead/style.scss"; diff --git a/packages/block-library/src/theme.scss b/packages/block-library/src/theme.scss index da6419fcf47018..bd7affa5343791 100644 --- a/packages/block-library/src/theme.scss +++ b/packages/block-library/src/theme.scss @@ -1,7 +1,5 @@ @import "./code/theme.scss"; @import "./preformatted/theme.scss"; -@import "./pullquote/theme.scss"; -@import "./quote/theme.scss"; @import "./separator/theme.scss"; @import "./table/theme.scss"; @import "./video/theme.scss"; diff --git a/packages/editor/src/store/selectors.js b/packages/editor/src/store/selectors.js index a1edb8e88149a1..15e836b31a034f 100644 --- a/packages/editor/src/store/selectors.js +++ b/packages/editor/src/store/selectors.js @@ -1353,8 +1353,6 @@ export function getSuggestedPostFormat( state ) { case 'core/image': return 'image'; case 'core/quote': - case 'core/pullquote': - return 'quote'; case 'core/gallery': return 'gallery'; case 'core/video': diff --git a/phpunit/fixtures/long-content.html b/phpunit/fixtures/long-content.html index 07677c3906437a..6492faadfa517b 100644 --- a/phpunit/fixtures/long-content.html +++ b/phpunit/fixtures/long-content.html @@ -107,12 +107,6 @@

Media Rich

You can build any block you like, static or dynamic, decorative or plain. Here's a pullquote block:

- -
-

Code is Poetry

-The WordPress community -
-

If you want to learn more about how to build additional blocks, or if you are interested in helping with the project, head over to the GitHub repository.

diff --git a/post-content.php b/post-content.php index fef557c7ccd449..8f217a53458276 100644 --- a/post-content.php +++ b/post-content.php @@ -139,10 +139,6 @@

- -

- -

diff --git a/test/integration/full-content/fixtures/core__pullquote.html b/test/integration/full-content/fixtures/core__pullquote.html deleted file mode 100644 index 8c13cedfe000dc..00000000000000 --- a/test/integration/full-content/fixtures/core__pullquote.html +++ /dev/null @@ -1,5 +0,0 @@ - -

-

Testing pullquote block...

...with a caption -
- diff --git a/test/integration/full-content/fixtures/core__pullquote.json b/test/integration/full-content/fixtures/core__pullquote.json deleted file mode 100644 index 11d576614228cd..00000000000000 --- a/test/integration/full-content/fixtures/core__pullquote.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "clientId": "_clientId_0", - "name": "core/pullquote", - "isValid": true, - "attributes": { - "value": [ - { - "children": { - "type": "p", - "props": { - "children": [ - "Testing pullquote block..." - ] - } - } - } - ], - "citation": [ - "...with a caption" - ] - }, - "innerBlocks": [], - "originalContent": "
\n

Testing pullquote block...

...with a caption\n
" - } -] diff --git a/test/integration/full-content/fixtures/core__pullquote.parsed.json b/test/integration/full-content/fixtures/core__pullquote.parsed.json deleted file mode 100644 index c8d7f7c3c2dd61..00000000000000 --- a/test/integration/full-content/fixtures/core__pullquote.parsed.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "blockName": "core/pullquote", - "attrs": null, - "innerBlocks": [], - "innerHTML": "\n
\n

Testing pullquote block...

...with a caption\n
\n" - }, - { - "attrs": {}, - "innerHTML": "\n" - } -] diff --git a/test/integration/full-content/fixtures/core__pullquote.serialized.html b/test/integration/full-content/fixtures/core__pullquote.serialized.html deleted file mode 100644 index 00f47cf0d5e399..00000000000000 --- a/test/integration/full-content/fixtures/core__pullquote.serialized.html +++ /dev/null @@ -1,3 +0,0 @@ - -

Testing pullquote block...

...with a caption
- diff --git a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.html b/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.html deleted file mode 100644 index 252b029f1f888d..00000000000000 --- a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.html +++ /dev/null @@ -1,7 +0,0 @@ - -
-

Paragraph one

-

Paragraph two

- by whomever -
- diff --git a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.json b/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.json deleted file mode 100644 index 266568fa51bc00..00000000000000 --- a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "clientId": "_clientId_0", - "name": "core/pullquote", - "isValid": true, - "attributes": { - "value": [ - { - "children": { - "type": "p", - "props": { - "children": [ - "Paragraph ", - { - "type": "strong", - "props": { - "children": [ - "one" - ] - } - } - ] - } - } - }, - { - "children": { - "type": "p", - "props": { - "children": [ - "Paragraph two" - ] - } - } - } - ], - "citation": [ - "by whomever" - ] - }, - "innerBlocks": [], - "originalContent": "
\n

Paragraph one

\n

Paragraph two

\n by whomever\n
" - } -] diff --git a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.parsed.json b/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.parsed.json deleted file mode 100644 index 2a816764b3ae4d..00000000000000 --- a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.parsed.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "blockName": "core/pullquote", - "attrs": null, - "innerBlocks": [], - "innerHTML": "\n
\n

Paragraph one

\n

Paragraph two

\n by whomever\n
\n" - }, - { - "attrs": {}, - "innerHTML": "\n" - } -] diff --git a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.serialized.html b/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.serialized.html deleted file mode 100644 index 635df56edcf4f7..00000000000000 --- a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.serialized.html +++ /dev/null @@ -1,3 +0,0 @@ - -

Paragraph one

Paragraph two

by whomever
-