Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move BlockQuotation to be a primate component.
  • Loading branch information
SergioEstevao committed May 24, 2019
commit 08b232792d1832b6f448ea5bac3cc36af3d27144
5 changes: 1 addition & 4 deletions packages/block-library/src/quote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { AlignmentToolbar, BlockControls, RichText } from '@wordpress/block-editor';
/**
* Internal dependencies
*/
import { BlockQuotation } from './blockquotation';
import { BlockQuotation } from '@wordpress/components';
Copy link
Contributor

@youknowriad youknowriad May 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should gather all these Platform specific components in a separate package or otherwise under the same parent variable.

Whether it's import { Blockquote, Div } from '@wordpress/platform'

or

import { PlatformComponents } from '@wordpress/components';
const { Blockquote, Div } = PlatformComponents;

Copy link
Member

@gziolo gziolo May 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this is a good point. I think we should extract all those components into their own package and maybe re-export from @wordpress/components for backward compatibility only. It's definitely out of the scope of this PR @SergioEstevao. Anyway, it's something we should decide on quite soon as you will need to use more HTML tags like:

  • figure, img
  • ul, ol, li
  • div


export default function QuoteEdit( { attributes, setAttributes, isSelected, mergeBlocks, onReplace, className } ) {
const { align, value, citation } = attributes;
Expand Down
15 changes: 15 additions & 0 deletions packages/components/src/primitives/block-quotation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# HorizontalRule

A drop-in replacement for the HTML [blockquote](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote) element that works both on the web and in the mobile apps. It indicates that the enclosed text is an extended quotation.

## Usage

```jsx
import { BlockQuotation } from '@wordpress/components';

const MyBlockQuotation = () => (
<BlockQuotation>
...Quote content
</BlockQuotation>
);
```
1 change: 1 addition & 0 deletions packages/components/src/primitives/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './svg';
export * from './horizontal-rule';
export * from './block-quotation';