From 5f5ae541d30d4670da0e3118e5e71517fe0692d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20=28Greg=29=20Zi=C3=B3=C5=82kowski?= Date: Fri, 11 May 2018 09:27:17 +0200 Subject: [PATCH] Core blocks: Use core-blocks prefix for class names (#6684) --- core-blocks/button/edit.js | 2 +- core-blocks/button/editor.scss | 4 ++-- core-blocks/cover-image/editor.scss | 4 ++-- core-blocks/gallery/edit.js | 2 +- core-blocks/gallery/editor.scss | 8 ++++---- core-blocks/gallery/gallery-image.js | 2 +- core-blocks/image/edit.js | 12 ++++++------ core-blocks/image/editor.scss | 12 ++++++------ core-blocks/list/editor.scss | 6 +++--- core-blocks/list/index.js | 2 +- core-blocks/list/test/__snapshots__/index.js.snap | 2 +- core-blocks/more/edit.native.js | 10 +++++----- core-blocks/more/editor.native.scss | 8 ++++---- core-blocks/pullquote/editor.scss | 4 ++-- core-blocks/pullquote/index.js | 2 +- .../pullquote/test/__snapshots__/index.js.snap | 2 +- edit-post/assets/stylesheets/_z-index.scss | 4 ++-- editor/components/post-excerpt/style.scss | 2 +- editor/components/rich-text/index.js | 2 +- editor/components/rich-text/style.scss | 2 +- 20 files changed, 46 insertions(+), 46 deletions(-) diff --git a/core-blocks/button/edit.js b/core-blocks/button/edit.js index 8823f96f9749b..fe673cd063d14 100644 --- a/core-blocks/button/edit.js +++ b/core-blocks/button/edit.js @@ -142,7 +142,7 @@ class ButtonEdit extends Component { { isSelected && (
event.preventDefault() }> .dashicon { diff --git a/core-blocks/cover-image/editor.scss b/core-blocks/cover-image/editor.scss index 0fb1490a55502..5389d9039c546 100644 --- a/core-blocks/cover-image/editor.scss +++ b/core-blocks/cover-image/editor.scss @@ -21,11 +21,11 @@ color: inherit; } - &.has-left-content .block-rich-text__inline-toolbar { + &.has-left-content .editor-rich-text__inline-toolbar { justify-content: flex-start; } - &.has-right-content .block-rich-text__inline-toolbar{ + &.has-right-content .editor-rich-text__inline-toolbar{ justify-content: flex-end; } } diff --git a/core-blocks/gallery/edit.js b/core-blocks/gallery/edit.js index 31f6d5827c777..fbb197579763b 100644 --- a/core-blocks/gallery/edit.js +++ b/core-blocks/gallery/edit.js @@ -257,7 +257,7 @@ export default class GalleryEdit extends Component { { isSelected && -
+
) } -
-

+

+

{ __( 'Image Dimensions' ) }

-
+
-
+
{ [ 25, 50, 75, 100 ].map( ( scale ) => { const scaledWidth = Math.round( imageWidth * ( scale / 100 ) ); diff --git a/core-blocks/image/editor.scss b/core-blocks/image/editor.scss index edf2a48fb5e85..39ec742e84ebb 100644 --- a/core-blocks/image/editor.scss +++ b/core-blocks/image/editor.scss @@ -87,15 +87,15 @@ } } -.edit-post-sidebar .blocks-image__dimensions { +.edit-post-sidebar .core-blocks-image__dimensions { margin-bottom: 1em; - .blocks-image__dimensions__row { + .core-blocks-image__dimensions__row { display: flex; justify-content: space-between; - .blocks-image__dimensions__width, - .blocks-image__dimensions__height { + .core-blocks-image__dimensions__width, + .core-blocks-image__dimensions__height { margin-bottom: 0.5em; // Fix the text and placeholder text being misaligned in Safari @@ -104,11 +104,11 @@ } } - .blocks-image__dimensions__width { + .core-blocks-image__dimensions__width { margin-right: 5px; } - .blocks-image__dimensions__height { + .core-blocks-image__dimensions__height { margin-left: 5px; } } diff --git a/core-blocks/list/editor.scss b/core-blocks/list/editor.scss index 902c3ea86af98..d1e51c8560038 100644 --- a/core-blocks/list/editor.scss +++ b/core-blocks/list/editor.scss @@ -1,6 +1,6 @@ -.blocks-list .editor-rich-text__tinymce, -.blocks-list .editor-rich-text__tinymce ul, -.blocks-list .editor-rich-text__tinymce ol { +.core-blocks-list .editor-rich-text__tinymce, +.core-blocks-list .editor-rich-text__tinymce ul, +.core-blocks-list .editor-rich-text__tinymce ol { padding-left: 1.3em; margin-left: 1.3em; } diff --git a/core-blocks/list/index.js b/core-blocks/list/index.js index e3150ea2b021d..8c3924f87a15e 100644 --- a/core-blocks/list/index.js +++ b/core-blocks/list/index.js @@ -295,7 +295,7 @@ export const settings = { onSetup={ this.setupEditor } onChange={ this.setNextValues } value={ values } - wrapperClassName="blocks-list" + wrapperClassName="core-blocks-list" className={ className } placeholder={ __( 'Write list…' ) } onMerge={ mergeBlocks } diff --git a/core-blocks/list/test/__snapshots__/index.js.snap b/core-blocks/list/test/__snapshots__/index.js.snap index 86d020fb14cc6..611b782538e96 100644 --- a/core-blocks/list/test/__snapshots__/index.js.snap +++ b/core-blocks/list/test/__snapshots__/index.js.snap @@ -2,7 +2,7 @@ exports[`core/list block edit matches snapshot 1`] = `
diff --git a/core-blocks/more/edit.native.js b/core-blocks/more/edit.native.js index d63d1f5b0b666..3deb9f53b9abb 100644 --- a/core-blocks/more/edit.native.js +++ b/core-blocks/more/edit.native.js @@ -19,18 +19,18 @@ export default function MoreEdit( { attributes, setAttributes } ) { const value = customText !== undefined ? customText : defaultText; return ( - - - <!-- + + + <!-- setAttributes( { customText: newValue } ) } placeholder={ defaultText } /> - <Text className={ styles[ 'blocks-more-right-marker' ] }>--&gt;</Text> + <Text className={ styles[ 'core-blocks-more__right-marker' ] }>--&gt;</Text> </View> </View> ); } diff --git a/core-blocks/more/editor.native.scss b/core-blocks/more/editor.native.scss index bd86b75072404..baeb2c5dbcd6a 100644 --- a/core-blocks/more/editor.native.scss +++ b/core-blocks/more/editor.native.scss @@ -1,6 +1,6 @@ // @format -.blocks-more-container { +.core-blocks-more__container { align-items: center; padding-left: 4; padding-right: 4; @@ -8,15 +8,15 @@ padding-bottom: 4; } -.blocks-more-sub-container { +.core-blocks-more__sub-container { align-items: center; flex-direction: row; } -.blocks-more-left-marker { +.core-blocks-more__left-marker { padding-right: 4; } -.blocks-more-right-marker { +.core-blocks-more__right-marker { padding-left: 4; } diff --git a/core-blocks/pullquote/editor.scss b/core-blocks/pullquote/editor.scss index b52db1b10d61e..6b69e630e962b 100644 --- a/core-blocks/pullquote/editor.scss +++ b/core-blocks/pullquote/editor.scss @@ -1,7 +1,7 @@ .editor-block-list__block[data-type="core/pullquote"] { &[data-align="left"], &[data-align="right"] { - & .blocks-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]:before, + & .core-blocks-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]:before, & .editor-rich-text p { font-size: 20px; } @@ -24,7 +24,7 @@ transform: translateX( -50% ); } - & > .blocks-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]:before, + & > .core-blocks-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/core-blocks/pullquote/index.js b/core-blocks/pullquote/index.js index fd949bdeaff69..d325aa720f0a7 100644 --- a/core-blocks/pullquote/index.js +++ b/core-blocks/pullquote/index.js @@ -90,7 +90,7 @@ export const settings = { } /* translators: the text of the quotation */ placeholder={ __( 'Write quote…' ) } - wrapperClassName="blocks-pullquote__content" + wrapperClassName="core-blocks-pullquote__content" /> { ( citation || isSelected ) && ( <RichText diff --git a/core-blocks/pullquote/test/__snapshots__/index.js.snap b/core-blocks/pullquote/test/__snapshots__/index.js.snap index 3844d8a78013e..c1e9bd890f51e 100644 --- a/core-blocks/pullquote/test/__snapshots__/index.js.snap +++ b/core-blocks/pullquote/test/__snapshots__/index.js.snap @@ -5,7 +5,7 @@ exports[`core/pullquote block edit matches snapshot 1`] = ` class="wp-block-pullquote" > <div - class="blocks-pullquote__content editor-rich-text" + class="core-blocks-pullquote__content editor-rich-text" > <div> <div> diff --git a/edit-post/assets/stylesheets/_z-index.scss b/edit-post/assets/stylesheets/_z-index.scss index f19ab8b2e9531..db4ba2cbd1f10 100644 --- a/edit-post/assets/stylesheets/_z-index.scss +++ b/edit-post/assets/stylesheets/_z-index.scss @@ -22,11 +22,11 @@ $z-layers: ( '.editor-block-list__insertion-point': 5, '.editor-format-toolbar__link-modal': 81, // should appear above block controls '.editor-format-toolbar__link-container': 81, // link suggestions should also - '.blocks-gallery-item__inline-menu': 20, + '.core-blocks-gallery-item__inline-menu': 20, '.editor-block-settings-menu__popover': 21, // Below the header, but above the block toolbar '.editor-url-input__suggestions': 30, '.edit-post-header': 30, - '.blocks-button__inline-link .editor-url-input__suggestions': 6, // URL suggestions for button block above sibling inserter + '.core-blocks-button__inline-link .editor-url-input__suggestions': 6, // URL suggestions for button block above sibling inserter '.wp-block-image__resize-handlers': 1, // Resize handlers above sibling inserter // Should have lower index than anything else positioned inside the block containers diff --git a/editor/components/post-excerpt/style.scss b/editor/components/post-excerpt/style.scss index 9c344b39ebae9..f1f4941509318 100644 --- a/editor/components/post-excerpt/style.scss +++ b/editor/components/post-excerpt/style.scss @@ -1,4 +1,4 @@ -.editor-post-excerpt > .blocks-base-control { +.editor-post-excerpt > .components-base-control { margin-bottom: 0; } diff --git a/editor/components/rich-text/index.js b/editor/components/rich-text/index.js index 200c34eacd354..cd2488cd919f4 100644 --- a/editor/components/rich-text/index.js +++ b/editor/components/rich-text/index.js @@ -867,7 +867,7 @@ export class RichText extends Component { </BlockFormatControls> ) } { isSelected && inlineToolbar && ( - <div className="block-rich-text__inline-toolbar"> + <div className="editor-rich-text__inline-toolbar"> { formatToolbar } </div> ) } diff --git a/editor/components/rich-text/style.scss b/editor/components/rich-text/style.scss index 0e749d976865c..109123c5d6de6 100644 --- a/editor/components/rich-text/style.scss +++ b/editor/components/rich-text/style.scss @@ -82,7 +82,7 @@ } } -.block-rich-text__inline-toolbar { +.editor-rich-text__inline-toolbar { display: flex; justify-content: center; position: absolute;