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

Fix CoBlocks for Gutenberg 7.2.0: replace legacy editor- classes with block-editor- #1242

Merged
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
34 changes: 17 additions & 17 deletions src/blocks/accordion/accordion-item/styles/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
}

// Set proper margin for the first and last item within the accordion item for < Gutenberg 6.3.
.wp-block:first-of-type .editor-block-list__block-edit {
.wp-block:first-of-type .block-editor-block-list__block-edit {
margin-top: 4px;
}

.wp-block:nth-last-child(2) .editor-block-list__block-edit {
.wp-block:nth-last-child(2) .block-editor-block-list__block-edit {
margin-bottom: 4px;
}

Expand All @@ -37,10 +37,10 @@
}

.wp-block-coblocks-accordion
> .editor-inner-blocks
> .editor-block-list__layout
> .block-editor-inner-blocks
> .block-editor-block-list__layout
> [data-type="coblocks/accordion-item"]
> .editor-block-list__block-edit
> .block-editor-block-list__block-edit
> [data-block] {
margin-top: 0;
}
Expand Down Expand Up @@ -74,37 +74,37 @@

.has-child-selected
.wp-block-coblocks-accordion
> .editor-inner-blocks
> .editor-block-list__layout
> .block-editor-inner-blocks
> .block-editor-block-list__layout
> [data-type="coblocks/accordion-item"]
> .editor-block-list__block-edit
> .block-editor-block-list__block-edit
> [data-block],
.is-selected
.wp-block-coblocks-accordion
> .editor-inner-blocks
> .editor-block-list__layout
> .block-editor-inner-blocks
> .block-editor-block-list__layout
> [data-type="coblocks/accordion-item"]
> .editor-block-list__block-edit
> .block-editor-block-list__block-edit
> [data-block] {
margin-bottom: 42px;
margin-top: 0;
}

.wp-block-coblocks-accordion
> .editor-inner-blocks
> .editor-block-list__layout
> .block-editor-inner-blocks
> .block-editor-block-list__layout
> [data-type="coblocks/accordion-item"].is-selected:nth-last-child(2)
> .editor-block-list__block-edit
> .block-editor-block-list__block-edit
> [data-block] {
margin-bottom: 0;
}

.has-child-selected
.wp-block-coblocks-accordion
> .editor-inner-blocks
> .editor-block-list__layout
> .block-editor-inner-blocks
> .block-editor-block-list__layout
> [data-type="coblocks/accordion-item"]:nth-last-child(2)
> .editor-block-list__block-edit
> .block-editor-block-list__block-edit
> [data-block] {
margin-bottom: -21px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/accordion/test/accordion.cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ describe( 'Test CoBlocks Accordion Block', function() {
cy.get( '.wp-block[data-type="coblocks/accordion-item"]:nth-child(2)' )
.click( 'left' );

cy.get( '.editor-block-mover button[aria-label="Move up"]' )
cy.get( '.block-editor-block-mover button[aria-label="Move up"]' )
.click();

cy.get( '.wp-block[data-type="coblocks/accordion-item"]:nth-child(2) p.wp-block-coblocks-accordion-item__title' )
Expand Down
8 changes: 4 additions & 4 deletions src/blocks/alert/test/alert.cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,28 @@ describe( 'Test CoBlocks Alert Block', function() {

helpers.openSettingsPanel( 'Styles' );

cy.get( '.editor-block-styles__item-label' )
cy.get( '.block-editor-block-styles__item-label' )
.contains( 'Info' )
.click();

cy.get( '.wp-block-coblocks-alert' )
.should( 'have.class', 'is-style-info' );

cy.get( '.editor-block-styles__item-label' )
cy.get( '.block-editor-block-styles__item-label' )
.contains( 'Success' )
.click();

cy.get( '.wp-block-coblocks-alert' )
.should( 'have.class', 'is-style-success' );

cy.get( '.editor-block-styles__item-label' )
cy.get( '.block-editor-block-styles__item-label' )
.contains( 'Warning' )
.click();

cy.get( '.wp-block-coblocks-alert' )
.should( 'have.class', 'is-style-warning' );

cy.get( '.editor-block-styles__item-label' )
cy.get( '.block-editor-block-styles__item-label' )
.contains( 'Error' )
.click();

Expand Down
6 changes: 3 additions & 3 deletions src/blocks/author/styles/editor.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.wp-block[data-type="coblocks/author"] {
.editor-inner-blocks {
.editor-block-list__block-edit {
.block-editor-inner-blocks {
.block-editor-block-list__block-edit {
margin-bottom: 0;
margin-top: 0;
}
Expand Down Expand Up @@ -74,7 +74,7 @@
width: 110px;
}

.editor-block-list__layout {
.block-editor-block-list__layout {
margin-left: 0;
}
}
14 changes: 7 additions & 7 deletions src/blocks/buttons/styles/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
margin-top: 0;
}

.editor-inner-blocks {
> .editor-block-list__layout {
.block-editor-inner-blocks {
> .block-editor-block-list__layout {
display: flex;
justify-content: center;
}
}

.flex-align-left {
> .editor-inner-blocks {
> .editor-block-list__layout {
> .block-editor-inner-blocks {
> .block-editor-block-list__layout {
justify-content: flex-start;
}
}
}

.flex-align-right {
> .editor-inner-blocks {
> .editor-block-list__layout {
> .block-editor-inner-blocks {
> .block-editor-block-list__layout {
justify-content: flex-end;
}
}
Expand All @@ -30,7 +30,7 @@
.wp-block[data-type="core/button"] {
width: auto;

> .editor-block-list__block-edit {
> .block-editor-block-list__block-edit {
margin-bottom: 0;
margin-top: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/dynamic-separator/styles/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
}

.editor-block-styles__item-preview {
.block-editor-block-styles__item-preview {
.wp-block-coblocks-dynamic-separator {
height: 60px !important;
}
Expand Down
34 changes: 17 additions & 17 deletions src/blocks/features/styles/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
width: 100%;

&__inner {
> .editor-inner-blocks {
> .block-editor-inner-blocks {
width: 100%;

> .editor-block-list__layout {
> .block-editor-block-list__layout {
@media (min-width: 600px) {
display: flex;
}

> .wp-block > .editor-block-list__block-edit {
> .wp-block > .block-editor-block-list__block-edit {
margin-bottom: 0;
margin-top: 0;
}
Expand All @@ -26,12 +26,12 @@

// Fixes single feature full width issue.
&.has-1-columns {
.editor-inner-blocks {
.block-editor-inner-blocks {
width: 100%;
}
}

&.has-small-gutter > .editor-inner-blocks > .editor-block-list__layout > [data-type="coblocks/feature"] {
&.has-small-gutter > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="coblocks/feature"] {
@media (max-width: #{ ($break-small) }) {
&:not(:last-child) {
margin-bottom: $gutter--small * 2;
Expand All @@ -57,7 +57,7 @@
}
}

&.has-medium-gutter > .editor-inner-blocks > .editor-block-list__layout > [data-type="coblocks/feature"] {
&.has-medium-gutter > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="coblocks/feature"] {
@media (max-width: #{ ($break-small) }) {
&:not(:last-child) {
margin-bottom: $gutter--medium * 2;
Expand All @@ -83,7 +83,7 @@
}
}

&.has-large-gutter > .editor-inner-blocks > .editor-block-list__layout > [data-type="coblocks/feature"] {
&.has-large-gutter > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="coblocks/feature"] {
@media (max-width: #{ ($break-small) }) {
&:not(:last-child) {
margin-bottom: $gutter--large * 2;
Expand All @@ -109,7 +109,7 @@
}
}

&.has-huge-gutter > .editor-inner-blocks > .editor-block-list__layout > [data-type="coblocks/feature"] {
&.has-huge-gutter > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type="coblocks/feature"] {
@media (max-width: #{ ($break-small) }) {
&:not(:last-child) {
margin-bottom: $gutter--huge * 2;
Expand Down Expand Up @@ -140,7 +140,7 @@
.wp-block[data-type="core/heading"],
.wp-block[data-type="coblocks/icon"],
.wp-block[data-type="core/paragraph"] {
.editor-block-list__insertion-point {
.block-editor-block-list__insertion-point {
display: none;
position: relative;
}
Expand All @@ -157,7 +157,7 @@
&[data-columns="1"] {
.wp-block-coblocks-features {
&__inner {
> .editor-inner-blocks {
> .block-editor-inner-blocks {
width: 100%;
}
}
Expand All @@ -174,7 +174,7 @@
word-break: break-word;
}

.editor-default-block-appender {
.block-editor-default-block-appender {
display: none;
}

Expand All @@ -192,26 +192,26 @@

// Remove editor margins that do not exist on the frontend.
.wp-block-coblocks-feature__inner {
> .editor-inner-blocks {
> .editor-block-list__layout {
> .block-editor-inner-blocks {
> .block-editor-block-list__layout {
> .wp-block {
&:first-child {
> .editor-block-list__block-edit {
> .block-editor-block-list__block-edit {
margin-bottom: 0;
margin-top: 0;
}
> .editor-block-list__insertion-point {
> .block-editor-block-list__insertion-point {
display: none;
}
}

> .editor-block-list__block-edit {
> .block-editor-block-list__block-edit {
margin-bottom: 0;
margin-top: 0;
}
}
> div {
> .editor-default-block-appender {
> .block-editor-default-block-appender {
display: none !important;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/blocks/food-and-drinks/food-item/styles/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
padding: 0 !important;
width: 100% !important;

.editor-media-placeholder {
.block-editor-media-placeholder {
margin: 0 0 1.65em !important;
min-height: 264px;
outline: 1px dashed $dark-gray-150;
Expand Down Expand Up @@ -133,7 +133,7 @@
box-shadow: 0 0 0 2px $white, 0 0 0 3px $dark-gray-500;
transition: box-shadow .1s linear;
background-color: #fff;
color: #191e23;
color: #191e23;
outline: 2px solid transparent;
}

Expand All @@ -156,19 +156,19 @@
&:not(.is-toggled):hover {
span {
opacity: 0.725;
}
}
}

&:not(.is-toggled) {
span {
opacity: 0.55;
}
}
}
}
}

.is-style-list .wp-block-coblocks-food-item {
.editor-media-placeholder {
.block-editor-media-placeholder {
height: 100px;
min-height: 100px;
position: relative;
Expand Down Expand Up @@ -205,7 +205,7 @@
}

// Hide the Upload button.
.components-form-file-upload .editor-media-placeholder__button {
.components-form-file-upload .block-editor-media-placeholder__button {
display: none;
}

Expand Down
8 changes: 4 additions & 4 deletions src/blocks/food-and-drinks/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const Inspector = props => {
return (
<InspectorControls>
<PanelBody title={ __( 'Styles', 'coblocks' ) } initialOpen={ false }>
<div className="editor-block-styles block-editor-block-styles coblocks-editor-block-styles">
<div className="block-editor-block-styles block-editor-block-styles coblocks-editor-block-styles">
{ layoutOptions.map( style => (
<div
key={ `style-${ style.name }` }
className={ classnames(
'editor-block-styles__item block-editor-block-styles__item',
'block-editor-block-styles__item block-editor-block-styles__item',
{
'is-active': activeStyle === style,
}
Expand All @@ -45,10 +45,10 @@ const Inspector = props => {
tabIndex="0"
aria-label={ style.label || style.name }
>
<div className="editor-block-styles__item-preview block-editor-block-styles__item-preview">
<div className="block-editor-block-styles__item-preview block-editor-block-styles__item-preview">
{ attributes.showImages ? style.iconWithImages : style.icon }
</div>
<div className="editor-block-styles__item-label block-editor-block-styles__item-label">
<div className="block-editor-block-styles__item-label block-editor-block-styles__item-label">
{ style.label || style.name }
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/food-and-drinks/styles/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
}

// Adjust the editor preview to display our icons properly.
.coblocks-editor-block-styles .editor-block-styles__item-preview {
.coblocks-editor-block-styles .block-editor-block-styles__item-preview {
align-items: center;
display: flex;
justify-content: center;
Expand Down
Loading