Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move more block icons to the icons package #19838

Merged
merged 2 commits into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/block-library/src/post-content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { alignJustify as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import metadata from './block.json';
import icon from './icon';
import edit from './edit';

const { name } = metadata;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { title as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import metadata from './block.json';
import icon from './icon';
import edit from './edit';

const { name } = metadata;
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/preformatted/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/preformatted/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { preformatted as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/pullquote/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/pullquote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { pullquote as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import { SOLID_COLOR_STYLE_NAME } from './shared';
import deprecated from './deprecated';
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';

Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/quote/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/quote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { quote as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import deprecated from './deprecated';
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/separator/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/separator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { separator as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/shortcode/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/shortcode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { shortcode as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import save from './save';
import transforms from './transforms';
import metadata from './block.json';
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/site-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { mapMarker as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import metadata from './block.json';
import icon from './icon';
import edit from './edit';

const { name } = metadata;
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/spacer/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/spacer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { resizeCornerNE as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';

Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/subhead/icon.js

This file was deleted.

8 changes: 6 additions & 2 deletions packages/block-library/src/subhead/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { SVG, Path } from '@wordpress/components';

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand All @@ -19,7 +19,11 @@ export { metadata, name };
export const settings = {
title: __( 'Subheading (deprecated)' ),
description: __( 'This block is deprecated. Please use the Paragraph block instead.' ),
icon,
icon: (
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M7.1 6l-.5 3h4.5L9.4 19h3l1.8-10h4.5l.5-3H7.1z" />
</SVG>
),
supports: {
// Hide from inserter as this block is deprecated.
inserter: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/table/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
ToggleControl,
ToolbarGroup,
} from '@wordpress/components';
import { table as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -41,7 +42,6 @@ import {
toggleSection,
isEmptyTableSection,
} from './state';
import icon from './icon';

const BACKGROUND_COLORS = [
{
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/table/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { table as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import deprecated from './deprecated';
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/verse/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/verse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { verse as icon } from '@wordpress/icons';
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there's a more generic name for this icon:

Screenshot 2020-01-23 at 13 39 49

The general principle is, describe the icon, not the function.

Then there are some gray areas where the icon was created for a particular block, like "page break" and such.

This one is hard though — perhaps verse is fine, because I can't think of when you'd otherwise use this icon.


/**
* Internal dependencies
*/
import deprecated from './deprecated';
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/video/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import {
import {
withSelect,
} from '@wordpress/data';
import { video as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import { createUpgradedEmbedBlock } from '../embed/util';
import icon from './icon';
import VideoCommonSettings from './edit-common-settings';

const ALLOWED_MEDIA_TYPES = [ 'video' ];
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/video/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ import {
import { __, sprintf } from '@wordpress/i18n';
import { isURL } from '@wordpress/url';
import { doAction, hasAction } from '@wordpress/hooks';
import { video as SvgIcon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import style from './style.scss';
import SvgIcon from './icon';
import SvgIconRetry from './icon-retry';
import VideoCommonSettings from './edit-common-settings';

Expand Down
7 changes: 0 additions & 7 deletions packages/block-library/src/video/icon.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/block-library/src/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { video as icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
Expand Down
12 changes: 12 additions & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { default as Icon } from './icon';

export { default as alignJustify } from './library/align-justify';
export { default as archive } from './library/archive';
export { default as audio } from './library/audio';
export { default as button } from './library/button';
Expand All @@ -18,9 +19,20 @@ export { default as group } from './library/group';
export { default as html } from './library/html';
export { default as image } from './library/image';
export { default as list } from './library/list';
export { default as mapMarker } from './library/map-marker';
export { default as mediaAndText } from './library/media-and-text';
export { default as more } from './library/more';
export { default as pageBreak } from './library/page-break';
export { default as paragraph } from './library/paragraph';
export { default as postList } from './library/post-list';
export { default as preformatted } from './library/preformatted';
export { default as pullquote } from './library/pullquote';
export { default as quote } from './library/quote';
export { default as resizeCornerNE } from './library/resize-corner-n-e';
export { default as separator } from './library/separator';
export { default as shortcode } from './library/shortcode';
export { default as table } from './library/table';
export { default as title } from './library/title';
export { default as verse } from './library/verse';
export { default as video } from './library/video';
export { default as widget } from './library/widget';
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/**
* WordPress dependencies
*/
import { SVG, Path } from '@wordpress/components';
import { SVG, Path } from '@wordpress/primitives';

export default (
const alignJustify = (
<SVG xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path fill="none" d="M0 0h24v24H0V0z" />
<Path d="M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z" />
</SVG>
);

export default alignJustify;
4 changes: 2 additions & 2 deletions packages/icons/src/library/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*/
import { SVG, Path } from '@wordpress/primitives';

const saved = (
const check = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you.

<SVG xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24">
<Path d="M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2" />
</SVG>
);

export default saved;
export default check;

Loading